Dataset Viewer
Auto-converted to Parquet Duplicate
id
int64
1
25.4k
question
stringlengths
29
14k
solutions
sequencelengths
1
6.38k
starter_code
stringlengths
0
955
input_output
stringlengths
33
74M
difficulty
stringclasses
6 values
raw_tags
stringlengths
2
277
name
nulllengths
4
105
source
stringclasses
9 values
tags
stringlengths
2
183
skill_types
stringclasses
120 values
url
stringlengths
36
108
Expected Auxiliary Space
nullclasses
4 values
time_limit
stringclasses
130 values
date
timestamp[us]
picture_num
stringclasses
8 values
memory_limit
stringclasses
28 values
Expected Time Complexity
nullclasses
9 values
1
There are $n$ candy boxes in front of Tania. The boxes are arranged in a row from left to right, numbered from $1$ to $n$. The $i$-th box contains $r_i$ candies, candies have the color $c_i$ (the color can take one of three values ​​— red, green, or blue). All candies inside a single box have the same color (and it is ...
[ "INF = 10000000000.0\nmax_n = 50\nmax_k = 2000\n\ndef main():\n\t(n, s, k) = map(int, input().split())\n\ts -= 1\n\tbuf = [''] * (max_n + 1)\n\tdp = [[0 for i in range(max_n + 1)] for j in range(max_k + 1)]\n\tr = list(map(int, input().split()))\n\tc = input()\n\tanswer = INF\n\tfor i in range(len(c)):\n\t\tbuf[i] ...
{"inputs": ["5 3 10\n1 2 3 4 5\nRGBRR\n", "2 1 15\n5 6\nRG\n", "6 1 21\n4 2 3 5 1 6\nRGBGRB\n", "6 1 21\n6 5 4 3 2 1\nRGBRGB\n", "1 1 10\n10\nR\n", "2 1 10\n5 5\nRG\n", "2 1 10\n5 6\nRR\n", "5 3 10\n1 2 3 4 5\nRGBRG\n", "9 1 6\n1 1 1 3 3 3 2 2 2\nRGGBRRGBB\n", "50 39 2000\n48 43 26 24 46 37 15 30 39 34 4 14 29 34 8 18 ...
HARD
['dp']
null
codeforces
['Dynamic programming']
['Dynamic programming']
https://codeforces.com/problemset/problem/1057/C
null
null
2019-12-31T00:00:00
null
null
null
3
If you visit Aizu Akabeko shrine, you will find a unique paper fortune on which a number with more than one digit is written. Each digit ranges from 1 to 9 (zero is avoided because it is considered a bad omen in this shrine). Using this string of numeric values, you can predict how many years it will take before your ...
[ "def sub(maxs, mins):\n\tfor i in range(len(maxs)):\n\t\tif maxs[i] != mins[i]:\n\t\t\tif i == len(maxs) - 1:\n\t\t\t\treturn int(maxs[i]) - int(mins[i])\n\t\t\tif i == len(maxs) - 2:\n\t\t\t\treturn int(maxs[i:i + 2]) - int(mins[i:i + 2])\n\t\t\treturn 10\n\treturn 0\n\ndef checkEqual(S):\n\tans = 8\n\tfor k in ra...
{"inputs": ["9714431", "16612328", "23422731", "754526", "955577", "75547", "2112", "799", "88", "32523857", "4787", "1859551", "135661", "3675", "156692", "167918384", "83994", "4837847", "14513597", "15282598", "12659326", "1468417", "6280", "115464", "52376853", "2315", "3641224", "97187", "836", "195884", "36250", ...
UNKNOWN_DIFFICULTY
[]
null
aizu
[]
[]
null
null
1.0 seconds
null
null
268.435456 megabytes
null
4
You have a deck of $n$ cards, and you'd like to reorder it to a new one. Each card has a value between $1$ and $n$ equal to $p_i$. All $p_i$ are pairwise distinct. Cards in a deck are numbered from bottom to top, i. e. $p_1$ stands for the bottom card, $p_n$ is the top card. In each step you pick some integer $k > 0$...
[ "import heapq\nfrom math import sqrt\nimport operator\nimport sys\ninf_var = 0\nif inf_var == 1:\n\tinf = open('input.txt', 'r')\nelse:\n\tinf = sys.stdin\ninput = inf.readline\n\ndef read_one_int():\n\treturn int(input().rstrip('\\n'))\n\ndef read_list_of_ints():\n\tres = [int(val) for val in input().rstrip('\\n')...
{"inputs": ["4\n4\n1 2 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n", "4\n4\n2 1 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n", "4\n4\n2 1 3 4\n5\n1 5 2 4 3\n6\n2 4 5 3 6 1\n1\n1\n", "4\n4\n1 2 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n"], "outputs": ["4 3 2 1\n5 2 4 3 1\n6 1 5 3 4 2\n1\n", "4 3 2 1\n5 2 4 3 1\n6 1 5 3 4 2\n1...
EASY
['data structures', 'greedy', 'math']
null
codeforces
['Data structures', 'Mathematics', 'Greedy algorithms']
['Data structures', 'Greedy algorithms']
https://codeforces.com/problemset/problem/1492/B
null
1 second
2021-02-23T00:00:00
0
512 megabytes
null
8
An **anagram** is the result of rearranging the letters of a word to produce a new word. **Note:** anagrams are case insensitive Complete the function to return `true` if the two arguments given are anagrams of each other; return `false` otherwise. ## Examples * `"foefet"` is an anagram of `"toffee"` * `"Buckethe...
[ "def is_anagram(test, original):\n\treturn sorted(original.lower()) == sorted(test.lower())\n", "from collections import Counter\n\ndef is_anagram(test, original):\n\treturn Counter(test.lower()) == Counter(original.lower())\n", "def is_anagram(test, original):\n\treturn sorted(test.upper()) == sorted(original....
def is_anagram(test, original):
{"fn_name": "is_anagram", "inputs": [["foefet", "toffee"], ["Buckethead", "DeathCubeK"], ["Twoo", "WooT"], ["dumble", "bumble"], ["ound", "round"], ["apple", "pale"]], "outputs": [[true], [true], [true], [false], [false], [false]]}
EASY
['Strings', 'Fundamentals']
null
codewars
['String algorithms', 'Fundamentals']
[]
https://www.codewars.com/kata/529eef7a9194e0cbc1000255
null
null
null
null
null
null
10
Arkady decides to observe a river for n consecutive days. The river's water level on each day is equal to some real value. Arkady goes to the riverside each day and makes a mark on the side of the channel at the height of the water level, but if it coincides with a mark made before, no new mark is created. The water d...
[ "n = int(input())\nabove = list(map(int, input().split()))\ntotal = [x + 1 for x in above]\nfor i in range(0, n - 1)[::-1]:\n\ttotal[i] = max(total[i], total[i + 1] - 1)\nfor i in range(1, n):\n\ttotal[i] = max(total[i], total[i - 1])\nbelow = [t - a - 1 for (t, a) in zip(total, above)]\nprint(sum(below))\n", "fr...
{"inputs": ["3\n0 1 1\n", "4\n0 0 1 2\n", "2\n0 0\n", "4\n0 1 1 0\n", "3\n0 1 0\n", "2\n0 1\n", "8\n0 0 2 0 3 0 3 2\n", "3\n0 1 2\n", "10\n0 0 2 2 3 2 3 3 1 3\n", "6\n0 0 0 2 0 1\n", "10\n0 1 2 0 4 5 3 6 0 5\n", "4\n0 0 1 1\n", "3\n0 0 0\n", "9\n0 1 0 1 1 4 0 4 8\n", "100\n0 1 2 2 3 0 1 5 6 6 0 0 8 7 1 9 9 4 10 11 12 2...
MEDIUM_HARD
['data structures', 'greedy', 'dp']
null
codeforces
['Dynamic programming', 'Data structures', 'Greedy algorithms']
['Dynamic programming', 'Data structures', 'Greedy algorithms']
https://codeforces.com/problemset/problem/957/D
null
1.0 seconds
null
null
256.0 megabytes
null
12
Tom has finally taken over the business empire and now looking for a new Name of the business to make a new start. Joe (Tom's dear friend) suggested a string $S$ consisting of Uppercase and lowercase letters Tom wants to make some changes as per the following criteria: 1) String should $not$ have any vowels ...
[ "s = input().lower()\nvow = ['a', 'e', 'i', 'o', 'u', 'y']\nans = ''\nfor ch in s:\n\tif ch in vow:\n\t\tcontinue\n\tif ch.isalpha():\n\t\tans += '.' + ch\nprint(ans)\n" ]
{"inputs": [["CodeSprInT"]], "outputs": [[".c.d.s.p.r.n.t"]]}
UNKNOWN_DIFFICULTY
[]
null
codechef
[]
[]
https://www.codechef.com/SPRT2020/problems/EMPRNM
null
null
null
null
null
null
13
When Chef was born, his parents took him to the famous monk Doctor Strange to know whether he will land himself in heaven after his life or not. According to Strange, Chef will live for $L$ years in total. If he wants to go to heaven, he must spend at least $50\%$ of his life years doing good deeds. He also shows them ...
[ "for i in range(0, int(input())):\n\tn = int(input())\n\tl = list(input())\n\tt = 0\n\ta = 0\n\tb = 0\n\tfor j in range(0, n):\n\t\tt = t + 1\n\t\tif l[j] == '0':\n\t\t\ta = a + 1\n\t\telse:\n\t\t\tb = b + 1\n\t\tif b >= t / 2:\n\t\t\tprint('YES')\n\t\t\tbreak\n\t\telif j == n - 1 and b < t / 2:\n\t\t\tprint('NO')\...
{"inputs": ["3\n2\n10\n3\n001\n4\n0100"], "outputs": ["YES\nNO\nYES"]}
EASY
['Algorithms', 'Greedy']
null
codechef
['Greedy algorithms']
['Greedy algorithms']
https://www.codechef.com/problems/CCHEAVEN
null
0.5 seconds
2021-04-02T00:00:00
0
50000 bytes
null
15
You are given an array A of N integers A_{1}, A_{2}, \ldots, A_{N}. Determine if there are two [permutations] B and C of this array, for which the following condition is satisfied: * There doesn't exist a pair of integers (i, j) such that 1 ≤ i ≤ j ≤ N and (i, j) \neq (1, N), for which the subarray B[i:j] is a permuta...
[ "t = int(input())\nfor _ in range(t):\n\tn = int(input())\n\tl = list(map(int, input().split()))\n\td = {}\n\tfor i in l:\n\t\td[i] = d.get(i, 0) + 1\n\tmx = 0\n\tfor i in d.values():\n\t\tif i >= mx:\n\t\t\tmx = i\n\tif len(d) == 2:\n\t\tprint('NO')\n\telif n % 2 == 0:\n\t\tif mx <= n // 2:\n\t\t\tprint('YES')\n\t...
{"inputs": ["3\n3\n1 1 2\n4\n19 39 19 84\n6\n1 2 3 1 2 3"], "outputs": ["NO\nYES\n19 19 39 84 \n39 84 19 19 \nYES\n1 1 2 2 3 3 \n2 3 3 1 1 2 "]}
HARD
['shift', 'sorting', 'trygub_adm', 'cook141', 'constructive']
null
codechef
['Sorting', 'Constructive algorithms']
['Sorting']
https://www.codechef.com/problems/DIFSUBARRAYS
null
1 seconds
2022-04-26T00:00:00
0
50000 bytes
null
18
"You are given an array $a_1, a_2, \\dots, a_n$. You can perform the following operation any number (...TRUNCATED)
["from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nfrom bisect impor(...TRUNCATED)
"{\"inputs\": [\"5\\n4 3 2 2 3\\n\", \"7\\n3 3 4 4 4 3 3\\n\", \"3\\n1 3 5\\n\", \"1\\n1000\\n\", \"(...TRUNCATED)
HARD
['greedy', 'dp']
null
codeforces
['Dynamic programming', 'Greedy algorithms']
['Dynamic programming', 'Greedy algorithms']
https://codeforces.com/problemset/problem/1312/E
null
2 seconds
2020-03-09T00:00:00
0
256 megabytes
null
20
"There are players standing in a row each player has a digit written on their T-Shirt (multiple play(...TRUNCATED)
["import sys\n\ndef GRIG(L):\n\tLENT = len(L)\n\tMINT = 1\n\tGOT = 0\n\tDY = [[{x: 0 for x in range((...TRUNCATED)
{"inputs": [["1", "123343"]], "outputs": [["3"]]}
UNKNOWN_DIFFICULTY
[]
null
codechef
[]
[]
https://www.codechef.com/COVO2020/problems/GRIG
null
null
null
null
null
null
End of preview. Expand in Data Studio

YAML Metadata Warning:The task_categories "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

Introduction

This dataset contains verified solutions from the TACO dataset's training set. Solutions that fail to pass all the test cases are removed. Problems with no correct solution are also removed.

The solutions were executed on Intel E5-2620 v3 CPUs with the execution timeout set to 10 seconds.

Statistics in the training set

Dataset # Problems # Solutions
TACO 25443 1468722
TACO-verified 12898 1043251
Correct Ratio 50.69 % 71.03 %

Updates

(Apr 11, 2025) Hello, friends from DeepCoder!

Citation

Please consider citing this repo if you find it useful.

@misc{likaixin2024taco-verified,
  author       = {Kaixin Li},
  title        = {Verified TACO Problems},
  year         = {2024},
  url          = {https://huggingface.co/datasets/likaixin/TACO-verified},
  howpublished = {\url{https://huggingface.co/datasets/likaixin/TACO-verified}},
}
Downloads last month
673

Models trained or fine-tuned on likaixin/TACO-verified