Dataset Viewer
Auto-converted to Parquet Duplicate
problem
stringlengths
30
9.6k
solutions
listlengths
1
3.33k
tests
stringlengths
101
160M
starter_code
stringclasses
81 values
metadata
stringclasses
78 values
question
stringlengths
595
10.2k
ground_truth
stringlengths
476
160M
data_source
stringclasses
1 value
uid
stringlengths
11
15
index
int64
0
6.43k
responses
listlengths
0
8
is_judge_example
bool
2 classes
Solve the following coding problem using the programming language python: According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also if the jacket has only one button, it should be fastened, so the jacket will not swing...
[ "```python\nn = int(input())\na = list(map(int,input().split()))\nc = a.count(0)\nif (c>1 or c<1) and n>1 :\n print('NO')\nelif n==1 and c==1:\n print('NO')\nelse:\n print('YES')\n\n```" ]
[{"type": "stdin_stdout", "input": "3\n1 0 0\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "3\n1 0 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10\n0 0 0 0 0 0 0 0 0 0\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "231\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
null
null
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. Solve the following coding problem using the programming language python: According to rules of the Berland fashion, a jacket should...
[{"type": "stdin_stdout", "input": "3\n1 0 0\n", "output": "NO\n", "metadata": {"func_name": null}}, {"type": "stdin_stdout", "input": "3\n1 0 1\n", "output": "YES\n", "metadata": {"func_name": null}}, {"type": "stdin_stdout", "input": "10\n0 0 0 0 0 0 0 0 0 0\n", "output": "NO\n", "metadata": {"func_name": null}}, {"t...
livecodebench
deepcoder_9272
0
[ "```python\nn = int(input())\nbuttons = list(map(int, input().split()))\n\n# Count the number of unfastened buttons (0s)\nunfastened_count = buttons.count(0)\n\n# Check the conditions:\n# - If there's only one button, it must be fastened (so 0 unfastened)\n# - If there are more than one button, exactly one button s...
true
Solve the following coding problem using the programming language python: In 40XX, the Earth was invaded by aliens! Already most of the Earth has been dominated by aliens, leaving Tsuruga Castle Fortress as the only remaining defense base. Suppression units are approaching the Tsuruga Castle Fortress one after another...
[ "```python\nimport math\n\nclass Ufo:\n\n\tdef __init__(self, x, y, r, v):\n\t\tself.dist = get_dist(x, y)\n\t\tself.angle = get_angle(y, x)\n\t\tself.rad = r\n\t\tself.v = v\n\ndef get_dist(x, y):\n\treturn (x ** 2 + y ** 2) ** (1 / 2)\n\ndef get_angle(x, y):\n\tangle = math.atan2(y, x)\n\tif angle < 0:\n\t\tangle...
[{"type": "stdin_stdout", "input": "100 5\n101 101 5 5\n110 110 2 3\n-112 -100 9 11\n-208 160 82 90\n-110 108 10 2\n10 11\n15 0 5 1\n25 0 5 1\n35 0 5 1\n45 0 5 1\n55 0 5 1\n65 0 5 1\n75 0 5 1\n85 0 5 1\n95 0 5 1\n-19 0 5 20\n-30 0 500 5\n0 0", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "100 5\n101 101 5 5\n...
null
null
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. Solve the following coding problem using the programming language python: In 40XX, the Earth was invaded by aliens! Already most of ...
[{"type": "stdin_stdout", "input": "100 5\n101 101 5 5\n110 110 2 3\n-112 -100 9 11\n-208 160 82 90\n-110 108 10 2\n10 11\n15 0 5 1\n25 0 5 1\n35 0 5 1\n45 0 5 1\n55 0 5 1\n65 0 5 1\n75 0 5 1\n85 0 5 1\n95 0 5 1\n-19 0 5 20\n-30 0 500 5\n0 0", "output": "1\n1\n", "metadata": {"func_name": null}}, {"type": "stdin_stdout...
livecodebench
deepcoder_15760
1
[]
false
Solve the following coding problem using the programming language python: Milly and Pranjul are playing a game in which Pranjul will give an index of a chocolate. Then, Milly has to tell him the box number in which that chocolate is in. There are N such boxes and Ci chocolates are there in i^th the box. Description of...
[ "```python\ndef findIndex(val,list,min,max):\n\tif min == max :\n\t\treturn min\n\tavg = (min+max)/2\n\tif val == list[avg]:\n\t\treturn avg\n\tif val > list[avg]:\n\t\tif val < list[avg+1]:\n\t\t\treturn avg+1\n\t\tif avg<max:\n\t\t\treturn findIndex(val,list,avg+1,max)\n\t\treturn avg\n\telse:\n\t\tif val > list[...
[{"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n4\n\nSAMPLE", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n3\n4\n\nSAMPLE", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n1\n\nSAMPLE", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n1\n2\n4\n\nSAMPLE", "out...
null
null
You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. Solve the following coding problem using the programming language python: Milly and Pranjul are playing a game in which Pranjul will...
[{"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n4\n\nSAMPLE", "output": "1\n2\n", "metadata": {"func_name": null}}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n3\n4\n\nSAMPLE", "output": "2\n2\n", "metadata": {"func_name": null}}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n1\n\nSAMPLE", "output": "1\n1\n", "m...
livecodebench
deepcoder_4789
2
[ "```python\nimport bisect\n\n# Read inputs\nn = int(input())\nc = list(map(int, input().split()))\nq = int(input())\n\n# Build prefix sum array (1-indexed)\n# prefix[i] represents the total chocolates from box 1 to box i\nprefix = [0]\nfor i in range(n):\n prefix.append(prefix[-1] + c[i])\n\n# Process queries\nf...
true
"Solve the following coding problem using the programming language python:\n\nApart from having lots(...TRUNCATED)
["```python\ndef main():\n s = input()\n n = len(s)\n t = int(str(int(s[0]) + 1) + '0' * (n(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"1\\n\", \"metadata\": {\"func_name(...TRUNCATED)
livecodebench
deepcoder_208
3
["```python\nn = int(input())\n\nmin_next = float('inf')\n\n# Check all possible powers of 10 from 0(...TRUNCATED)
true
"Solve the following coding problem using the programming language python:\n\nKate likes to count wo(...TRUNCATED)
["```python\nfrom re import compile, finditer\nOMIT = {'a', 'the', 'on', 'at', 'of', 'upon', 'in', '(...TRUNCATED)
"[{\"type\": \"function_call\", \"fn_name\": \"word_count\", \"input\": [\"hello there\"], \"output\(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"function_call\", \"fn_name\": \"word_count\", \"input\": [\"hello there\"], \"output\(...TRUNCATED)
livecodebench
deepcoder_11109
4
["```python\ndef word_count(s):\n # Define the words to exclude (case-insensitive)\n excluded_(...TRUNCATED)
true
"Solve the following coding problem using the programming language python:\n\nThere are times you re(...TRUNCATED)
["```python\n# python3\n\ndef readline(): return tuple(map(int, input().split()))\n\n\ndef main():\n(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"6 0\\n0 1 1 2 3 2\\n\", \"output\": \"1 2 2 3 3 3 \\n\"}(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"6 0\\n0 1 1 2 3 2\\n\", \"output\": \"1 2 2 3 3 3 \\n\",(...TRUNCATED)
livecodebench
deepcoder_717
5
[]
false
"Alan decided to get in shape for the summer, so he created a precise workout plan to follow. His pl(...TRUNCATED)
["(n, k) = tuple(map(int, input().split()))\nplan = list(map(int, input().split()))\npower = int(inp(...TRUNCATED)
"{\"inputs\": [\"5 1\\n1 1 1 2 9\\n1000000000\\n10 20 30 40 50\\n\", \"5 49\\n22 23 11 17 49\\n50\\n(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"input\": \"5 1\\n1 1 1 2 9\\n1000000000\\n10 20 30 40 50\\n\", \"output\": \"10\", \"testtype\"(...TRUNCATED)
livecodebench
deepcoder_17697
6
["```python\nN, K = map(int, input().split())\nX = list(map(int, input().split()))\nA = int(input())(...TRUNCATED)
true
"Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer is s(...TRUNCATED)
["```python\nN = int(input())\nTA = [map(int, input().split()) for _ in range(N)]\n\nT, A = 1, 1\nfo(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"5\\n3 10\\n48 17\\n31 199\\n231 23\\n3 2\", \"output\": (...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"5\\n3 10\\n48 17\\n31 199\\n231 23\\n3 2\", \"output\": (...TRUNCATED)
livecodebench
deepcoder_4572
7
[]
false
"Solve the following coding problem using the programming language python:\n\nVitya has just started(...TRUNCATED)
["```python\ns = input()\nok = 1\nn = len(s)\n\ndef is_vowel(c):\n\treturn c in \"aouie\"\n\nfor i, (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"sumimasen\\n\", \"output\": \"YES\\n\"}, {\"type\": \"st(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"sumimasen\\n\", \"output\": \"YES\\n\", \"metadata\": {\(...TRUNCATED)
livecodebench
deepcoder_482
8
["```python\ns = input().strip()\nvowels = {\"a\", \"o\", \"u\", \"i\", \"e\"}\n\nis_berlanese = Tru(...TRUNCATED)
true
"Solve the following coding problem using the programming language python:\n\nVasya is writing an op(...TRUNCATED)
["```python\n#!/usr/bin/env python3\n\ndef pwd(cur):\n if len(cur) == 0:\n print('/')\n (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"7\\npwd\\ncd /home/vasya\\npwd\\ncd ..\\npwd\\ncd vasya/(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"7\\npwd\\ncd /home/vasya\\npwd\\ncd ..\\npwd\\ncd vasya/(...TRUNCATED)
livecodebench
deepcoder_6622
9
[]
false
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
13