Dataset Viewer
Auto-converted to Parquet Duplicate
question
stringlengths
139
6.12k
solutions
stringlengths
2
1.36M
starter_code
stringlengths
0
951
input_output
stringlengths
34
28.9M
difficulty
stringclasses
1 value
raw_tags
stringlengths
6
175
name
stringclasses
173 values
source
stringclasses
8 values
tags
stringclasses
464 values
skill_types
stringclasses
70 values
url
stringlengths
36
131
⌀
Expected Auxiliary Space
stringclasses
131 values
time_limit
stringclasses
35 values
date
stringclasses
514 values
picture_num
stringclasses
6 values
memory_limit
stringclasses
8 values
Expected Time Complexity
stringclasses
233 values
taco_id
stringlengths
16
16
taco_source_index
int64
4
25.4k
skill_labels
listlengths
1
4
sampled_skill
stringclasses
8 values
sampling_stage
stringclasses
2 values
Given an array A[] of N positive integers which can contain integers from 1 to P where elements can be repeated or can be absent from the array. Your task is to count the frequency of all elements from 1 to N. Note: The elements greater than N in the array can be ignored for counting and do modify the array in-place. E...
["class Solution:\n\n\tdef frequencyCount(self, arr, N, P):\n\t\tarr.sort()\n\t\tc = 0\n\t\td = {}\n\t\tfor i in arr:\n\t\t\tif i not in d:\n\t\t\t\td[i] = 1\n\t\t\telse:\n\t\t\t\td[i] += 1\n\t\tfor i in range(1, N + 1):\n\t\t\tif i in d.keys():\n\t\t\t\tarr[i - 1] = d[i]\n\t\t\telse:\n\t\t\t\tarr[i - 1] = 0\n\t\tretur...
class Solution: #Function to count the frequency of all elements from 1 to N in the array. def frequencyCount(self, arr, N, P): # code here
{"inputs": ["N = 5\r\narr[] = {2, 3, 2, 3, 5}\r\nP = 5", "N = 4\r\narr[] = {3,3,3,3}\r\nP = 3"], "outputs": ["0 2 2 0 1", "0 0 4 0"]}
EASY
['Data Structures', 'Arrays', 'Hash']
null
geeksforgeeks
['String algorithms', 'Data structures']
['Data structures']
https://practice.geeksforgeeks.org/problems/frequency-of-array-elements-1587115620/1
null
null
0
null
taco_train_02940
2,940
[ "Data structures" ]
Data structures
top_up
Given an array A[ ] of positive integers of size N, where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are M students, the task is to distribute chocolate packets among M students such that : 1. Each student gets exactly one packet. 2. The diffe...
["class Solution:\n\n\tdef findMinDiff(self, arr, n, m):\n\t\tif m == 0 or n == 0:\n\t\t\treturn 0\n\t\tarr.sort()\n\t\tif n < m:\n\t\t\treturn -1\n\t\tmin_diff = arr[n - 1] - arr[0]\n\t\tfor i in range(len(arr) - m + 1):\n\t\t\tmin_diff = min(min_diff, arr[i + m - 1] - arr[i])\n\t\treturn min_diff\n", "class Solution:...
#User function Template for python3 class Solution: def findMinDiff(self, A,N,M): # code here
{"inputs": ["N = 8, M = 5\nA = {3, 4, 1, 9, 56, 7, 9, 12}", "N = 7, M = 3\nA = {7, 3, 2, 4, 9, 12, 56}"], "outputs": ["6", "2"]}
EASY
['Algorithms', 'Sorting']
null
geeksforgeeks
['Sorting']
['Sorting']
https://practice.geeksforgeeks.org/problems/chocolate-distribution-problem3825/1
O(1)
null
null
0
null
O(N*Log(N))
taco_train_25301
25,301
[ "Sorting" ]
Sorting
top_up
You are given an array of non-negative integers, your task is to complete the series from 0 to the highest number in the array. If the numbers in the sequence provided are not in order you should order them, but if a value repeats, then you must return a sequence with only one item, and the value of that item must be ...
["def complete_series(a):\n\treturn list(range(max(a) + 1)) if len(a) == len(set(a)) else [0]\n", "def complete_series(seq):\n\tfrom collections import Counter\n\tif Counter(seq).most_common()[0][1] > 1:\n\t\treturn [0]\n\treturn [i for i in range(max(seq) + 1)]\n", "def complete_series(seq):\n\treturn list(range(1 + (...
def complete_series(seq):
{"fn_name": "complete_series", "inputs": [[[0, 1]], [[1, 4, 6]], [[3, 4, 5]], [[2, 1]], [[1, 4, 4, 6]]], "outputs": [[[0, 1]], [[0, 1, 2, 3, 4, 5, 6]], [[0, 1, 2, 3, 4, 5]], [[0, 1, 2]], [[0]]]}
EASY
['Arrays', 'Fundamentals', 'Lists']
null
codewars
['Fundamentals', 'Data structures']
['Data structures']
https://www.codewars.com/kata/580a4001d6df740d61000301
null
null
null
null
null
null
taco_train_25196
25,196
[ "Data structures" ]
Data structures
top_up
There is a house with 4 levels. In that house there is an elevator. You can program this elevator to go up or down, depending on what button the user touches inside the elevator. Valid levels must be only these numbers: `0,1,2,3` Valid buttons must be only these strings: `'0','1','2','3'` Possible return values are...
["levels = [0, 1, 2, 3]\nbuttons = ['0', '1', '2', '3']\n\ndef goto(level, button):\n\tif level not in levels or button not in buttons:\n\t\treturn 0\n\telse:\n\t\treturn int(button) - level\n", "def goto(l, b):\n\tif b in ('0', '1', '2', '3') and l in (0, 1, 2, 3):\n\t\treturn int(b) - l\n\treturn 0\n", "def goto(leve...
def goto(level,button):
{"fn_name": "goto", "inputs": [[0, "0"], [0, "1"], [0, "2"], [0, "3"], [1, "0"], [1, "1"], [1, "2"], [1, "3"], [2, "0"], [2, "1"], [2, "2"], [2, "3"], [3, "0"], [3, "1"], [3, "2"], [3, "3"], [0, "4"], [0, null], [1, "4"], [1, null], [2, "4"], [2, null], [3, "4"], [3, null], [4, "2"], [null, "2"], [[], "2"], [3, {}], ["...
EASY
['Fundamentals', 'State Machines']
null
codewars
['Dynamic programming', 'Fundamentals']
['Dynamic programming']
https://www.codewars.com/kata/52ed326b8df6540e06000029
null
null
null
null
null
null
taco_train_21751
21,751
[ "Dynamic programming" ]
Dynamic programming
initial
"Cat Furrier Transform is a popular algorithm among cat programmers to create longcats. As one of th(...TRUNCATED)
"[\"import sys\\nx = int(input())\\n\\ndef solve(cnt, odds):\\n\\tprint(cnt)\\n\\tprint(' '.join(lis(...TRUNCATED)
"{\"inputs\": [\"39\\n\", \"1\\n\", \"7\\n\", \"1000000\\n\", \"524288\\n\", \"524289\\n\", \"524287(...TRUNCATED)
EASY
['dfs and similar', 'bitmasks', 'math', 'constructive algorithms']
null
codeforces
['Bit manipulation', 'Graph traversal', 'Mathematics', 'Constructive algorithms']
['Bit manipulation']
https://codeforces.com/problemset/problem/1152/B
null
null
2019-12-31
null
null
null
taco_train_22005
22,005
[ "Bit manipulation" ]
Bit manipulation
initial
"Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in s(...TRUNCATED)
"[\"(n, k) = map(int, input().split())\\ns = input()\\nc = [0] * 26\\nfor i in s:\\n\\tc[ord(i) - 97(...TRUNCATED)
"{\"inputs\": [\"5 3\\nxyabd\\n\", \"7 4\\nproblem\\n\", \"2 2\\nab\\n\", \"12 1\\nabaabbaaabbb\\n\"(...TRUNCATED)
EASY
['greedy', 'sortings', 'implementation']
null
codeforces
['Sorting', 'Implementation', 'Greedy algorithms']
['Sorting', 'Greedy algorithms']
https://codeforces.com/problemset/problem/1011/A
null
null
2019-12-31
null
null
O(N)
taco_train_04426
4,426
[ "Greedy algorithms", "Sorting" ]
Sorting
initial
"Valera had two bags of potatoes, the first of these bags contains x (x ≥ 1) potatoes, and the sec(...TRUNCATED)
"[\"(y, k, n) = map(int, input().split())\\nl1 = n % k\\nn -= l1\\nt = n - y\\nif t == 0:\\n\\tprint(...TRUNCATED)
"{\"inputs\": [\"10 1 10\\n\", \"10 6 40\\n\", \"10 1 20\\n\", \"84817 1 33457\\n\", \"21 37 99\\n\"(...TRUNCATED)
EASY
['greedy', 'math', 'implementation']
null
codeforces
['Mathematics', 'Implementation', 'Greedy algorithms']
['Greedy algorithms']
https://codeforces.com/problemset/problem/239/A
null
null
2019-12-31
null
null
null
taco_train_01146
1,146
[ "Greedy algorithms" ]
Greedy algorithms
initial
"Given a positive integer $k$, two arrays are called $k$-similar if:\n\nthey are strictly increasing(...TRUNCATED)
"[\"import sys\\ninput = sys.stdin.readline\\n(n, q, k) = map(int, input().split())\\na = list(map(i(...TRUNCATED)
"{\"inputs\": [\"4 2 5\\n1 2 4 5\\n2 3\\n3 4\\n\", \"6 5 10\\n2 4 6 7 8 9\\n1 4\\n1 2\\n3 5\\n1 6\\n(...TRUNCATED)
EASY
['math', 'implementation', 'dp']
null
codeforces
['Mathematics', 'Dynamic programming', 'Implementation']
['Dynamic programming']
https://codeforces.com/problemset/problem/1485/B
null
2 seconds
2021-02-12
0
256 megabytes
null
taco_train_14778
14,778
[ "Dynamic programming" ]
Dynamic programming
initial
"The odd and even numbers are fighting against each other!\n\nYou are given a list of positive integ(...TRUNCATED)
"[\"def bits_battle(nums):\\n\\tbinary = '{:b}'.format\\n\\tevens = odds = 0\\n\\tfor num in nums:\\(...TRUNCATED)
def bits_battle(numbers):
"{\"fn_name\": \"bits_battle\", \"inputs\": [[[5, 3, 14]], [[3, 8, 22, 15, 78]], [[]], [[1, 13, 16]](...TRUNCATED)
EASY
['Fundamentals', 'Bits', 'Binary']
null
codewars
['Bit manipulation', 'Fundamentals']
['Bit manipulation']
https://www.codewars.com/kata/58856a06760b85c4e6000055
null
null
null
null
null
null
taco_train_08063
8,063
[ "Bit manipulation" ]
Bit manipulation
initial
"You have $n$ students under your control and you have to compose exactly two teams consisting of so(...TRUNCATED)
"[\"for i in range(int(input())):\\n\\tn = int(input())\\n\\ta = list(map(int, input().split()))\\n\(...TRUNCATED)
"{\"inputs\": [\"4\\n7\\n4 2 4 1 4 3 4\\n5\\n2 1 5 4 3\\n1\\n1\\n4\\n1 1 1 3\\n\", \"1\\n9\\n1 2 2 3(...TRUNCATED)
EASY
['greedy', 'binary search', 'sortings', 'implementation']
null
codeforces
['Sorting', 'Implementation', 'Greedy algorithms']
['Sorting', 'Greedy algorithms']
https://codeforces.com/problemset/problem/1335/C
null
2 seconds
2020-04-13
0
256 megabytes
null
taco_train_24502
24,502
[ "Greedy algorithms", "Sorting" ]
Sorting
top_up
End of preview. Expand in Data Studio

TACO-easy-subset

3,200 unique EASY training questions, selected across all eight official TACO skill types.

Source: BAAI/TACO, train split, pinned revision d593ed0a2becbbc952230bb89be09189bf1056dc. This is a dataset subset; no model responses are included.

Selection

  • Keep EASY questions with at least one official skill_types label and nonempty, paired input/output test lists.
  • Draw up to 400 questions per skill without replacement; retain every eligible question when a skill has fewer than 400.
  • Merge overlapping draws by the original source row index.
  • Randomly top up from the four larger skill pools in round-robin order until there are exactly 3,200 distinct questions.
  • Shuffle the final rows. All random operations use Python random.Random(0).
  • Do not filter SPJ problems or use model/reference-solution correctness as a selection criterion.

Original problem text, reference solutions, tests, and metadata are preserved unchanged. Test eligibility checks only the structure of the provided test lists, not their semantic correctness or SPJ compatibility.

Skill coverage

The Assigned rows column partitions the dataset and sums to 3,200. Final label membership counts every official skill label on each selected question; these counts overlap and must not be summed as a dataset size. Initial draws also overlap before deduplication. Small-skill counts refer to questions with usable test lists.

Skill Raw EASY pool Eligible EASY pool Initial draws Assigned rows Final label membership
Amortized analysis 103 103 103 103 103
Bit manipulation 227 222 222 222 222
Complete search 660 651 400 562 651
Data structures 1869 1808 400 1072 1504
Dynamic programming 250 245 245 206 245
Greedy algorithms 852 847 400 589 847
Range queries 37 37 37 27 37
Sorting 640 623 400 419 623

There are 3,504 eligible labeled EASY questions in the source pool. The initial draws yield 1,874 distinct questions; top-up adds 1,326 more. A total of 87 labeled EASY source records lack usable paired test lists and are excluded before sampling.

Fields

All original TACO fields are retained. Added provenance fields:

  • taco_id: stable ID, taco_train_XXXXX, using the original global train row index.
  • taco_source_index: that original index.
  • skill_labels: parsed list of official skill types, convenient for filtering.
  • sampled_skill: skill whose draw first selected this question; each row is assigned exactly once.
  • sampling_stage: initial or top_up.

The original skill_types, tags, solutions, and input_output columns keep their original string serialization. Parse input_output and solutions with json.loads; parse serialized Python-list tags with ast.literal_eval.

Usage

from datasets import load_dataset

train = load_dataset("hi-todayis-jh/TACO-easy-subset", split="train")

This preserves the upstream dataset schema. A training framework still needs its own prompt/reward preprocessing.

Reproducibility

metadata/sampling_manifest.json records the source revision, seed, eligibility rule, every initial/top-up draw, final row order, and Parquet checksum. metadata/source_manifest.json contains original source shard checksums. metadata/selection.csv provides compact per-row provenance.

With the pinned source Parquet files downloaded under SOURCE/ALL/, reproduce into an empty directory:

python scripts/build_subset.py --source-dir SOURCE \
  --source-manifest metadata/source_manifest.json --output-dir REBUILT --seed 0

The builder uses Python 3.10, PyArrow 19.0.1, and no model inference. For attribution and source terms, see the upstream dataset card and TACO paper.

Downloads last month
38

Paper for hi-todayis-jh/TACO-easy-subset