id
stringlengths
7
26
split
stringclasses
1 value
source
stringclasses
2 values
revision
stringclasses
2 values
difficulty
stringclasses
2 values
stratum
stringclasses
4 values
subset
stringclasses
7 values
question
stringlengths
48
5.08k
prompt
stringlengths
304
5.25k
mode
stringclasses
2 values
test
stringlengths
183
6.05k
⌀
signatures
stringlengths
10
81
⌀
seed_ids
stringlengths
4
37
⌀
url
stringlengths
38
49
⌀
inputs
listlengths
5
56
⌀
outputs
listlengths
5
56
⌀
source_test_count
int64
5
610
⌀
screen_passes
int64
0
3
screen_rollouts
int64
3
3
kod:Filter_27911_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Given an array A with n elements, where n is a positive integer and A is non-empty, perform a function to reverse the order of the array such that the last element becomes the first element and vice versa. The function should have a time complexity of O(n) and use only a constant amount of extra space. You are not allo...
Given an array A with n elements, where n is a positive integer and A is non-empty, perform a function to reverse the order of the array such that the last element becomes the first element and vice versa. The function should have a time complexity of O(n) and use only a constant amount of extra space. You are not allo...
pytest
from solution import reverse_array def test_reverse_even_length_array(): assert reverse_array([1, 2, 3, 4]) == [4, 3, 2, 1] def test_reverse_odd_length_array(): assert reverse_array([1, 2, 3]) == [3, 2, 1] def test_reverse_single_element_array(): assert reverse_array([1]) == [1] def test_reverse_empty_a...
def reverse_array(A):
['Qwen2-72B-Instruct_66946']
null
null
null
null
1
3
kod:Filter_20541_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Filter
I have two lists of different lengths that contain dialogue from different characters. I want to create a conversation between two characters, taking one message from the first character, then one from the second character, etc. Here is an example of my lists: List A: ['msg1', 'msg2', 'msg3', 'msg4'] List B: ['respo...
I have two lists of different lengths that contain dialogue from different characters. I want to create a conversation between two characters, taking one message from the first character, then one from the second character, etc. Here is an example of my lists: List A: ['msg1', 'msg2', 'msg3', 'msg4'] List B: ['respo...
pytest
from solution import create_conversation def test_different_lengths_a_longer(): list_a = ['msg1', 'msg2', 'msg3', 'msg4'] list_b = ['response1', 'response2'] expected = ['msg1', 'response1', 'msg2', 'response2', 'msg3', 'response1', 'msg4', 'response2'] assert create_conversation(list_a, list_b) == exp...
def create_conversation(list_a, list_b):
['Llama-3.3-70B-Instruct_51607']
null
null
null
null
0
3
kod:Evol_28_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Evol
You are given a list of integers. The task is to re-arrange the list so that all negative integers appear before all positive integers, while maintaining the relative order of the negative integers and positive integers. The function should not return a new list, but rather modify the original list in-place. For insta...
You are given a list of integers. The task is to re-arrange the list so that all negative integers appear before all positive integers, while maintaining the relative order of the negative integers and positive integers. The function should not return a new list, but rather modify the original list in-place. For insta...
pytest
from solution import rearrange_list def test_rearrange_mixed_list(): nums = [1, -2, 3, -4, 5] rearrange_list(nums) assert nums == [-2, -4, 1, 3, 5] def test_rearrange_mixed_list_with_pos_start(): nums = [-1, 2, -3, 4, -5] rearrange_list(nums) assert nums == [-1, -3, -5, 2, 4] def test_rearran...
def rearrange_list(nums):
[28078]
null
null
null
null
2
3
taco:13983
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
stdio
null
null
null
https://codeforces.com/problemset/problem/60/B
[ "4 10 10\n\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n\n..........\n..........\n..........\n..........\n..........\n...
[ "400", "1", "45", "12\n", "88\n", "3\n", "22\n", "52", "138\n", "1", "5\n", "12\n", "46\n", "3\n", "102\n", "2\n", "10\n", "2\n", "7", "69\n", "22", "40\n", "52\n", "102", "11\n", "2", "64", "13", "52\n", "138\n", "132\n", "2\n" ]
79
0
3
taco:1271
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large). Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu...
A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large). Killjoy's account is already infected and has a rating equal to $x$. Its rating is constant. There are $n$ accounts except hers, nu...
stdio
null
null
null
https://codeforces.com/problemset/problem/1419/C
[ "7\n2 7\n7 1313\n2 14\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n136 121\n2 7\n1313 7\n2 8\n1211 8\n", "1\n2 2\n0 5\n", "1\n4 4\n1 6 6 3\n", "1\n2 1\n-10 13\n", "7\n2 7\n7 1313\n2 8\n8 1211\n2 9\n7 121\n2 121\n121 194\n2 164\n136 121\n2 7\n1313 7\n2 8\n1211 8\n", "1\n3 3\n4 2 3\n", "1\n4 2\n3 1 6 4\n"...
[ "1\n2\n2\n1\n1\n1\n1\n", "2\n", "1\n", "2\n", "1\n1\n2\n1\n2\n1\n1\n", "1\n", "2\n", "2\n", "1\n1\n2\n", "2\n", "1\n1\n2\n1\n2\n1\n1\n", "2\n", "2\n", "2\n", "2\n", "2\n", "1\n", "2\n", "2\n", "2\n", "1\n", "2\n", "1\n", "2\n", "2\n", "2\n", "1\n", "2\n", "2\n...
92
0
3
taco:8501
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Little Petya has recently started attending a programming club. Naturally he is facing the problem of choosing a programming language. After long considerations he realized that Java is the best choice. The main argument in favor of choosing Java was that it has a very large integer data type, called BigInteger. But h...
Little Petya has recently started attending a programming club. Naturally he is facing the problem of choosing a programming language. After long considerations he realized that Java is the best choice. The main argument in favor of choosing Java was that it has a very large integer data type, called BigInteger. But h...
stdio
null
null
null
https://codeforces.com/problemset/problem/66/A
[ "12072227477033521539223864717325060685037419371627121978628725402833000469222026574680655957148434814\n", "6\n", "77837648000267655128696184548375437861\n", "2359707308\n", "2334083498248924849764007740114454487565621932425948046430072197452845278935316358800789014185793377\n", "7060\n", "9223372036854...
[ "BigInteger\n", "byte\n", "BigInteger\n", "long\n", "BigInteger\n", "short\n", "long\n", "BigInteger\n", "BigInteger\n", "BigInteger\n", "BigInteger\n", "BigInteger\n", "short\n", "long\n", "long\n", "BigInteger\n", "long\n", "long\n", "long\n", "BigInteger\n", "BigInteger\n"...
190
1
3
taco:16472
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Ted has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks for the first time. Then every s seconds after it, it barks twice with 1 second interval. Thus it barks at times t, t + s, t + s + 1, t + 2s, t + 2s + 1, etc. [Image] Barney woke up in the morning and wants to eat th...
Ted has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks for the first time. Then every s seconds after it, it barks twice with 1 second interval. Thus it barks at times t, t + s, t + s + 1, t + 2s, t + 2s + 1, etc. [Image] Barney woke up in the morning and wants to eat th...
stdio
null
null
null
https://codeforces.com/problemset/problem/697/A
[ "178769979 103031711 761562532\n", "0 2 1\n", "3 743604 201724\n", "0 2 4\n", "29318 787017 581601530\n", "5 5 13\n", "0 79 4000\n", "50 64536 243790224\n", "0 7 0\n", "54 8901282 197366117\n", "11 2 0\n", "8897216 734348516 783259913\n", "60686899 78474 60704617\n", "456947336 740144 45\n...
[ "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "YES\n", "NO\n", "YES\n", ...
278
1
3
taco:1307
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
atcoder
You have N cards. On the i-th card, an integer A_i is written. For each j = 1, 2, ..., M in this order, you will perform the following operation once: Operation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j. Find the maximum possible sum of the integers written on t...
You have N cards. On the i-th card, an integer A_i is written. For each j = 1, 2, ..., M in this order, you will perform the following operation once: Operation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j. Find the maximum possible sum of the integers written on t...
stdio
null
null
null
https://atcoder.jp/contests/abc127/tasks/abc127_d
[ "11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n", "3 2\n5 1 1\n2 0\n2 0", "10 3\n1 8 2 7 100 4 52 33 13 5\n3 10\n4 30\n1 4", "10 2\n0 8 5 7 100 4 7 33 24 5\n3 10\n4 30\n1 4", "11 1\n-1 1 2 2 1 1 1 0 1 1 1\n3 1000000000\n4 0010101010\n3 1000001001", "3 2\n8 1 1\n0 3\n2 6", "10 1\...
[ "10000000001\n", "7\n", "338\n", "307\n", "3000000010\n", "20\n", "235\n", "7000000007\n", "1000000010\n", "10300043031\n", "333\n", "10000000001", "300\n", "306\n", "14\n", "10300043431\n", "13\n", "16\n", "18\n", "361\n", "367\n", "10300003001\n", "338", "201\n", "3...
108
2
3
taco:728
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus after stops. If $x$ is the number of passengers in a bus just before the current bus stop and $y$ is the number of passengers in the bus just after current bus stop, th...
The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus after stops. If $x$ is the number of passengers in a bus just before the current bus stop and $y$ is the number of passengers in the bus just after current bus stop, th...
stdio
null
null
null
https://codeforces.com/problemset/problem/978/E
[ "102 1\n1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1\n", "2 4\n0 1\n", "8 7\n-5 1 -3 1 -2 9 0 -6\n", "3 0\n-2 -1 0\n", "102 1\n1 1 1 1 1 1 1 0 1 1 1 ...
[ "0\n", "4\n", "0\n", "0\n", "0\n", "3\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "10\n", "0\n", "0\n", "0\n", "13\n", "0\n", "0\n", "1\n", "8\n", "0\n", "6\n", "3\n", "9\n", "0\n", "0\n", "4\n", "999010101\n", "999000101\n", "999000001\n" ]
136
3
3
taco:9578
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If...
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If...
stdio
null
null
null
https://codeforces.com/problemset/problem/96/A
[ "1000010010100000100010000100001000010000000011000010000100001000010000100001000010000100001000010000\n", "1\n", "10000010100000001000110001010100001001001010011\n", "10100101000\n", "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\n", "10010001\n", "...
[ "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "YES\n", "YES\n", "NO\n", "NO\n", "YES\n", "YES\n", "NO\n", "YES\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "YES\n", "NO\n", "...
138
1
3
kod:Filter_6476_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
I am trying to generate a program that chooses the best path between two nodes in a weighted graph. The path with the lowest cost is preferred. The path with the least amount of edges is preferred in case of a tie. Here is the code I have so far: ```python from heapq import heappop, heappush def shortest_path(graph,...
I am trying to generate a program that chooses the best path between two nodes in a weighted graph. The path with the lowest cost is preferred. The path with the least amount of edges is preferred in case of a tie. Here is the code I have so far: ```python from heapq import heappop, heappush def shortest_path(graph,...
pytest
from solution import shortest_path def test_direct_path(): graph = { 'A': {'B': 1}, 'B': {} } assert shortest_path(graph, 'A', 'B') == (['A', 'B'], 1) def test_no_path(): graph = { 'A': {'B': 1}, 'B': {}, 'C': {'D': 1} } assert shortest_path(graph, 'A', ...
def shortest_path(graph, start, end):
['Llama-3.3-70B-Instruct_19005']
null
null
null
null
2
3
taco:13769
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring. You are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Res...
A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring. You are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Res...
stdio
null
null
null
https://codeforces.com/problemset/problem/886/D
[ "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\nn\nc\noszql\npo\no\nmnctposzq\...
[ "eamnctposzqlux\n", "z\n", "azycxd\n", "azb\n", "NO\n", "NO\n", "NO\n", "ijngvul\n", "agbcenmzswtyofdvuihjklpqr\n", "ab\n", "NO\n", "osrpxebqtvylckdzajfmiwnh\n", "NO\n", "y\n", "NO\n", "NO\n", "ba\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "nmolpkqjrishtgufvewd...
127
0
3
taco:3691
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
There are $n$ products in the shop. The price of the $i$-th product is $a_i$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly. In fact, the owner of the shop can change the price of some product $i$ in such a way that the difference between the old price ...
There are $n$ products in the shop. The price of the $i$-th product is $a_i$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly. In fact, the owner of the shop can change the price of some product $i$ in such a way that the difference between the old price ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1183/B
[ "5\n8 19551489\n31131899 17585660 3913937 14521321 9846714 96097161 115568124 35051437\n1 93900441\n15578410\n7 19560555\n124492495 53703939 20259503 99698023 98868060 83313210 5487534\n6 72321938\n59271765 72426489 16625497 51598082 31475864 20946400\n7 44965081\n49955408 62397026 39981552 92586939 6608008 4905754...
[ "-1\n109478851\n-1\n88947435\n-1\n", "7\n", "2\n-1\n3\n5\n", "-1\n", "-1\n71294553\n-1\n88947435\n-1\n", "10\n", "200000001\n", "-1\n87869846\n-1\n88947435\n-1\n", "-1\n71294553\n-1\n88947435\n-1\n", "12\n", "-1\n71294553\n-1\n88947435\n-1\n", "10\n", "200000000\n", "-1\n", "2\n-1\n3\n5\...
100
1
3
taco:23737
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
You got a box with a combination lock. The lock has a display showing n digits. There are two buttons on the box, each button changes digits on the display. You have quickly discovered that the first button adds 1 to all the digits (all digits 9 become digits 0), and the second button shifts all the digits on the displ...
You got a box with a combination lock. The lock has a display showing n digits. There are two buttons on the box, each button changes digits on the display. You have quickly discovered that the first button adds 1 to all the digits (all digits 9 become digits 0), and the second button shifts all the digits on the displ...
stdio
null
null
null
https://codeforces.com/problemset/problem/496/B
[ "200\n79025531557298703099245700860027432585447902553155729870309924570086002743258544790255315572987030992457008600274325854479025531557298703099245700860027432585447902553155729870309924570086002743258544\n", "1\n2\n", "10\n2462472964\n", "5\n40833\n", "100\n27507429205065137288221591899502928816482588529...
[ "00274325854479025531557298703099245700860027432585447902553155729870309924570086002743258544790255315572987030992457008600274325854479025531557298703099245700860027432585447902553155729870309924570086\n", "0", "0240250742", "00175", "0025296467638071109716496318194954026177110480788491817705371477418866028...
120
0
3
kod:Filter_63972_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Can you provide a Python implementation of the bubble sort algorithm?
Can you provide a Python implementation of the bubble sort algorithm? Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standard library. Required callable signatures: def bubble_sort(...
pytest
# File: test_solution.py from solution import bubble_sort def test_bubble_sort_empty(): assert bubble_sort([]) == [] def test_bubble_sort_single_element(): assert bubble_sort([1]) == [1] def test_bubble_sort_already_sorted(): assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5] def test_bubble_sort_r...
def bubble_sort(arr):
['Qwen2.5-Coder-32B-Instruct_129437']
null
null
null
null
3
3
taco:9497
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Tanya is learning how to add numbers, but so far she is not doing it correctly. She is adding two numbers $a$ and $b$ using the following algorithm: If one of the numbers is shorter than the other, Tanya adds leading zeros so that the numbers are the same length. The numbers are processed from right to left (that is,...
Tanya is learning how to add numbers, but so far she is not doing it correctly. She is adding two numbers $a$ and $b$ using the following algorithm: If one of the numbers is shorter than the other, Tanya adds leading zeros so that the numbers are the same length. The numbers are processed from right to left (that is,...
stdio
null
null
null
https://codeforces.com/problemset/problem/1619/C
[ "6\n17236 1106911\n1 5\n108 112\n12345 1023412\n1 11\n1 20\n", "1\n8 13\n", "1\n4 2594\n", "1\n13 716\n", "1\n28 1548\n", "1\n4 948\n", "1\n2 2818\n", "1\n13 3886\n", "1\n4 613\n", "1\n3 333\n", "1\n22 26724\n", "1\n10 988\n", "1\n2 287\n", "1\n35 19714\n", "1\n9 1619\n", "1\n34 1068\n...
[ "3465\n4\n-1\n90007\n10\n-1\n", "5\n", "2590\n", "703\n", "1520\n", "944\n", "2816\n", "3873\n", "69\n", "330\n", "26702\n", "978\n", "285\n", "1949\n", "1610\n", "1034\n", "326\n", "2180\n", "67\n", "-1\n", "155\n", "1715\n", "337\n", "169\n", "2286\n", "1804\n", ...
206
0
3
taco:803
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given three strings $a$, $b$ and $c$ of the same length $n$. The strings consist of lowercase English letters only. The $i$-th letter of $a$ is $a_i$, the $i$-th letter of $b$ is $b_i$, the $i$-th letter of $c$ is $c_i$. For every $i$ ($1 \leq i \leq n$) you must swap (i.e. exchange) $c_i$ with either $a_i$ or...
You are given three strings $a$, $b$ and $c$ of the same length $n$. The strings consist of lowercase English letters only. The $i$-th letter of $a$ is $a_i$, the $i$-th letter of $b$ is $b_i$, the $i$-th letter of $c$ is $c_i$. For every $i$ ($1 \leq i \leq n$) you must swap (i.e. exchange) $c_i$ with either $a_i$ or...
stdio
null
null
null
https://codeforces.com/problemset/problem/1301/A
[ "4\naa`\nbbb\nbcc\nabc\nbca\ncca\naabb\nbcaa\nbaba\niim\nmii\niim\n", "1\nab\nab\nbb\n", "4\naa`\nbbb\nbcc\ncba\nbca\ncca\nbbaa\nbcaa\nbaba\niim\nmii\nijm\n", "1\nba\nbb\nbe\n", "4\na`a\ncac\ncac\ncba\ndaa\ncab\nbaab\nadab\nbbaa\nhim\nhim\njmi\n", "1\nba\nca\nda\n", "1\nca\ndb\nbe\n", "4\naa`\nbbc\nca...
[ "NO\nNO\nYES\nYES\n", "NO\n", "NO\nYES\nNO\nNO\n", "NO\n", "YES\nNO\nNO\nNO\n", "NO\n", "NO\n", "NO\nYES\nNO\nNO\n", "YES\nNO\nNO\nNO\n", "NO\n", "YES\nNO\nNO\nNO\n", "YES\nNO\nNO\nNO\n", "NO\n", "YES\nNO\nNO\nNO\n", "NO\n", "NO\nYES\nYES\nNO\n", "NO\n", "YES\nNO\nNO\nNO\n", "NO\...
96
2
3
taco:19611
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
atcoder
We have N bricks arranged in a row from left to right. The i-th brick from the left (1 \leq i \leq N) has an integer a_i written on it. Among them, you can break at most N-1 bricks of your choice. Let us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \leq i \leq K), the i-th of thos...
We have N bricks arranged in a row from left to right. The i-th brick from the left (1 \leq i \leq N) has an integer a_i written on it. Among them, you can break at most N-1 bricks of your choice. Let us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \leq i \leq K), the i-th of thos...
stdio
null
null
null
https://atcoder.jp/contests/abc148/tasks/abc148_d
[ "10\n3 1 10 1 20 2 2 3 -1 6", "1\n1", "3\n0 4 -7", "3\n1 1 3", "10\n3 1 9 1 20 0 2 1 -1 6", "1\n-5", "3\n0 1 -1", "3\n2 -1 -2", "10\n3 1 4 1 5 17 2 6 4 3", "3\n4 0 3", "3\n4 -1 0", "10\n3 1 10 1 20 2 2 3 0 3", "3\n4 0 0", "10\n4 1 4 1 10 31 1 11 0 3", "1\n10", "3\n2 2 2", "1\n2", "...
[ "7\n", "0", "-1\n", "2\n", "8\n", "-1\n", "2\n", "-1\n", "7\n", "-1\n", "-1\n", "7\n", "-1\n", "9\n", "-1\n", "-1", "-1\n", "-1\n", "7\n", "7\n", "7", "7\n", "-1\n", "-1\n", "9\n", "2\n", "-1\n", "-1\n", "-1\n", "9\n", "-1\n", "-1\n" ]
108
1
3
taco:5042
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given an array $a_1, a_2, \dots, a_n$ consisting of $n$ distinct integers. Count the number of pairs of indices $(i, j)$ such that $i < j$ and $a_i \cdot a_j = i + j$. -----Input----- The first line contains one integer $t$ ($1 \leq t \leq 10^4$) — the number of test cases. Then $t$ cases follow. The first ...
You are given an array $a_1, a_2, \dots, a_n$ consisting of $n$ distinct integers. Count the number of pairs of indices $(i, j)$ such that $i < j$ and $a_i \cdot a_j = i + j$. -----Input----- The first line contains one integer $t$ ($1 \leq t \leq 10^4$) — the number of test cases. Then $t$ cases follow. The first ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1541/B
[ "3\n2\n2 1\n3\n3 1 5\n5\n3 1 4 10 2\n", "3\n2\n3 1\n3\n6 1 5\n5\n3 1 5 9 2\n", "3\n2\n3 1\n3\n6 2 5\n5\n3 1 4 7 2\n", "3\n2\n3 1\n3\n4 2 5\n5\n3 1 4 7 2\n", "3\n2\n3 2\n3\n2 1 5\n5\n3 1 8 5 2\n", "3\n2\n3 2\n3\n3 1 5\n5\n3 2 7 9 6\n", "3\n2\n3 1\n3\n6 1 5\n5\n3 1 5 8 2\n", "3\n2\n3 1\n3\n3 2 5\n5\n6 1...
[ "0\n2\n3\n", "1\n1\n3\n", "1\n0\n3\n", "1\n0\n3\n", "0\n1\n2\n", "0\n2\n0\n", "1\n1\n3\n", "1\n0\n1\n", "1\n1\n1\n", "0\n1\n2\n", "1\n1\n2\n", "0\n1\n1\n", "1\n1\n3\n", "0\n1\n1\n", "0\n1\n1\n", "1\n1\n3\n", "1\n2\n3\n", "0\n0\n2\n", "0\n1\n1\n", "0\n0\n3\n", "1\n1\n2\n", "...
102
2
3
taco:6556
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given a board of size $n \times n$, where $n$ is odd (not divisible by $2$). Initially, each cell of the board contains one figure. In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing a side or a corner with the current cell, i.e. from the cell $(i, j)$...
You are given a board of size $n \times n$, where $n$ is odd (not divisible by $2$). Initially, each cell of the board contains one figure. In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing a side or a corner with the current cell, i.e. from the cell $(i, j)$...
stdio
null
null
null
https://codeforces.com/problemset/problem/1353/C
[ "3\n11\n7017\n9273\n", "1\n2119\n", "3\n5\n1563\n5103\n", "1\n145901\n", "3\n7\n4885\n9509\n", "1\n104401\n", "3\n3\n131\n9783\n", "3\n11\n2869\n5405\n", "1\n124495\n", "3\n7\n3005\n3005\n", "3\n3\n5907\n3005\n", "3\n3\n3005\n3005\n", "1\n22411\n", "3\n1\n5\n499993\n", "3\n11\n7511\n2775...
[ "440\n115168355632\n265790540048\n", "3171549680\n", "40\n1272786328\n44295074208\n", "1035269813240600\n", "112\n38857283080\n286604683240\n", "379308627429600\n", "8\n749320\n312100813968\n", "440\n7871732680\n52633933240\n", "643182876820960\n", "112\n9045074040\n9045074040\n", "8\n6870362391...
109
0
3
kod:Filter_7675_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
I'm looking for a simple implementation of a binary search algorithm in Python. Do you have one you can share?
I'm looking for a simple implementation of a binary search algorithm in Python. Do you have one you can share? Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standard library. Requi...
pytest
from solution import binary_search def test_target_found(): assert binary_search([1, 2, 3, 4, 5], 3) == 2 def test_target_not_found(): assert binary_search([1, 2, 3, 4, 5], 6) == -1 def test_empty_array(): assert binary_search([], 3) == -1 def test_single_element_array_found(): assert binary_search(...
def binary_search(arr, target):
['Llama-3.3-70B-Instruct_21700']
null
null
null
null
3
3
taco:13954
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given a string $s$ consisting only of characters + and -. You perform some process with this string. This process can be described by the following pseudocode: res = 0 for init = 0 to inf cur = init ok = true for i = 1 to |s| res = res + 1 if s[i] == '+' cur = cur ...
You are given a string $s$ consisting only of characters + and -. You perform some process with this string. This process can be described by the following pseudocode: res = 0 for init = 0 to inf cur = init ok = true for i = 1 to |s| res = res + 1 if s[i] == '+' cur = cur ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1373/C
[ "15\n-\n--\n+\n-+\n-\n+\n-\n+\n-\n-+\n+-\n-+\n-+\n+-\n+-\n", "3\n--+-\n---\n++--+-\n", "15\n-\n--\n+\n+-\n-\n+\n-\n+\n-\n+-\n-+\n-+\n-+\n+-\n+-\n", "3\n+---\n---\n--+++-\n", "15\n-\n--\n+\n+-\n-\n+\n-\n+\n-\n-+\n-+\n+-\n+-\n-+\n-+\n", "3\n--+-\n---\n-+-+-+\n", "15\n-\n--\n+\n-+\n-\n+\n-\n+\n-\n+-\n-+\n+...
[ "2\n5\n1\n3\n2\n1\n2\n1\n2\n3\n2\n3\n3\n2\n2\n", "7\n9\n6\n", "2\n5\n1\n2\n2\n1\n2\n1\n2\n2\n3\n3\n3\n2\n2\n", "11\n9\n9\n", "2\n5\n1\n2\n2\n1\n2\n1\n2\n3\n3\n2\n2\n3\n3\n", "7\n9\n7\n", "2\n5\n1\n3\n2\n1\n2\n1\n2\n2\n3\n2\n3\n3\n3\n", "2\n5\n1\n3\n2\n1\n2\n1\n2\n2\n3\n2\n3\n2\n3\n", "2\n5\n1\n2\n2\...
75
0
3
kod:Filter_78504_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a Python function that takes a list of integers and returns a new list containing only the very first even number from the original list. If there are no even numbers, the function should return an empty list.
Write a Python function that takes a list of integers and returns a new list containing only the very first even number from the original list. If there are no even numbers, the function should return an empty list. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide th...
pytest
from solution import first_even_number def test_single_even_number(): assert first_even_number([1, 3, 5, 2]) == [2] def test_multiple_even_numbers(): assert first_even_number([2, 4, 6, 8]) == [2] def test_no_even_numbers(): assert first_even_number([1, 3, 5, 7]) == [] def test_empty_list(): assert f...
def first_even_number(lst):
['Qwen2.5-Coder-32B-Instruct_159457']
null
null
null
null
3
3
taco:2325
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Carl is a beginner magician. He has a blue, b violet and c orange magic spheres. In one move he can transform two spheres of the same color into one sphere of any other color. To make a spell that has never been seen before, he needs at least x blue, y violet and z orange spheres. Can he get them (possible, in multiple...
Carl is a beginner magician. He has a blue, b violet and c orange magic spheres. In one move he can transform two spheres of the same color into one sphere of any other color. To make a spell that has never been seen before, he needs at least x blue, y violet and z orange spheres. Can he get them (possible, in multiple...
stdio
null
null
null
https://codeforces.com/problemset/problem/606/A
[ "1000100 1000000 1000000\n1000000 1000000 1000000\n", "5 6 1\n2 7 2\n", "48 17 34\n0 19 24\n", "0 1 3\n1 0 1\n", "134389 303568 749016\n238307 493997 190377\n", "1 0 0\n1 0 0\n", "9 10 0\n0 0 9\n", "500000 1294152 500000\n1000000 0 500000\n", "4 0 4\n1 2 3\n", "10 10 -1\n0 0 11\n", "4 0 3\n2 2 0...
[ "Yes\n", "No\n", "Yes\n", "Yes\n", "No\n", "Yes\n", "Yes\n", "Yes\n", "No\n", "No\n", "Yes\n", "No\n", "Yes\n", "Yes\n", "No\n", "No\n", "Yes\n", "No\n", "Yes\n", "Yes\n", "Yes\n", "No\n", "No\n", "Yes\n", "No\n", "No\n", "No\n", "Yes\n", "No\n", "Yes\n", ...
256
0
3
kod:Filter_80018_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a Python program to check if a given number is a palindrome or not. A palindrome is a number that reads the same backward as forward, e.g., 12321 is a palindrome, but 12345 is not. The program should take an integer as input and return True if it is a palindrome, and False otherwise. Use a stack to implement the ...
Write a Python program to check if a given number is a palindrome or not. A palindrome is a number that reads the same backward as forward, e.g., 12321 is a palindrome, but 12345 is not. The program should take an integer as input and return True if it is a palindrome, and False otherwise. Use a stack to implement the ...
pytest
from solution import is_palindrome def test_palindrome_positive_case(): assert is_palindrome(12321) == True def test_palindrome_negative_case(): assert is_palindrome(12345) == False def test_single_digit_number(): assert is_palindrome(7) == True def test_even_length_palindrome(): assert is_palindrom...
def is_palindrome(number):
['Qwen2.5-Math-72B-Instruct_162626']
null
null
null
null
3
3
kod:Filter_45737_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Given the following array, write a Python code snippet to remove all duplicates while preserving the order of the first occurrence of each element.
Given the following array, write a Python code snippet to remove all duplicates while preserving the order of the first occurrence of each element. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. ...
pytest
from solution import remove_duplicates def test_remove_duplicates_mixed(): assert remove_duplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5] def test_remove_duplicates_all_unique(): assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5] def test_remove_duplicates_all_same(): assert remove_duplicat...
def remove_duplicates(arr):
['Qwen2.5-72B-Instruct_97493']
null
null
null
null
3
3
kod:Data_Structure_22834_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Data_Structure
### Cycle Sort Implementation and Application #### Objective: Write a function `cycle_sort(arr)` that implements the Cycle Sort algorithm. Your function should sort the array in ascending order with minimal number of writes. #### Input: * An unsorted list `arr` of integers. * Length of the array can vary from 0 to ...
### Cycle Sort Implementation and Application #### Objective: Write a function `cycle_sort(arr)` that implements the Cycle Sort algorithm. Your function should sort the array in ascending order with minimal number of writes. #### Input: * An unsorted list `arr` of integers. * Length of the array can vary from 0 to ...
pytest
from solution import cycle_sort def test_empty_list(): assert cycle_sort([]) == [] def test_single_element_list(): assert cycle_sort([5]) == [5] def test_sorted_list(): assert cycle_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5] def test_unsorted_list(): assert cycle_sort([5, 3, 1, 4, 2]) == [1, 2, 3, 4, ...
def cycle_sort(arr):
[29]
null
null
null
null
0
3
taco:11148
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
The game of Berland poker is played with a deck of $n$ cards, $m$ of which are jokers. $k$ players play this game ($n$ is divisible by $k$). At the beginning of the game, each player takes $\frac{n}{k}$ cards from the deck (so each card is taken by exactly one player). The player who has the maximum number of jokers i...
The game of Berland poker is played with a deck of $n$ cards, $m$ of which are jokers. $k$ players play this game ($n$ is divisible by $k$). At the beginning of the game, each player takes $\frac{n}{k}$ cards from the deck (so each card is taken by exactly one player). The player who has the maximum number of jokers i...
stdio
null
null
null
https://codeforces.com/problemset/problem/1359/A
[ "4\n8 0 2\n4 0 4\n35 1 5\n14 0 9\n", "1\n49 7 7\n", "1\n68 11 3\n", "1\n90 3 6\n", "4\n8 4 2\n4 2 4\n12 3 3\n7 0 7\n", "1\n90 7 7\n", "1\n113 3 5\n", "4\n8 0 2\n4 0 4\n35 1 5\n7 0 9\n", "1\n48 3 6\n", "4\n8 0 2\n3 0 4\n35 6 3\n7 0 9\n", "1\n48 10 4\n", "4\n8 0 2\n4 0 3\n21 6 3\n7 0 9\n", "1\...
[ "0\n0\n1\n0\n", "7\n", "11\n", "3\n", "4\n0\n3\n0\n", "7\n", "3\n", "0\n0\n1\n0\n", "3\n", "0\n0\n6\n0\n", "10\n", "0\n0\n6\n0\n", "4\n", "0\n", "15\n", "9\n", "1\n", "9\n", "7\n", "0\n", "3\n0\n4\n0\n", "3\n0\n4\n0\n", "3\n0\n0\n0\n", "6\n", "3\n0\n3\n0\n", "7\n", ...
108
2
3
kod:Filter_74506_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Filter
Can you provide a Python implementation of Floyd-Warshall's algorithm for finding the shortest path between all pairs of nodes in a weighted graph?
Can you provide a Python implementation of Floyd-Warshall's algorithm for finding the shortest path between all pairs of nodes in a weighted graph? Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. ...
pytest
from solution import floyd_warshall def test_floyd_warshall_basic(): graph = [ [0, 3, float('inf'), 5], [2, 0, float('inf'), 4], [float('inf'), 1, 0, float('inf')], [float('inf'), float('inf'), 2, 0] ] expected = [ [0, 3, 7, 5], [2, 0, 6, 4], [3,...
def floyd_warshall(graph):
['Qwen2.5-Coder-32B-Instruct_151141']
null
null
null
null
1
3
kod:Evol_2729_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Evol
Create a function in Python that takes a list of integers and returns a new list containing only the elements that are unique in the original list (appear exactly once). Additionally, the function should maintain the original order of the elements from the input list. Write test cases to validate your implementation, e...
Create a function in Python that takes a list of integers and returns a new list containing only the elements that are unique in the original list (appear exactly once). Additionally, the function should maintain the original order of the elements from the input list. Write test cases to validate your implementation, e...
pytest
from solution import unique_elements def test_empty_list(): assert unique_elements([]) == [] def test_all_identical_elements(): assert unique_elements([1, 1, 1, 1]) == [] def test_no_unique_elements(): assert unique_elements([1, 2, 2, 1, 3, 3]) == [] def test_all_unique_elements(): assert unique_ele...
def unique_elements(lst):
[29147]
null
null
null
null
1
3
taco:15154
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
Everyone loves a freebie. Especially students. It is well-known that if in the night before exam a student opens window, opens the student's record-book and shouts loudly three times "Fly, freebie, fly!" — then flown freebie helps him to pass the upcoming exam. In the night before the exam on mathematical analysis n ...
Everyone loves a freebie. Especially students. It is well-known that if in the night before exam a student opens window, opens the student's record-book and shouts loudly three times "Fly, freebie, fly!" — then flown freebie helps him to pass the upcoming exam. In the night before the exam on mathematical analysis n ...
stdio
null
null
null
https://codeforces.com/problemset/problem/386/B
[ "100\n98 63 672 100 254 218 623 415 426 986 920 915 736 795 407 541 382 213 935 743 961 59 660 512 192 935 248 378 739 356 543 714 28 667 602 596 759 791 103 564 225 520 166 542 966 332 983 655 517 273 95 242 593 940 286 236 41 318 941 727 384 225 319 627 982 359 232 769 854 172 643 598 215 231 305 30 347 469 929 9...
[ "100\n", "1\n", "100\n", "3\n", "61\n", "1\n", "6\n", "6\n", "55\n", "3\n", "71\n", "3\n", "6\n", "1\n", "6\n", "25\n", "2\n", "3\n", "2\n", "62\n", "3\n", "6\n", "2\n", "3\n", "41\n", "2\n", "1\n", "2\n", "100\n", "3\n", "6\n", "94\n" ]
136
2
3
taco:13991
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given a multiset $S$ initially consisting of $n$ distinct non-negative integers. A multiset is a set, that can contain some elements multiple times. You will perform the following operation $k$ times: Add the element $\lceil\frac{a+b}{2}\rceil$ (rounded up) into $S$, where $a = \operatorname{mex}(S)$ and $b =...
You are given a multiset $S$ initially consisting of $n$ distinct non-negative integers. A multiset is a set, that can contain some elements multiple times. You will perform the following operation $k$ times: Add the element $\lceil\frac{a+b}{2}\rceil$ (rounded up) into $S$, where $a = \operatorname{mex}(S)$ and $b =...
stdio
null
null
null
https://codeforces.com/problemset/problem/1496/B
[ "7\n5 1000000000\n4 2 3 0 1\n4 0\n5 3 0 1\n3 0\n100 0 1\n6 1234567\n1 2 3 4 5 0\n3 114514\n8 0 4\n1 1000100\n0\n1 10000000\n1\n", "1\n1 0\n0\n", "1\n5 3\n0 1 7 29 5\n", "1\n5 3\n0 1 3 24 6\n", "5\n4 0\n0 2 3 4\n3 1\n0 1 4\n3 0\n0 1 4\n3 2\n0 1 2\n3 2\n1 2 3\n", "1\n5 3\n0 1 2 5 4\n", "1\n5 6\n0 1 6 11 5...
[ "1000000005\n4\n3\n1234573\n4\n1000101\n1\n", "1\n", "6\n", "6\n", "4\n4\n3\n5\n3\n", "5\n", "6\n", "5\n", "1\n", "6\n", "6\n", "6\n", "6\n", "4\n3\n4\n5\n3\n", "6\n", "6\n", "6\n", "3\n", "6\n", "4\n4\n3\n4\n3\n", "3\n", "6\n", "6\n", "5\n", "4\n4\n3\n5\n3\n", "6\n...
212
0
3
kod:Filter_21285_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Here is a problem I need help with. Given a string, check if it contains at least one vowel and at least one digit. */ Example: Input: "a1b2c3" Output: "True" Input: "test123" Output: "True" Input: "alles" Output: "False" Input: "1234" Output: "False" And here is the c...
Here is a problem I need help with. Given a string, check if it contains at least one vowel and at least one digit. */ Example: Input: "a1b2c3" Output: "True" Input: "test123" Output: "True" Input: "alles" Output: "False" Input: "1234" Output: "False" And here is the c...
pytest
from solution import check_string def test_check_string_with_vowels_and_digits(): assert check_string("a1b2c3") == True assert check_string("test123") == True def test_check_string_with_only_vowels(): assert check_string("alles") == False def test_check_string_with_only_digits(): assert check_string(...
def check_string(s):
['Llama-3.3-70B-Instruct_53291']
null
null
null
null
0
3
taco:1470
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not. One day Johnny got bracket sequence. He decided to remove some...
A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not. One day Johnny got bracket sequence. He decided to remove some...
stdio
null
null
null
https://codeforces.com/problemset/problem/26/B
[ "))())))))))())))))()()))()())))))))))))()))))))))))))(()))())(()))))(()))))())))((((()()))))()))()))\n", "(\n", "())))))()())())))))())\n", ")())))(\n", "))()()((()()))())()(()(()((()()((((((())()((((())(\n", "()))((\n", "()(((()(()\n", "())((()()())((((((((())(((((((()())()))()((()()())\n", "()()(...
[ "46\n", "0\n", "10\n", "2\n", "34\n", "2\n", "6\n", "36\n", "6\n", "2\n", "2\n", "8\n", "4\n", "10\n", "38\n", "34\n", "38\n", "6\n", "10\n", "6\n", "4\n", "12\n", "6\n", "2\n", "2\n", "2\n", "0\n", "10\n", "2\n", "2\n", "38\n", "28\n" ]
104
3
3
kod:Evol_5690_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Evol
Create a function in Python that takes a list of integers and an integer value k, and returns the k most frequent elements in the list. If there is a tie for the k-th place in terms of frequency, return the smallest elements first. Implement your solution with a time complexity better than O(n^2). The function should b...
Create a function in Python that takes a list of integers and an integer value k, and returns the k most frequent elements in the list. If there is a tie for the k-th place in terms of frequency, return the smallest elements first. Implement your solution with a time complexity better than O(n^2). The function should b...
pytest
from solution import most_frequent_elements def test_most_frequent_elements_basic(): assert most_frequent_elements([4, 1, -1, 2, -1, 2, 3], 2) == [-1, 2] def test_most_frequent_elements_tie(): assert most_frequent_elements([1, 2, 3, 1, 2, 3, 1, 2, 3], 2) == [1, 2] def test_most_frequent_elements_all_equa...
def most_frequent_elements(numbers, k):
[41600]
null
null
null
null
2
3
kod:Filter_53830_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a python function to determine if a given integer is a palindrome. The function should return `True` if the integer is a palindrome, `False` otherwise.
Write a python function to determine if a given integer is a palindrome. The function should return `True` if the integer is a palindrome, `False` otherwise. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python co...
pytest
from solution import is_palindrome def test_positive_palindrome(): assert is_palindrome(121) == True def test_negative_palindrome(): assert is_palindrome(-121) == False # negative numbers cannot be palindrome def test_single_digit(): assert is_palindrome(5) == True def test_non_palindrome(): assert...
def is_palindrome(num):
['Qwen2.5-72B-Instruct_110481']
null
null
null
null
3
3
taco:21942
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codechef
Read problems statements in Mandarin Chinese and Russian. A new school in Byteland is now in the process of renewing some classrooms with new, stronger and better chairs, so that the students can stay still and pay attention to class :) However, due to budget and logistic reasons, it's only possible to carry a cha...
Read problems statements in Mandarin Chinese and Russian. A new school in Byteland is now in the process of renewing some classrooms with new, stronger and better chairs, so that the students can stay still and pay attention to class :) However, due to budget and logistic reasons, it's only possible to carry a cha...
stdio
null
null
null
https://www.codechef.com/problems/MCHAIRS
[ "2\n8\n49", "2\n1\n2", "2\n8\n4", "2\n3\n4", "2\n14\n2", "2\n3\n2", "2\n0\n9", "2\n2\n10", "2\n16\n9", "2\n6\n8", "2\n0\n11", "2\n14\n1", "2\n0\n17", "2\n10\n0", "2\n0\n5", "2\n8\n5", "2\n6\n5", "2\n10\n4", "2\n1\n5", "2\n3\n0", "2\n1\n3", "2\n2\n8", "2\n1\n1", "2\n8\n1...
[ "255\n949480668\n", "1\n3", "255\n15\n", "7\n15\n", "16383\n3\n", "7\n3\n", "0\n511\n", "3\n1023\n", "65535\n511\n", "63\n255\n", "0\n2047\n", "16383\n1\n", "0\n131071\n", "1023\n0\n", "0\n31\n", "255\n31\n", "63\n31\n", "1023\n15\n", "1\n31\n", "7\n0\n", "1\n7\n", "3\n255\...
102
3
3
taco:10821
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
There are n problems prepared for the next Codeforces round. They are arranged in ascending order by their difficulty, and no two problems have the same difficulty. Moreover, there are m pairs of similar problems. Authors want to split problems between two division according to the following rules: Problemset of each...
There are n problems prepared for the next Codeforces round. They are arranged in ascending order by their difficulty, and no two problems have the same difficulty. Moreover, there are m pairs of similar problems. Authors want to split problems between two division according to the following rules: Problemset of each...
stdio
null
null
null
https://codeforces.com/problemset/problem/673/B
[ "100000 10\n99562 484\n1099 99684\n593 99867\n99529 175\n99738 616\n92547 766\n42925 121\n99784 301\n199 87398\n12 99849\n", "2 0\n", "100001 1\n100000 1\n", "55 1\n34 1\n", "100000 10\n99562 479\n643 49292\n593 99867\n99529 175\n99738 616\n99523 766\n99503 121\n51284 158\n199 99199\n15 58732\n", "4 1\n2 ...
[ "41826\n", "1\n", "99999\n", "33\n", "48526\n", "1\n", "3\n", "0\n", "36007\n", "1\n", "28\n", "0\n", "1\n", "98433\n", "1\n", "2\n", "0\n", "54\n", "98433\n", "0\n", "99999\n", "15\n", "1\n", "1\n", "3\n", "57966\n", "0\n", "50518\n", "42084\n", "2\n", "5...
158
0
3
kod:Algorithm_27462_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Algorithm
### Question: Develop a Simple Text Analysis Tool #### Context Text analysis is an essential aspect of natural language processing, where words and their frequencies in a document are often analyzed to understand better the document's content. This task requires implementing a basic text analysis tool that processes a...
### Question: Develop a Simple Text Analysis Tool #### Context Text analysis is an essential aspect of natural language processing, where words and their frequencies in a document are often analyzed to understand better the document's content. This task requires implementing a basic text analysis tool that processes a...
pytest
from solution import word_frequency def test_empty_string(): assert word_frequency("") == {} def test_single_word(): assert word_frequency("hello") == {"hello": 1} def test_multiple_words(): text = "Hello, world! Hello, Programming." assert word_frequency(text) == {'hello': 2, 'world': 1, 'programmin...
def word_frequency(text):
[475]
null
null
null
null
2
3
taco:5546
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
A permutation is a sequence of integers from $1$ to $n$ of length $n$ containing each number exactly once. For example, $[1]$, $[4, 3, 5, 1, 2]$, $[3, 2, 1]$ — are permutations, and $[1, 1]$, $[4, 3, 1]$, $[2, 3, 4]$ — no. Permutation $a$ is lexicographically smaller than permutation $b$ (they have the same length $n$...
A permutation is a sequence of integers from $1$ to $n$ of length $n$ containing each number exactly once. For example, $[1]$, $[4, 3, 5, 1, 2]$, $[3, 2, 1]$ — are permutations, and $[1, 1]$, $[4, 3, 1]$, $[2, 3, 4]$ — no. Permutation $a$ is lexicographically smaller than permutation $b$ (they have the same length $n$...
stdio
null
null
null
https://codeforces.com/problemset/problem/1443/E
[ "10 4\n1 2 4\n2 1\n1 1 2\n1 3 4\n", "4 2\n1 2 1\n2 2\n1 2 2\n", "4 3\n1 1 3\n2 2\n1 2 2\n", "4 2\n1 3 2\n2 1\n2 2 2\n", "4 4\n1 2 4\n2 3\n1 1 3\n1 3 4\n", "4 2\n1 2 2\n2 1\n2 2 0\n", "2 3\n1 2 2\n2 1\n1 2 1\n", "4 3\n1 1 4\n2 1\n1 2 2\n", "4 2\n1 2 1\n2 2\n1 0 2\n", "4 2\n1 2 1\n2 2\n0 3 4\n", "...
[ "9\n3\n7\n", "0\n", "6\n3\n", "0\n", "9\n8\n6\n", "2\n", "2\n0\n", "10\n2\n", "0\n", "0\n", "2\n", "9\n4\n10\n", "3\n0\n", "1\n0\n", "2\n", "2\n", "2\n3\n", "6\n0\n", "3\n1\n", "10\n3\n7\n", "7\n7\n9\n", "2\n", "1\n", "0\n", "10\n1\n9\n", "2\n", "9\n3\n9\n", "3\...
62
2
3
kod:Algorithm_30835_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Algorithm
### Coding Assessment Question #### Context You are tasked to write a function that counts the number of unique elements in a given list while ignoring the case for string elements. The function should handle and preserve input types robustly, ensuring only valid inputs are processed. #### Task Write a Python functio...
### Coding Assessment Question #### Context You are tasked to write a function that counts the number of unique elements in a given list while ignoring the case for string elements. The function should handle and preserve input types robustly, ensuring only valid inputs are processed. #### Task Write a Python functio...
pytest
import pytest from solution import count_unique_elements def test_unique_strings_case_insensitive(): assert count_unique_elements(["Hello", "world", "hello", "WORLD"]) == 2 def test_unique_numbers(): assert count_unique_elements([1, 2, 3, 2, 1, 4]) == 4 def test_all_case_variations_of_a_string(): assert ...
def count_unique_elements(elements):
[1187]
null
null
null
null
1
3
kod:Filter_36400_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a Python code snippet to get the length of a string, but without using the built-in function `len()`, and without using any loops or recursion. You can only use slicing, and you cannot use any external libraries or modules.
Write a Python code snippet to get the length of a string, but without using the built-in function `len()`, and without using any loops or recursion. You can only use slicing, and you cannot use any external libraries or modules. Implement the required callable(s) in Python 3. Preserve the requested names and signatur...
pytest
from solution import string_length def test_empty_string(): assert string_length('') == 0 def test_single_character(): assert string_length('a') == 1 assert string_length(' ') == 1 def test_multiple_characters(): assert string_length('hello') == 5 assert string_length('test string') == 11 def te...
def string_length(s):
['Qwen2-72B-Instruct_81319']
null
null
null
null
0
3
taco:12978
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
One day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written. As mom wasn't home, Vasya decided to play with names: he chose three integers i, j, k (1 ≤ i < j ≤ n, ...
One day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written. As mom wasn't home, Vasya decided to play with names: he chose three integers i, j, k (1 ≤ i < j ≤ n, ...
stdio
null
null
null
https://codeforces.com/problemset/problem/152/C
[ "30 10\nUTNTGOKZYJ\nQHOUHNYZVW\nLTVGHJRZVW\nMZHYHOLZYJ\nERYEUEPZYE\nUZDUFTBRYJ\nRVSMQTIZGW\nWDJQHMIRYY\nKCORHQPZYE\nRRPLFOZZVY\nJTXMFNNNYJ\nMVTGGOZZVV\nEHAFFNUZVF\nLBRNWJZNYE\nJVMOHTPZYJ\nWTARFJLZVV\nLVJCWOURVW\nLCLQFJYRVV\nQVBVGNJRYF\nNTZGHOLRYE\nMGQKHOUPYJ\nRRSSBXPZYJ\nRYCRGTLZYJ\nJRDEGNKRVW\nRZKFGHYRVG\nMDJBFNIZ...
[ "211905291\n", "1\n", "14\n", "7280\n", "167919491\n", "162\n", "14\n", "14\n", "503896683\n", "15\n", "15\n", "206575993\n", "15\n", "1\n", "15\n", "15\n", "909435568\n", "26\n", "10000\n", "14\n", "485444184\n", "10000\n", "2\n", "6174\n", "1\n", "15\n", "247147...
123
3
3
taco:11712
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
stdio
null
null
null
https://codeforces.com/problemset/problem/63/A
[ "36\nKqxmtwmsf child\nIze woman\nDlpr child\nK woman\nF captain\nabhuefwjR rat\nBbu rat\nS rat\nMnmg woman\nxzzmS woman\nSr man\nQmhroracn rat\nSoqpuqock rat\nPibdq man\nIlrkrptx rat\nZaecfyqka man\nMmersfs child\nVvvocqi man\nHjeqxvq rat\nMpmb woman\nWmgu woman\nCerflmhoxi child\nA man\nDylv man\nXrdgmmtcpq woman\...
[ "abhuefwjR\nBbu\nS\nQmhroracn\nSoqpuqock\nIlrkrptx\nHjeqxvq\nKqxmtwmsf\nIze\nDlpr\nK\nMnmg\nxzzmS\nMmersfs\nMpmb\nWmgu\nCerflmhoxi\nXrdgmmtcpq\nXj\nCeh\nAknkwdkq\nLqo\nVej\nT\nNsdtpdg\nSr\nPibdq\nZaecfyqka\nVvvocqi\nA\nDylv\nOfccguo\nNevr\nBmo\nRlijc\nF\n", "A\n", "Teddy\nAlice\nBob\nJulia\neilrahC\nAbdelrhman\...
101
0
3
kod:Filter_19388_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Here is a recursive function in Python to find the value of a number in a sorted array using binary search: ```python def binary_search(arr, x): if not arr: return -1 mid = len(arr) // 2 if arr[mid] == x: return mid elif arr[mid] < x: return binary_search(arr[mid + 1:], x) ...
Here is a recursive function in Python to find the value of a number in a sorted array using binary search: ```python def binary_search(arr, x): if not arr: return -1 mid = len(arr) // 2 if arr[mid] == x: return mid elif arr[mid] < x: return binary_search(arr[mid + 1:], x) ...
pytest
from solution import binary_search def test_binary_search_found_beginning(): assert binary_search([1, 2, 3, 4, 5], 1) == 0 def test_binary_search_found_middle(): assert binary_search([1, 2, 3, 4, 5], 3) == 2 def test_binary_search_found_end(): assert binary_search([1, 2, 3, 4, 5], 5) == 4 def test_binar...
def binary_search(arr, x, left=0):
['Llama-3.3-70B-Instruct_48993']
null
null
null
null
2
3
kod:Algorithm_29424_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Algorithm
### Problem Statement You are working on a system that needs to analyze text sequences and perform various operations based on specific requirements. One critical feature is to check whether a given string contains all the letters of the alphabet at least once, making it a "pangram". ### Task Implement a function `is_...
### Problem Statement You are working on a system that needs to analyze text sequences and perform various operations based on specific requirements. One critical feature is to check whether a given string contains all the letters of the alphabet at least once, making it a "pangram". ### Task Implement a function `is_...
pytest
from solution import is_pangram def test_is_pangram_valid_pangram(): assert is_pangram("The quick brown fox jumps over the lazy dog") == True def test_is_pangram_missing_letters(): assert is_pangram("Hello World") == False def test_is_pangram_empty_string(): assert is_pangram("") == False def test_is_pa...
def is_pangram(input_string):
[5048]
null
null
null
null
0
3
kod:Filter_80919_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a Python function that takes a list of integers and returns a new list with all the odd integers removed. Use list comprehension to solve this problem. Example: If the input list is [1, 2, 3, 4, 5], the output list should be [2, 4].
Write a Python function that takes a list of integers and returns a new list with all the odd integers removed. Use list comprehension to solve this problem. Example: If the input list is [1, 2, 3, 4, 5], the output list should be [2, 4]. Implement the required callable(s) in Python 3. Preserve the requested names and...
pytest
from solution import remove_odds def test_remove_odds_with_mixed_numbers(): assert remove_odds([1, 2, 3, 4, 5]) == [2, 4] def test_remove_odds_with_all_even(): assert remove_odds([2, 4, 6, 8]) == [2, 4, 6, 8] def test_remove_odds_with_all_odd(): assert remove_odds([1, 3, 5, 7]) == [] def test_remove_odd...
def remove_odds(input_list):
['Qwen2.5-Math-72B-Instruct_164018']
null
null
null
null
3
3
taco:16594
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
atcoder
An SNS has N users - User 1, User 2, \cdots, User N. Between these N users, there are some relationships - M friendships and K blockships. For each i = 1, 2, \cdots, M, there is a bidirectional friendship between User A_i and User B_i. For each i = 1, 2, \cdots, K, there is a bidirectional blockship between User C_i an...
An SNS has N users - User 1, User 2, \cdots, User N. Between these N users, there are some relationships - M friendships and K blockships. For each i = 1, 2, \cdots, M, there is a bidirectional friendship between User A_i and User B_i. For each i = 1, 2, \cdots, K, there is a bidirectional blockship between User C_i an...
stdio
null
null
null
https://atcoder.jp/contests/abc157/tasks/abc157_d
[ "10 9 3\n10 0\n8 6\n8 2\n2 5\n8 4\n7 3\n10 9\n6 4\n8 8\n2 6\n7 5\n3 1", "4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1", "6 10 0\n1 2\n1 3\n1 4\n1 5\n3 2\n2 4\n2 5\n4 3\n5 3\n4 5", "5 10 0\n1 2\n1 3\n3 4\n1 5\n5 2\n2 3\n2 5\n1 1\n1 3\n4 1", "8 10 0\n2 2\n1 0\n3 4\n1 5\n3 2\n0 4\n0 5\n4 0\n1 2\n4 1", "5 7 0\n1 2\n2 3\n2 ...
[ "0 1 0 2 3 1 0 -1 1 0\n", "0 1 0 1", "0 0 0 0 0 0\n", "-3 0 0 2 1\n", "1 1 3 1 3 0 0 0\n", "4 -1 4 3 4\n", "4 -1 4 3 3\n", "0 -1 1 -1 1\n", "1 1 3 1 3 0 0 0 0 0 0 0 0 0\n", "-2 -1 0 1 2\n", "1 1 0 2 2 0 0 1 1 0\n", "-1 1 3 3 2\n", "-1 -3 4 2 4\n", "-1 -1 2 3 3\n", "-3 0 3 3 3\n", "-3 0...
106
0
3
taco:23247
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
Kolya got an integer array $a_1, a_2, \dots, a_n$. The array can contain both positive and negative integers, but Kolya doesn't like $0$, so the array doesn't contain any zeros. Kolya doesn't like that the sum of some subsegments of his array can be $0$. The subsegment is some consecutive segment of elements of the ar...
Kolya got an integer array $a_1, a_2, \dots, a_n$. The array can contain both positive and negative integers, but Kolya doesn't like $0$, so the array doesn't contain any zeros. Kolya doesn't like that the sum of some subsegments of his array can be $0$. The subsegment is some consecutive segment of elements of the ar...
stdio
null
null
null
https://codeforces.com/problemset/problem/1426/D
[ "100\n-6 2 8 -9 -9 3 -3 -2 7 3 2 -2 -9 -7 -10 -9 10 4 5 -9 8 -5 7 -2 6 -2 4 4 -2 -5 6 4 8 -8 9 7 -4 2 -3 7 4 -10 -7 -4 8 2 10 -8 -3 -8 -5 -5 -10 -6 -8 -5 7 -1 7 -5 9 10 3 5 10 -7 -3 -7 1 -5 -8 5 1 -1 4 10 2 6 -4 9 3 10 -5 -10 -10 -2 1 9 10 1 10 2 8 -3 -3 -1 7 -5 5 -4\n", "2\n-1 1\n", "8\n16 -5 -11 -15 10 5 6 -4...
[ "12\n", "1\n", "2\n", "0\n", "20\n", "3\n", "6\n", "2\n", "46\n", "1\n", "1\n", "1\n", "1\n", "3\n", "1\n", "11\n", "0\n", "1\n", "0\n", "13\n", "1\n", "0\n", "1\n", "12\n", "2\n", "1\n", "1\n", "1\n", "0\n", "0\n", "0\n", "1\n" ]
139
0
3
taco:20265
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address (vasya@gmail.com). It is known that a proper email address contains only such symbols a...
Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address (vasya@gmail.com). It is known that a proper email address contains only such symbols a...
stdio
null
null
null
https://codeforces.com/problemset/problem/41/C
[ "sdfuiopguoidfbhuihsrdgftuioheguoatsfhgvuherasuihfsduphguphewruidruopsghuiofhbvjudfbdpiuthrupwrkgfhda\n", "aatt\n", "atdotatsatatiatatnatudotdotdotatdotdotddotdotdotwatxdotdotdotdotdoteatatfattatatdotatatdotidotzkvnat\n", "cotatatdot\n", "batatatgldotatatpatsatrdotatjdotatdotatfndotdotatzatuatrdotxiwatvhdat...
[ "sdfuiopguoidfbhuihsrdgftuioheguo@sfhgvuherasuihfsduphguphewruidruopsghuiofhbvjudfbdpiuthrupwrkgfhda\n", "a@t\n", "at.@satatiatatnatu...at..d...watx.....eatatfattatat.atat.i.zkvnat\n", "cot@atdot\n", "b@atatgl.atatpatsatr.atj.at.atfn..atzatuatr.xiwatvhdatdatsyatatatratatx.h.a.aty\n", "dot.@at\n", "x@v.r...
133
0
3
taco:6957
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Turbulent times are coming, so you decided to buy sugar in advance. There are $n$ shops around that sell sugar: the $i$-th shop sells one pack of sugar for $a_i$ coins, but only one pack to one customer each day. So in order to buy several packs, you need to visit several shops. Another problem is that prices are incr...
Turbulent times are coming, so you decided to buy sugar in advance. There are $n$ shops around that sell sugar: the $i$-th shop sells one pack of sugar for $a_i$ coins, but only one pack to one customer each day. So in order to buy several packs, you need to visit several shops. Another problem is that prices are incr...
stdio
null
null
null
https://codeforces.com/problemset/problem/1671/C
[ "4\n3 7\n2 1 2\n5 9\n10 20 30 40 50\n1 1\n1\n2 1000\n1 1\n", "1\n1 1000000\n228228\n", "1\n1 228228228\n228228228\n", "1\n1 1000000000\n1\n", "1\n1 1\n2\n", "1\n100 37\n29 33 45 64 95 33 45 76 86 5 52 16 27 24 80 5 44 19 96 8 77 67 21 17 22 56 28 3 84 27 39 12 60 35 75 6 68 71 81 5 76 85 73 54 8 4 58 4 22...
[ "11\n0\n1\n1500\n", "771773\n", "1\n", "1000000000\n", "0\n", "82\n" ]
6
0
3
taco:12269
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
"The zombies are lurking outside. Waiting. Moaning. And when they come..." "When they come?" "I hope the Wall is high enough." Zombie attacks have hit the Wall, our line of defense in the North. Its protection is failing, and cracks are showing. In places, gaps have appeared, splitting the wall into multiple segment...
"The zombies are lurking outside. Waiting. Moaning. And when they come..." "When they come?" "I hope the Wall is high enough." Zombie attacks have hit the Wall, our line of defense in the North. Its protection is failing, and cracks are showing. In places, gaps have appeared, splitting the wall into multiple segment...
stdio
null
null
null
https://codeforces.com/problemset/problem/690/D1
[ "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n...-...\n...-...\n...C...\nB.BB.B.\n", "1 1\nB\n", "4 6\n.-A...\nB.B.BB\nBBB.BB\nBBBBBB\n", "3 7\n.......\n..../..\n..B.BB.\n", "4 6\n..-A-.\nA.B.CB\nBBB.BB\nBBBBBB\n", "3 7\n.......\n.......\n..B.BB.\n", "4 5\n..B..\n..B..\nB/B.@\nBBB.B\n", ...
[ "3\n", "1\n", "1\n", "2\n", "1\n", "2\n", "2\n", "1\n", "2\n", "2\n", "2\n", "2\n", "3\n", "1\n", "2\n", "1\n", "1\n", "2\n", "2\n", "1\n", "2\n", "2\n", "2\n", "1\n", "1\n", "2\n", "2\n", "1\n", "1\n", "1\n", "2\n", "1\n" ]
72
3
3
kod:Filter_13488_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Filter
We are given an array of integers, where each integer represents the height of a building in an array of buildings. We want to write a function `alongSightline` that takes this array of heights and returns an array of the indices of the buildings that can be seen when looking from the left (west) and the right (east). ...
We are given an array of integers, where each integer represents the height of a building in an array of buildings. We want to write a function `alongSightline` that takes this array of heights and returns an array of the indices of the buildings that can be seen when looking from the left (west) and the right (east). ...
pytest
from solution import alongSightline def test_alongSightline_empty(): assert alongSightline([]) == [] def test_alongSightline_single_building(): assert alongSightline([5]) == [0] def test_alongSightline_increasing_heights(): assert alongSightline([1, 2, 3, 4, 5]) == [0, 1, 2, 3, 4] def test_alongSightlin...
def alongSightline(heights):
['Llama-3.3-70B-Instruct_34968']
null
null
null
null
2
3
taco:14361
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
This is the easy version of this problem. The only difference is the constraint on $k$ — the number of gifts in the offer. In this version: $k=2$. Vasya came to the store to buy goods for his friends for the New Year. It turned out that he was very lucky — today the offer "$k$ of goods for the price of one" is held in...
This is the easy version of this problem. The only difference is the constraint on $k$ — the number of gifts in the offer. In this version: $k=2$. Vasya came to the store to buy goods for his friends for the New Year. It turned out that he was very lucky — today the offer "$k$ of goods for the price of one" is held in...
stdio
null
null
null
https://codeforces.com/problemset/problem/1282/B1
[ "8\n5 11 2\n2 3 3 5 7\n5 11 2\n2 4 3 5 7\n3 2 3\n4 2 6\n5 2 6\n10 1 3 9 2\n2 10000 2\n10100 10000\n2 9999 2\n10000 10000\n4 6 10\n0 2 3 2\n5 8 3\n1 2 2 2 2\n", "2\n2 1 2\n1 1\n2 2000000000 2\n1 1\n", "8\n5 6 2\n2 3 3 5 7\n5 11 2\n2 4 3 5 7\n3 2 3\n4 2 6\n5 2 6\n10 1 3 9 2\n2 00000 2\n10100 10000\n2 9999 1\n1000...
[ "4\n4\n1\n2\n1\n0\n4\n5\n", "2\n2\n", "3\n4\n1\n2\n0\n0\n4\n5\n", "3\n4\n0\n2\n3\n3\n", "4\n4\n1\n2\n1\n0\n4\n5\n", "3\n4\n0\n2\n3\n3\n", "2\n4\n2\n2\n5\n3\n", "4\n4\n1\n2\n1\n0\n4\n5\n", "4\n4\n1\n2\n1\n0\n4\n5\n", "3\n4\n2\n0\n4\n3\n", "4\n4\n1\n2\n0\n0\n4\n5\n", "3\n4\n2\n0\n5\n3\n", "3\n...
104
0
3
kod:Filter_15530_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
I have list of numbers in python, for example, `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`, and I want to create pairs of numbers from this list, for example: `(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)`. I can achieve this by using the following approach: ```python numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] pairs = [] for i in ran...
I have list of numbers in python, for example, `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`, and I want to create pairs of numbers from this list, for example: `(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)`. I can achieve this by using the following approach: ```python numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] pairs = [] for i in ran...
pytest
from solution import create_pairs def test_even_length_list(): assert create_pairs([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)] def test_odd_length_list(): assert create_pairs([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) == [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, None)] def te...
def create_pairs(numbers):
['Llama-3.3-70B-Instruct_39687']
null
null
null
null
1
3
kod:Filter_88732_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
This is the problem I need to solve: **Problem:** Given an array of integers `nums` and an integer `target`, return *indices* of the two numbers such that they add up to `target`. You may assume that each input would have **exactly one solution**, and you may not use the *same* element twice. You can return the answ...
This is the problem I need to solve: **Problem:** Given an array of integers `nums` and an integer `target`, return *indices* of the two numbers such that they add up to `target`. You may assume that each input would have **exactly one solution**, and you may not use the *same* element twice. You can return the answ...
pytest
from solution import two_sum def test_two_sum_example(): assert two_sum([2, 7, 11, 15], 9) == [0, 1] def test_two_sum_with_negatives(): assert two_sum([-3, 4, 3, 90], 0) == [0, 2] def test_two_sum_multiple_pairs(): assert two_sum([2, 5, 5, 11], 10) == [1, 2] def test_two_sum_no_solution(): assert tw...
def two_sum(nums, target):
['gemma-2-27b-it_185382']
null
null
null
null
2
3
taco:24202
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You have three piles of candies: red, green and blue candies: the first pile contains only red candies and there are $r$ candies in it, the second pile contains only green candies and there are $g$ candies in it, the third pile contains only blue candies and there are $b$ candies in it. Each day Tanya eats exactly...
You have three piles of candies: red, green and blue candies: the first pile contains only red candies and there are $r$ candies in it, the second pile contains only green candies and there are $g$ candies in it, the third pile contains only blue candies and there are $b$ candies in it. Each day Tanya eats exactly...
stdio
null
null
null
https://codeforces.com/problemset/problem/1263/A
[ "6\n2 1 1\n1 1 1\n4 1 2\n7 7 18\n12 1 4\n14 0 13\n", "6\n1 1 1\n2 4 1\n4 1 1\n7 4 7\n8 1 4\n8 2 8\n", "6\n0 1 1\n2 2 1\n4 1 1\n7 4 10\n8 1 4\n8 2 8\n", "6\n1 1 1\n2 4 1\n4 1 1\n7 4 7\n8 1 3\n12 2 8\n", "6\n1 1 1\n1 2 1\n4 1 1\n7 7 25\n8 1 4\n8 2 15\n", "6\n1 0 1\n2 4 1\n4 1 1\n1 4 4\n9 1 4\n21 2 8\n", "...
[ "2\n1\n3\n14\n5\n13\n", "1\n3\n2\n9\n5\n9\n", "1\n2\n2\n10\n5\n9\n", "1\n3\n2\n9\n4\n10\n", "1\n2\n2\n14\n5\n10\n", "1\n3\n2\n4\n5\n10\n", "1\n2\n3\n7\n5\n10\n", "1\n1\n1\n17\n5\n9\n", "1\n2\n2\n12\n5\n16\n", "1\n2\n3\n14\n5\n9\n", "1\n2\n2\n14\n5\n9\n", "1\n2\n1\n14\n5\n9\n", "1\n2\n2\n7\n5...
98
2
3
taco:13922
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given three positive integers $n$, $a$ and $b$. You have to construct a string $s$ of length $n$ consisting of lowercase Latin letters such that each substring of length $a$ has exactly $b$ distinct letters. It is guaranteed that the answer exists. You have to answer $t$ independent test cases. Recall that th...
You are given three positive integers $n$, $a$ and $b$. You have to construct a string $s$ of length $n$ consisting of lowercase Latin letters such that each substring of length $a$ has exactly $b$ distinct letters. It is guaranteed that the answer exists. You have to answer $t$ independent test cases. Recall that th...
stdio
null
null
null
https://codeforces.com/problemset/problem/1335/B
[ "1\n3495 231 24\n", "1\n1 1 1\n", "9\n55 41 6\n20 15 2\n49 41 21\n22 5 2\n69 34 3\n95 31 26\n67 34 16\n165 34 6\n89 54 21\n", "1\n50 1 1\n", "5\n400 400 1\n400 702 2\n400 400 1\n355 400 1\n400 19 1\n", "1\n25 25 25\n", "1\n100 1 4\n", "1\n1100 0 1\n", "4\n7 5 3\n6 1 1\n6 6 1\n8 2 2\n", "1\n1011 1 ...
[ "abcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabcdefghijklmnopqrstuvwxabc...
126
0
3
taco:21098
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 × 4 cake may look as follows: [Image] The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contain...
You are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 × 4 cake may look as follows: [Image] The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contain...
stdio
null
null
null
https://codeforces.com/problemset/problem/330/A
[ "10 10\nS...SRSSSS\nS...SSSSRS\nS...SSSSSS\nS...SSSSSS\nS...SSSSSS\nS...SSSSSS\nS...SSSSSS\nS..SS.SSSS\nS...SSSSSS\nS...SSSSSS\n", "2 2\n..\n..\n", "10 6\n.SSSSS\nSSS.SS\nSSSSSS\nS.SSSS\nSSSSS.\nS/SRST\nSSS.SS\n.SSS.S\n..SSS.\nSS..SS\n", "9 5\nSSSSS\nSSSSR\nSSSSS\nSSSSS\nSSSSS\nSSSSS\nSSSSS\nSSSSS\nSSSSS\n", ...
[ "20\n", "4\n", "0\n", "0\n", "10\n", "0\n", "26\n", "0\n", "10\n", "28\n", "0\n", "10\n", "2\n", "20\n", "12\n", "0\n", "0\n", "17\n", "7\n", "35\n", "0\n", "0\n", "0\n", "10\n", "0\n", "0\n", "10\n", "3\n", "0\n", "46\n", "10\n", "30\n" ]
161
2
3
kod:Filter_14910_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
I need to check if a certain number exists in a list. If the number doesn't exist, it should be added to the list. If the number already exists, it should be removed from the list. Here's my list: `[1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4]`. I'm checking for the number 5. Here's what I have so far: ```python de...
I need to check if a certain number exists in a list. If the number doesn't exist, it should be added to the list. If the number already exists, it should be removed from the list. Here's my list: `[1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4]`. I'm checking for the number 5. Here's what I have so far: ```python de...
pytest
from solution import check_and_update_list def test_check_add_number(): numbers = [1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4] result = check_and_update_list(5, numbers) assert result == [1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5] def test_check_remove_all_occurrences(): numbers = [1, 1, 2, 2, 2, 3, 3...
def check_and_update_list(num, lst):
['Llama-3.3-70B-Instruct_38290']
null
null
null
null
1
3
kod:Evol_50_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Evol
Implement a function to determine the longest consecutive sequence of identical elements in a given array of integers and return the element and the length of that sequence. If there are multiple sequences of the same length, return the first one encountered. Example: Input: [1, 1, 2, 2, 2, 3, 3, 1, 1, 1] Output: (2, ...
Implement a function to determine the longest consecutive sequence of identical elements in a given array of integers and return the element and the length of that sequence. If there are multiple sequences of the same length, return the first one encountered. Example: Input: [1, 1, 2, 2, 2, 3, 3, 1, 1, 1] Output: (2, ...
pytest
from solution import longest_consecutive_sequence def test_example(): assert longest_consecutive_sequence([1, 1, 2, 2, 2, 3, 3, 1, 1, 1]) == (2, 3) def test_all_unique(): assert longest_consecutive_sequence([1, 2, 3, 4]) == (1, 1) def test_all_same(): assert longest_consecutive_sequence([1, 1, 1, 1]) == ...
def longest_consecutive_sequence(arr):
[37981]
null
null
null
null
1
3
taco:23213
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
After finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers — the first column containing integers from 1 to n and the second containing integers from 1 to m. Now the girl wants to count how many pairs of integers she can choose, one from the first column ...
After finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers — the first column containing integers from 1 to n and the second containing integers from 1 to m. Now the girl wants to count how many pairs of integers she can choose, one from the first column ...
stdio
null
null
null
https://codeforces.com/problemset/problem/682/A
[ "1000000 1892547\n", "1 5\n", "4743 271373\n", "7 828\n", "567388 441801\n", "0 4\n", "855 365\n", "118887 842857\n", "8 13\n", "4 7\n", "10 14\n", "400540 176073\n", "1 3\n", "518449 206750\n", "640 325\n", "365 821\n", "3 4\n", "10 15\n", "99999 99999\n", "5 7\n", "4813 645...
[ "378509400000\n", "1\n", "257424428\n", "1159\n", "50134517157\n", "0\n", "62415\n", "20040948031\n", "21\n", "6\n", "28\n", "14104855884\n", "0\n", "21437866150\n", "41600\n", "59933\n", "3\n", "30\n", "1999960001\n", "7\n", "62088662\n", "2\n", "165869588\n", "5\n", ...
351
1
3
taco:15515
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
It's New Year's Eve soon, so Ivan decided it's high time he started setting the table. Ivan has bought two cakes and cut them into pieces: the first cake has been cut into a pieces, and the second one — into b pieces. Ivan knows that there will be n people at the celebration (including himself), so Ivan has set n plat...
It's New Year's Eve soon, so Ivan decided it's high time he started setting the table. Ivan has bought two cakes and cut them into pieces: the first cake has been cut into a pieces, and the second one — into b pieces. Ivan knows that there will be n people at the celebration (including himself), so Ivan has set n plat...
stdio
null
null
null
https://codeforces.com/problemset/problem/911/B
[ "100 100 100\n", "5 2 3\n", "14 95 1\n", "4 3 1\n", "3 42 80\n", "8 3 6\n", "2 2 10\n", "41 34 67\n", "3 2 8\n", "18 100 50\n", "4 66 41\n", "4 15 3\n", "3 9 14\n", "9 3 23\n", "6 3 3\n", "3 3 3\n", "66 100 99\n", "55 27 30\n", "8 8 6\n", "6 75 91\n", "2 94 94\n", "99 82 53...
[ "2\n", "1\n", "1\n", "1\n", "40\n", "1\n", "2\n", "2\n", "2\n", "8\n", "22\n", "3\n", "7\n", "2\n", "1\n", "1\n", "3\n", "1\n", "1\n", "25\n", "94\n", "1\n", "10\n", "95\n", "1\n", "1\n", "7\n", "1\n", "5\n", "1\n", "3\n", "2\n" ]
370
1
3
kod:Filter_7505_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
You've been asked to write a Python function that calculates the sum of all the integers from 1 up to a given number (inclusive). This function should take one argument, the upper limit of the range of numbers to be summed, and return the sum of all the integers from 1 up to this number. For example, if the function ...
You've been asked to write a Python function that calculates the sum of all the integers from 1 up to a given number (inclusive). This function should take one argument, the upper limit of the range of numbers to be summed, and return the sum of all the integers from 1 up to this number. For example, if the function ...
pytest
from solution import sum_numbers def test_sum_numbers_small_limit(): assert sum_numbers(1) == 1 assert sum_numbers(2) == 3 assert sum_numbers(3) == 6 def test_sum_numbers_medium_limit(): assert sum_numbers(5) == 15 assert sum_numbers(10) == 55 def test_sum_numbers_large_limit(): assert sum_nu...
def sum_numbers(upper_limit):
['Llama-3.3-70B-Instruct_21321']
null
null
null
null
0
3
taco:5958
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya loves tickets very much. As we know, each ticket has a number that is a positive integer. It...
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya loves tickets very much. As we know, each ticket has a number that is a positive integer. It...
stdio
null
null
null
https://codeforces.com/problemset/problem/146/A
[ "50\n50196876533388619134773681265589634027385197364525\n", "2\n33\n", "16\n6103254934538798\n", "4\n2354\n", "50\n44747747774474747747747447777447774747447477444474\n", "2\n17\n", "10\n2096666392\n", "32\n133789254203025495059905552222407\n", "4\n0044\n", "2\n77\n", "2\n134\n", "50\n140644030...
[ "NO\n", "NO", "NO\n", "NO\n", "YES", "NO\n", "NO\n", "NO\n", "NO", "YES", "NO\n", "NO\n", "NO\n", "NO", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO", "NO", "NO\n", "NO\n", "NO", "NO\n", "NO\n" ]
146
0
3
taco:12105
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Given an integer $n$, find the maximum value of integer $k$ such that the following condition holds: $n$ & ($n-1$) & ($n-2$) & ($n-3$) & ... ($k$) = $0$ where & denotes the bitwise AND operation. -----Input----- The first line contains a single integer $t$ ($1 \le t \le 3 \cdot 10^4$). Then $t$ test cases follow. ...
Given an integer $n$, find the maximum value of integer $k$ such that the following condition holds: $n$ & ($n-1$) & ($n-2$) & ($n-3$) & ... ($k$) = $0$ where & denotes the bitwise AND operation. -----Input----- The first line contains a single integer $t$ ($1 \le t \le 3 \cdot 10^4$). Then $t$ test cases follow. ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1527/A
[ "1\n276490162\n", "1\n6\n", "1\n622665\n", "1\n4368\n", "1\n1170826\n", "1\n859\n", "1\n45738\n", "1\n3229985\n", "1\n3088665\n", "1\n4893353\n", "1\n705\n", "1\n7961\n", "1\n3810512\n", "1\n88386\n", "1\n12\n", "1\n3432\n", "1\n3367416\n", "1\n68926\n", "1\n1024\n", "1\n111523...
[ "268435455\n", "3\n", "524287\n", "4095\n", "1048575\n", "511\n", "32767\n", "2097151\n", "2097151\n", "4194303\n", "511\n", "4095\n", "2097151\n", "65535\n", "7\n", "2047\n", "2097151\n", "65535\n", "1023\n", "8388607\n", "134217727\n", "2097151\n", "0\n1\n15\n", "0\n3...
204
1
3
taco:20885
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly k points, the score is reset and a new set begins. Across all the sets Misha scored a points ...
Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly k points, the score is reset and a new set begins. Across all the sets Misha scored a points ...
stdio
null
null
null
https://codeforces.com/problemset/problem/765/C
[ "2 1000000000 1000000000\n", "5 5 0\n", "10 15 1\n", "5 1 12\n", "22 25 6\n", "1 5 0\n", "22 25 5\n", "11 23 1\n", "2 1 3\n", "10 1 11\n", "2 6 0\n", "11 4 12\n", "11 25 5\n", "7572 9186 895\n", "11 10 12\n", "5 6 0\n", "5 4 7\n", "11 12 0\n", "12 25 1\n", "11 3 23\n", "11 5 ...
[ "1000000000\n", "1", "-1", "-1", "-1\n", "5\n", "-1", "-1\n", "-1", "-1", "3", "-1", "-1", "-1", "-1\n", "-1\n", "-1", "-1\n", "-1", "-1", "-1\n", "-1", "-1", "-1", "-1\n", "-1", "-1", "-1", "-1", "333333334\n", "-1", "-1" ]
432
0
3
taco:23496
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
A card pyramid of height $1$ is constructed by resting two cards against each other. For $h>1$, a card pyramid of height $h$ is constructed by placing a card pyramid of height $h-1$ onto a base. A base consists of $h$ pyramids of height $1$, and $h-1$ cards on top. For example, card pyramids of heights $1$, $2$, and $3...
A card pyramid of height $1$ is constructed by resting two cards against each other. For $h>1$, a card pyramid of height $h$ is constructed by placing a card pyramid of height $h-1$ onto a base. A base consists of $h$ pyramids of height $1$, and $h-1$ cards on top. For example, card pyramids of heights $1$, $2$, and $3...
stdio
null
null
null
https://codeforces.com/problemset/problem/1345/B
[ "50\n11833308\n5211498\n64660\n9077929\n2699416\n2432035\n234901\n1337830\n8457191\n10523566\n5722429\n5452712\n5511654\n8587879\n348160\n3141182\n2661936\n395300\n6950223\n2119926\n4407089\n3559060\n10228325\n5752720\n1607500\n647047\n8904557\n1954681\n698061\n9852830\n1972893\n13760200\n5944868\n9527673\n2618168\...
[ "4\n5\n4\n6\n4\n5\n4\n5\n4\n6\n6\n4\n5\n5\n3\n3\n3\n5\n5\n3\n5\n4\n5\n6\n5\n5\n4\n6\n3\n4\n5\n4\n6\n3\n4\n5\n5\n4\n3\n6\n4\n4\n5\n5\n6\n5\n3\n5\n2\n6\n", "6\n", "5\n5\n5\n7\n5\n4\n3\n2\n4\n4\n4\n5\n6\n3\n4\n5\n5\n4\n6\n5\n", "5\n7\n4\n", "1\n3\n2\n0\n1\n0\n1\n1\n2\n2\n2\n0\n1\n3\n2\n2\n0\n2\n1\n1\n1\n0\n0\n...
106
0
3
taco:15485
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist onl...
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist onl...
stdio
null
null
null
https://codeforces.com/problemset/problem/770/A
[ "114 14\n", "2 2\n", "35 4\n", "17 4\n", "100 2\n", "8 2\n", "26 25\n", "79 21\n", "10 2\n", "26 13\n", "100 4\n", "102 19\n", "26 11\n", "35 8\n", "100 11\n", "101 4\n", "100 3\n", "113 9\n", "100 7\n", "7 4\n", "79 3\n", "010 10\n", "27 26\n", "8 3\n", "113 5\n", ...
[ "abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnab", "ab\n", "abcdabcdabcdabcdabcdabcdabcdabcdabc\n", "abcdabcdabcdabcda", "abababababababababababababababababababababababababababababababababababababababababababababababababab\n", "abababab", ...
171
0
3
taco:21622
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codechef
Chef talks a lot on his mobile phone. As a result he exhausts his talk-value (in Rokdas) very quickly. One day at a mobile recharge shop, he noticed that his service provider gives add-on plans which can lower his calling rates (Rokdas/minute). One of the plans said "Recharge for 28 Rokdas and enjoy call rates of 0.50 ...
Chef talks a lot on his mobile phone. As a result he exhausts his talk-value (in Rokdas) very quickly. One day at a mobile recharge shop, he noticed that his service provider gives add-on plans which can lower his calling rates (Rokdas/minute). One of the plans said "Recharge for 28 Rokdas and enjoy call rates of 0.50 ...
stdio
null
null
null
https://www.codechef.com/problems/HELLO
[ "4\n1.00 90 1\n1 1.7525489781557062 28\n1.3670910027404404 200 2\n2 0.75 40\n5 1.2448234862135843 101\n1.690723151930112 50 2\n1 1.4388842285899601 65\n2 2.296376152318535 100\n1.00 000 2\n3 1.1116288236865874 10\n4 1.5704897737882006 36", "4\n1.00 200 1\n1 0.50 28\n1.00 200 2\n1 0.75 40\n3 0.60 100\n1.00 50 2\n1...
[ "0\n1\n0\n0\n", "1\n2\n0\n2", "0\n2\n0\n2\n", "0\n2\n0\n2\n", "1\n1\n0\n1\n", "1\n2\n0\n2\n", "1\n2\n0\n2\n", "0\n2\n0\n2\n", "1\n2\n0\n2\n", "0\n2\n0\n2\n", "0\n2\n0\n2\n", "0\n2\n0\n2\n", "0\n0\n2\n2\n", "1\n2\n1\n2\n", "1\n2\n0\n2\n", "0\n2\n0\n2\n", "1\n2\n0\n2\n", "1\n2\n2\n2\...
102
1
3
taco:4408
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Dawid has four bags of candies. The $i$-th of them contains $a_i$ candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that each friend receives the same amount of candies in total? Note, that you can't keep bags for yourself or ...
Dawid has four bags of candies. The $i$-th of them contains $a_i$ candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that each friend receives the same amount of candies in total? Note, that you can't keep bags for yourself or ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1230/A
[ "100 100 100 100\n", "7 3 2 5\n", "1 7 11 5\n", "1 2 2 8\n", "10 14 65 71\n", "4 3 4 2\n", "5 7 1 3\n", "26 52 7 19\n", "5 10 1 6\n", "76 97 99 74\n", "66 68 16 82\n", "7 3 6 3\n", "20 14 37 71\n", "2 1 28 9\n", "0 1 2 1\n", "69 7 44 30\n", "6 4 8 3\n", "1 2 5 15\n", "1 1 1 3\n",...
[ "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "YES\n", "YES\n", "YES\n", "YES\n", "NO\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n", "YES\n", "NO\n...
216
0
3
kod:Evol_3735_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Evol
You have an array of integers. Write a function that returns a new array containing only the elements that appear more than once in the input array. Elements should be presented in the same order they first appear in the input array. Function Signature: ```python def find_duplicates(arr: list[int]) -> list[int]: p...
You have an array of integers. Write a function that returns a new array containing only the elements that appear more than once in the input array. Elements should be presented in the same order they first appear in the input array. Function Signature: ```python def find_duplicates(arr: list[int]) -> list[int]: p...
pytest
from solution import find_duplicates def test_no_duplicates(): assert find_duplicates([7, 8, 9, 10]) == [] def test_all_duplicates(): assert find_duplicates([10, 20, 20, 30, 30, 30, 40, 40]) == [20, 30, 40] def test_some_duplicates(): assert find_duplicates([1, 2, 2, 3, 4, 4, 4, 5]) == [2, 4] assert ...
def find_duplicates(arr):
[43712]
null
null
null
null
0
3
taco:3649
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and on the other hand, one doesn't want to order too many T-shirts (and we do not ...
One day a well-known sponsor of a well-known contest decided to give every participant of the contest a T-shirt as a present. A natural problem occurred: on the one hand, it is not clear how many T-shirts of what sizes should be ordered, and on the other hand, one doesn't want to order too many T-shirts (and we do not ...
stdio
null
null
null
https://codeforces.com/problemset/problem/46/B
[ "302 143 27 63 452\n100\nXXL\nM\nXL\nS\nXXL\nS\nL\nXL\nXL\nXL\nXXL\nS\nXXL\nS\nXXL\nXL\nXL\nXXL\nXL\nXXL\nM\nS\nS\nS\nS\nXXL\nS\nL\nXL\nXXL\nXXL\nS\nXXL\nL\nXXL\nM\nS\nL\nL\nXL\nXL\nS\nXL\nL\nXL\nM\nXL\nL\nM\nS\nXL\nXXL\nXL\nL\nXL\nXL\nXL\nM\nM\nXL\nL\nS\nS\nXL\nS\nXXL\nXXL\nXL\nS\nXL\nXXL\nS\nS\nL\nL\nXXL\nXL\nL\n...
[ "XXL\nM\nXL\nS\nXXL\nS\nL\nXL\nXL\nXL\nXXL\nS\nXXL\nS\nXXL\nXL\nXL\nXXL\nXL\nXXL\nM\nS\nS\nS\nS\nXXL\nS\nL\nXL\nXXL\nXXL\nS\nXXL\nL\nXXL\nM\nS\nL\nL\nXL\nXL\nS\nXL\nL\nXL\nM\nXL\nL\nM\nS\nXL\nXXL\nXL\nL\nXL\nXL\nXL\nM\nM\nXL\nL\nS\nS\nXL\nS\nXXL\nXXL\nXL\nS\nXL\nXXL\nS\nS\nL\nL\nXXL\nXL\nL\nXL\nM\nS\nM\nM\nXL\nXXL\...
109
1
3
taco:6259
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Arkady coordinates rounds on some not really famous competitive programming platform. Each round features $n$ problems of distinct difficulty, the difficulties are numbered from $1$ to $n$. To hold a round Arkady needs $n$ new (not used previously) problems, one for each difficulty. As for now, Arkady creates all the ...
Arkady coordinates rounds on some not really famous competitive programming platform. Each round features $n$ problems of distinct difficulty, the difficulties are numbered from $1$ to $n$. To hold a round Arkady needs $n$ new (not used previously) problems, one for each difficulty. As for now, Arkady creates all the ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1100/B
[ "11010 10\n10000 9999 9998 1967 4706 9995 3707 10471 9992 9991\n", "1 1\n1\n", "11000 6\n10000 9999 9998 9997 9996 9995 9994 9993 2904 9991\n", "5 20\n1 4 4 2 1 1 3 5 4 2 2 4 5 1 3 3 4 5 1 4\n", "11000 10\n10010 9999 9998 1967 6346 9995 10517 921 9992 9991\n", "4 8\n2 1 3 4 1 3 3 3\n", "5 20\n1 4 4 2 1 ...
[ "0000000000\n", "1\n", "000000\n", "00000001000000100100\n", "0000000000\n", "00010000\n", "00000001000000100010\n", "0000000000\n", "00000000010000000000\n", "00001000\n", "000000\n", "0000000000\n", "0000000000\n", "00001000\n", "00000001000000100010\n", "000000\n", "0000000000\n",...
105
0
3
taco:9046
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
There are $b$ boys and $g$ girls participating in Olympiad of Metropolises. There will be a board games tournament in the evening and $n$ participants have accepted the invitation. The organizers do not know how many boys and girls are among them. Organizers are preparing red badges for girls and blue ones for boys. ...
There are $b$ boys and $g$ girls participating in Olympiad of Metropolises. There will be a board games tournament in the evening and $n$ participants have accepted the invitation. The organizers do not know how many boys and girls are among them. Organizers are preparing red badges for girls and blue ones for boys. ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1214/B
[ "299\n448\n192\n", "5\n6\n3\n", "297\n6\n298\n", "5\n6\n10\n", "199\n167\n279\n", "3\n3\n1\n", "1\n200\n33\n", "199\n89\n221\n", "300\n1\n150\n", "300\n333\n3\n", "10\n19\n12\n", "3\n3\n4\n", "300\n333\n2\n", "300\n300\n1\n", "300\n333\n1\n", "7\n8\n10\n", "300\n1\n128\n", "123\n55...
[ "193\n", "4\n", "6\n", "2\n", "88\n", "2\n", "2\n", "68\n", "2\n", "4\n", "11\n", "3\n", "3\n", "2\n", "2\n", "6\n", "2\n", "56\n", "1\n", "62\n", "16\n", "3\n", "25\n", "193\n", "78\n", "4\n", "3\n", "1\n", "259\n", "24\n", "2\n", "300\n" ]
165
1
3
kod:Algorithm_14602_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Algorithm
### Problem Statement You are developing a software that schedules tasks for multiple servers. Each server can handle one task at a time and has a predefined capacity. The capacity is defined as the maximum value of task difficulty that the server can handle. Given an array of task difficulties and an array of server...
### Problem Statement You are developing a software that schedules tasks for multiple servers. Each server can handle one task at a time and has a predefined capacity. The capacity is defined as the maximum value of task difficulty that the server can handle. Given an array of task difficulties and an array of server...
pytest
from solution import schedule_tasks def test_all_tasks_fits(): assert schedule_tasks([3, 2, 1], [3, 2, 1]) == True def test_no_appropriate_server(): assert schedule_tasks([4, 5, 6], [3, 3, 3]) == False def test_exact_match(): assert schedule_tasks([1, 2, 3, 4], [4, 3, 2, 1]) == True def test_one_task_on...
def schedule_tasks(tasks, capacities):
[3358]
null
null
null
null
2
3
taco:24742
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Once little Vasya read an article in a magazine on how to make beautiful handmade garland from colored paper. Vasya immediately went to the store and bought n colored sheets of paper, the area of each sheet is 1 square meter. The garland must consist of exactly m pieces of colored paper of arbitrary area, each piece s...
Once little Vasya read an article in a magazine on how to make beautiful handmade garland from colored paper. Vasya immediately went to the store and bought n colored sheets of paper, the area of each sheet is 1 square meter. The garland must consist of exactly m pieces of colored paper of arbitrary area, each piece s...
stdio
null
null
null
https://codeforces.com/problemset/problem/408/B
[ "hvewdvwdwudrwarwmddwnazmwauzatrmwptwwevavpmwrtruwnpwantewrnwmepdwvtmnveanunrvrtxpvhhnuhnmpptdttzmmndtvudmzhhannmmnahdpzamuvhzaavnhtnumwrwvttdetvuewaaennddwuvzvaptdzrzhtetwwzmzedrwuvrwznprhdvnavrruvvhzuwpdtmpwmzrwvermrhdamv\nuvzhwtpuputnahwwarduzddhpnwwvettprwavdmnztdnrddmarmvuevtdezndnezvarhmppwwnmvnrtddzhhnzrwuhv...
[ "199\n", "-1", "-1\n", "-1\n", "-1\n", "-1", "-1\n", "-1\n", "-1\n", "9\n", "3\n", "-1\n", "-1\n", "-1\n", "5\n", "199\n", "1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "77\n", "-1\n", "-1\n", "1\n", "3\n" ]
110
1
3
taco:7996
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Polycarp has spent the entire day preparing problems for you. Now he has to sleep for at least $a$ minutes to feel refreshed. Polycarp can only wake up by hearing the sound of his alarm. So he has just fallen asleep and his first alarm goes off in $b$ minutes. Every time Polycarp wakes up, he decides if he wants to s...
Polycarp has spent the entire day preparing problems for you. Now he has to sleep for at least $a$ minutes to feel refreshed. Polycarp can only wake up by hearing the sound of his alarm. So he has just fallen asleep and his first alarm goes off in $b$ minutes. Every time Polycarp wakes up, he decides if he wants to s...
stdio
null
null
null
https://codeforces.com/problemset/problem/1354/A
[ "7\n10 3 6 4\n11 3 6 0\n5 9 4 10\n6 5 2 3\n1 1 1 1\n3947465 47342 338129 123123\n234123843 13 361451236 361451000\n", "1\n2 5 6 34383\n", "1\n1919 2938 630 212\n", "1\n4306 963 674 23\n", "1\n22492 22240 34399 35255\n", "1\n0 12 24 28500\n", "1\n2939 1154 106 31\n", "1\n79545 920 15738 35593\n", "1\...
[ "27\n15\n9\n-1\n1\n6471793\n358578060125049\n", "5\n", "2938\n", "5007\n", "-1\n", "12\n", "3698\n", "-1\n", "2558\n", "-1\n", "7263\n", "3771\n", "-1\n", "2648\n", "4496\n", "4\n", "27\n15\n9\n-1\n1\n6471793\n38899743469569\n", "2223\n", "-1\n", "2985\n", "-1\n", "5373\n",...
108
0
3
kod:Filter_53590_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Can you help me with a Python code snippet to reverse a string? I want to understand how it works too.
Can you help me with a Python code snippet to reverse a string? I want to understand how it works too. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standard library. Required call...
pytest
from solution import reverse_string def test_reverse_string_basic(): assert reverse_string("hello") == "olleh" def test_reverse_string_palindrome(): assert reverse_string("madam") == "madam" def test_reverse_string_empty(): assert reverse_string("") == "" def test_reverse_string_single_character(): ...
def reverse_string(s):
['Qwen2.5-72B-Instruct_110076']
null
null
null
null
1
3
taco:21677
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Let $LCM(x, y)$ be the minimum positive integer that is divisible by both $x$ and $y$. For example, $LCM(13, 37) = 481$, $LCM(9, 6) = 18$. You are given two integers $l$ and $r$. Find two integers $x$ and $y$ such that $l \le x < y \le r$ and $l \le LCM(x, y) \le r$. -----Input----- The first line contains one inte...
Let $LCM(x, y)$ be the minimum positive integer that is divisible by both $x$ and $y$. For example, $LCM(13, 37) = 481$, $LCM(9, 6) = 18$. You are given two integers $l$ and $r$. Find two integers $x$ and $y$ such that $l \le x < y \le r$ and $l \le LCM(x, y) \le r$. -----Input----- The first line contains one inte...
stdio
null
null
null
https://codeforces.com/problemset/problem/1389/A
[ "69\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1...
[ "1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n...
115
0
3
taco:1915
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Hands that shed innocent blood! There are n guilty people in a line, the i-th of them holds a claw with length L_{i}. The bell rings and every person kills some of people in front of him. All people kill others at the same time. Namely, the i-th person kills the j-th person if and only if j < i and j ≥ i - L_{i}. You...
Hands that shed innocent blood! There are n guilty people in a line, the i-th of them holds a claw with length L_{i}. The bell rings and every person kills some of people in front of him. All people kill others at the same time. Namely, the i-th person kills the j-th person if and only if j < i and j ≥ i - L_{i}. You...
stdio
null
null
null
https://codeforces.com/problemset/problem/892/B
[ "11\n1 0 0 1 0 3 2 0 0 2 2\n", "1\n0\n", "1\n1011111110\n", "4\n0 1 0 10\n", "2\n1110100000 0000010111\n", "2\n2 8\n", "1\n1001101001\n", "2\n1000000001 1000010000\n", "5\n0 0 0 1 0\n", "1\n0010110110\n", "1\n1001100001\n", "4\n1 0 3 1\n", "4\n0 0 0 1\n", "10\n1 1 3 0 0 0 2 1 0 3\n", "2\...
[ "4\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "4\n", "1\n", "1\n", "1\n", "3\n", "3\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "4\n", "1\n", "1\n", "1\n", "1\n" ]
126
3
3
taco:1626
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Vasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is $n$. There is only one entrance in Petya's house and the distribution of apartments is the following: the first floor contains $2$ apartments, every other floor contains $x$ apartments each. Apartments are numbered starting from one...
Vasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is $n$. There is only one entrance in Petya's house and the distribution of apartments is the following: the first floor contains $2$ apartments, every other floor contains $x$ apartments each. Apartments are numbered starting from one...
stdio
null
null
null
https://codeforces.com/problemset/problem/1426/A
[ "7\n6 3\n1 3\n18 6\n987 4\n12 2\n2 10\n22 12\n", "4\n8 3\n1 5\n11 5\n160 5\n", "7\n7 3\n2 4\n29 10\n987 3\n3 2\n2 13\n5 4\n", "7\n7 3\n1 5\n12 5\n987 13\n7 3\n1 5\n22 5\n", "7\n7 3\n2 4\n29 10\n1422 4\n3 2\n2 13\n5 4\n", "4\n3 3\n1 5\n32 7\n859 5\n", "7\n7 3\n1 5\n12 9\n987 6\n7 2\n1 5\n22 5\n", "7\n7...
[ "3\n1\n4\n248\n6\n1\n3\n", "3\n1\n3\n33\n", "3\n1\n4\n330\n2\n1\n2\n", "3\n1\n3\n77\n3\n1\n5\n", "3\n1\n4\n356\n2\n1\n2\n", "2\n1\n6\n173\n", "3\n1\n3\n166\n4\n1\n5\n", "3\n1\n4\n248\n2\n1\n2\n", "3\n1\n5\n77\n", "3\n1\n4\n248\n6\n1\n5\n", "3\n1\n6\n248\n3\n1\n3\n", "3\n1\n6\n125\n2\n1\n3\n", ...
104
2
3
taco:1820
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
A little boy Laurenty has been playing his favourite game Nota for quite a while and is now very hungry. The boy wants to make sausage and cheese sandwiches, but first, he needs to buy a sausage and some cheese. The town where Laurenty lives in is not large. The houses in it are located in two rows, n houses in each r...
A little boy Laurenty has been playing his favourite game Nota for quite a while and is now very hungry. The boy wants to make sausage and cheese sandwiches, but first, he needs to buy a sausage and some cheese. The town where Laurenty lives in is not large. The houses in it are located in two rows, n houses in each r...
stdio
null
null
null
https://codeforces.com/problemset/problem/586/B
[ "50\n31 80 40 85 12 38 30 97 51 18 45 81 56 82 91 94 95 13 26 93 98 35 44 69 98 39 83 77 38 68 13 71 80 41 21 80 81 17 88 46 61 67 65 49 29 55 37 74 88\n71 8 42 74 14 70 100 96 25 56 95 38 41 88 45 43 46 16 55 77 100 68 51 30 73 51 25 88 64 26 22 50 2 57 88 85 45 32 11 96 94 19 9 12 10 66 24 8 60\n46 55 55 95 50 96...
[ "4800\n", "4\n", "2189\n", "100\n", "4518\n", "204\n", "2186\n", "4447\n", "4265\n", "96\n", "18\n", "4675\n", "2602\n", "15\n", "204\n", "467\n", "4427\n", "4620\n", "4553\n", "96\n", "4754\n", "143\n", "4664\n", "13\n", "4518\n", "5\n", "3834\n", "96\n", "43...
172
0
3
taco:15418
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
The student council has a shared document file. Every day, some members of the student council write the sequence TMT (short for Towa Maji Tenshi) in it. However, one day, the members somehow entered the sequence into the document at the same time, creating a jumbled mess. Therefore, it is Suguru Doujima's task to fig...
The student council has a shared document file. Every day, some members of the student council write the sequence TMT (short for Towa Maji Tenshi) in it. However, one day, the members somehow entered the sequence into the document at the same time, creating a jumbled mess. Therefore, it is Suguru Doujima's task to fig...
stdio
null
null
null
https://codeforces.com/problemset/problem/1509/B
[ "5\n3\nTMT\n3\nTMT\n6\nTMTMTT\n6\nTMTTTT\n6\nTTMMTT\n", "5\n3\nTTM\n3\nMTT\n6\nMMTTTT\n6\nTMTTTT\n6\nTTTTMM\n", "5\n3\nTMT\n3\nMTT\n6\nTMTMTT\n6\nTTMTTT\n6\nMTMTTT\n", "5\n3\nTMT\n3\nTTM\n6\nMTTTMT\n6\nMTTTTT\n6\nMTTTMT\n", "5\n3\nTMT\n3\nMTT\n6\nTMTMTT\n6\nTTMTTT\n6\nTMTMTT\n", "5\n3\nTMT\n3\nTTM\n6\nTMT...
[ "YES\nYES\nYES\nNO\nYES\n", "NO\nNO\nNO\nNO\nNO\n", "YES\nNO\nYES\nNO\nNO\n", "YES\nNO\nNO\nNO\nNO\n", "YES\nNO\nYES\nNO\nYES\n", "YES\nNO\nNO\nNO\nNO\n", "YES\nNO\nNO\nNO\nYES\n", "YES\nNO\nYES\nNO\nYES\n", "NO\nNO\nNO\nNO\nNO\n", "YES\nNO\nYES\nNO\nNO\n", "NO\nNO\nYES\nNO\nYES\n", "NO\nNO\nY...
148
0
3
taco:16285
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and 'b' only. Vasya denotes beauty of the string as the maximum length of a substring (consecutive subsequence) consisting of equal letters. Vasya can change no more than k characters of the original string. W...
High school student Vasya got a string of length n as a birthday present. This string consists of letters 'a' and 'b' only. Vasya denotes beauty of the string as the maximum length of a substring (consecutive subsequence) consisting of equal letters. Vasya can change no more than k characters of the original string. W...
stdio
null
null
null
https://codeforces.com/problemset/problem/676/C
[ "100 15\naaaaaababaaaaaaaaaaaaaabaababaaaabaaaaaaaaaaaaaaaaabaaaaabaaaaaaaaaaaaaabaaaabaaaaaaaabaabaaaabaaaaa\n", "1 0\na\n", "100 8\naaaaaababbaaaaaaaaaaaaabaababaaaabaaaaaaaaaaaaaaaaabaaaaabaaaaaaaaaaaaaabaaaabaaaaaaaabaabaaaabaaaaa\n", "10 0\nbbbbbbbbbb\n", "100 2\naaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
[ "100\n", "1\n", "76\n", "10\n", "100\n", "8\n", "10\n", "76\n", "94\n", "10\n", "10\n", "31\n", "5\n", "59\n", "100\n", "100\n", "10\n", "76\n", "100\n", "100\n", "81\n", "4\n", "49\n", "9\n", "100\n", "93\n", "65\n", "4\n", "26\n", "3\n", "3\n", "8\n" ]
167
2
3
kod:Filter_79383_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
How can I find the first index of any of the characters in a string using Python?
How can I find the first index of any of the characters in a string using Python? Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standard library. Required callable signatures: def ...
pytest
from solution import find_first_index def test_find_first_index_char_present(): assert find_first_index('hello', 'o') == 4 assert find_first_index('hello', 'l') == 2 assert find_first_index('abcdefg', 'd') == 3 def test_find_first_index_char_not_present(): assert find_first_index('hello', 'z') == -1 ...
def find_first_index(s, chars):
['Qwen2.5-Coder-32B-Instruct_161282']
null
null
null
null
1
3
taco:14890
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
$n$ people gathered to hold a jury meeting of the upcoming competition, the $i$-th member of the jury came up with $a_i$ tasks, which they want to share with each other. First, the jury decides on the order which they will follow while describing the tasks. Let that be a permutation $p$ of numbers from $1$ to $n$ (an ...
$n$ people gathered to hold a jury meeting of the upcoming competition, the $i$-th member of the jury came up with $a_i$ tasks, which they want to share with each other. First, the jury decides on the order which they will follow while describing the tasks. Let that be a permutation $p$ of numbers from $1$ to $n$ (an ...
stdio
null
null
null
https://codeforces.com/problemset/problem/1569/C
[ "1\n74\n15 4 1 8 1 4 -1 5 9 1 6 3 1 16 2 1 3 6 7 4 1 6 8 9 21 4 0 6 6 4 22 1 8 7 0 1 6 6 4 1 8 9 16 4 10 5 9 2 20 10 0 5 3 8 1 7 7 0 2 10 2 4 8 4 6 9 2 4 9 8 1 11 3 0\n", "1\n3\n11 11 154\n", "1\n74\n9 4 1 8 1 4 0 5 9 1 6 3 1 16 1 2 3 6 7 4 1 6 8 9 16 4 0 6 6 4 22 5 8 7 3 1 6 6 4 9 10 9 12 4 10 5 7 2 20 10 0 1 ...
[ "210389544\n", "0\n", "0\n", "0\n", "645880462\n", "0\n", "0\n", "0\n", "0\n", "1\n6\n0\n540\n", "0\n", "420779088\n", "0\n", "0\n", "645880462\n", "645880462\n", "0\n", "0\n", "0\n", "0\n", "420779088\n", "0\n", "420779088\n", "0\n", "420779088\n", "420779088\n", ...
206
0
3
kod:Filter_40228_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Given two numbers x and y, write a Python program to find the maximum between x and y using bitwise operators.
Given two numbers x and y, write a Python program to find the maximum between x and y using bitwise operators. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standard library. Requi...
pytest
from solution import find_maximum def test_find_maximum_equal_numbers(): assert find_maximum(5, 5) == 5 def test_find_maximum_first_greater_second(): assert find_maximum(10, 2) == 10 def test_find_maximum_second_greater_first(): assert find_maximum(2, 10) == 10 def test_find_maximum_negative_numbers(): ...
def find_maximum(x, y):
['Qwen2-72B-Instruct_88031']
null
null
null
null
1
3
taco:243
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
The Little Elephant enjoys recursive functions. This time he enjoys the sorting function. Let a is a permutation of an integers from 1 to n, inclusive, and ai denotes the i-th element of the permutation. The Little Elephant's recursive function f(x), that sorts the first x permutation's elements, works as follows: ...
The Little Elephant enjoys recursive functions. This time he enjoys the sorting function. Let a is a permutation of an integers from 1 to n, inclusive, and ai denotes the i-th element of the permutation. The Little Elephant's recursive function f(x), that sorts the first x permutation's elements, works as follows: ...
stdio
null
null
null
https://codeforces.com/problemset/problem/221/A
[ "1001\n", "1\n", "110\n", "28\n", "642\n", "0011\n", "59\n", "243\n", "291\n", "278\n", "15\n", "971\n", "120\n", "001\n", "157\n", "750\n", "152\n", "69\n", "593\n", "40\n", "391\n", "154\n", "100\n", "999\n", "174\n", "73\n", "17\n", "52\n", "954\n", "101\...
[ "1001 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 10...
134
1
3
taco:18443
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
One very important person has a piece of paper in the form of a rectangle a × b. Also, he has n seals. Each seal leaves an impression on the paper in the form of a rectangle of the size x_{i} × y_{i}. Each impression must be parallel to the sides of the piece of paper (but seal can be rotated by 90 degrees). A very i...
One very important person has a piece of paper in the form of a rectangle a × b. Also, he has n seals. Each seal leaves an impression on the paper in the form of a rectangle of the size x_{i} × y_{i}. Each impression must be parallel to the sides of the piece of paper (but seal can be rotated by 90 degrees). A very i...
stdio
null
null
null
https://codeforces.com/problemset/problem/837/C
[ "30 100 101\n60 34\n29 82\n89 77\n39 1\n100 100\n82 12\n57 87\n93 43\n78 50\n38 55\n37 9\n67 5\n100 100\n100 100\n82 47\n3 71\n100 100\n19 26\n25 94\n89 5\n100 100\n32 1\n100 100\n56 3\n40 99\n100 100\n36 12\n100 000\n110 100\n100 100\n", "2 2 2\n1 2\n2 1\n", "5 9 7\n5 2\n6 9\n2 4\n7 7\n6 4\n", "2 0 4\n3 2\n6...
[ "10039\n", "4\n", "59\n", "0\n", "57\n", "4\n", "0\n", "50\n", "20\n", "0\n", "4452\n", "9\n", "34\n", "0\n", "0\n", "57\n", "0\n", "59\n", "60\n", "45\n", "50\n", "56\n", "0\n", "59\n", "14\n", "59\n", "6\n", "34\n", "40\n", "0\n", "29\n", "57\n" ]
194
3
3
taco:25168
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Alice guesses the strings that Bob made for her. At first, Bob came up with the secret string $a$ consisting of lowercase English letters. The string $a$ has a length of $2$ or more characters. Then, from string $a$ he builds a new string $b$ and offers Alice the string $b$ so that she can guess the string $a$. Bob b...
Alice guesses the strings that Bob made for her. At first, Bob came up with the secret string $a$ consisting of lowercase English letters. The string $a$ has a length of $2$ or more characters. Then, from string $a$ he builds a new string $b$ and offers Alice the string $b$ so that she can guess the string $a$. Bob b...
stdio
null
null
null
https://codeforces.com/problemset/problem/1367/A
[ "11\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nba\nbccddaaf\nzzzzzzzzzz\n", "1\nassaad\n", "4\nbaabba\nac\nbccddaaf\nzzzzzzzzzz\n", "2\ncaabba\nab\n", "6\nabbaac\nabbaac\nabbaac\nbc\naccddaaf\nzzzzzzzzzz\n", "2\nabbaab\nac\n", "2\ndaabba\nbc\n", "6\ncaabba\nabbaac\nabbaac\nac\ncc...
[ "abac\nabac\nabac\nabac\nabac\nabac\nabac\nabac\nba\nbcdaf\nzzzzzz\n", "asad\n", "baba\nac\nbcdaf\nzzzzzz\n", "caba\nab\n", "abac\nabac\nabac\nbc\nacdaf\nzzzzzz\n", "abab\nac\n", "daba\nbc\n", "caba\nabac\nabac\nac\nccdae\nzzzzzz\n", "dbaa\nae\n", "aaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\...
109
0
3
taco:14868
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. [Image] Initially, each hole has $a_i$ stones. When a player makes a move, he chooses a hole which contains a positive number of stones. He takes all the stones inside it and then redistributes these stones one by one in ...
Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. [Image] Initially, each hole has $a_i$ stones. When a player makes a move, he chooses a hole which contains a positive number of stones. He takes all the stones inside it and then redistributes these stones one by one in ...
stdio
null
null
null
https://codeforces.com/problemset/problem/975/B
[ "297857621 238127103 749085829 139033277 597985489 202617713 1366784327 117968155 278551059 297781685 330124279 338959601 682874531 259895291\n", "0 1 1 0 0 0 0 0 0 7 0 0 0 0\n", "282019717 66820979 167090989 609856495 953855615 569750143 9617937 255875779 645191029 572053369 290936613 338480779 879775193 17717...
[ "5305874892\n", "4\n", "5818497530\n", "0\n", "8055300400\n", "2\n", "9110\n", "5989883168\n", "55294\n", "2\n", "8134132178\n", "8139909016\n", "7526\n", "55294\n", "40\n", "2\n", "7021848216\n", "2\n", "4\n", "7635414974\n", "64332\n", "6979264674\n", "26\n", "54294\n...
124
0
3
taco:14731
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
medium
TACO medium
codeforces
$n$ robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerous! Fortunately, even though your robots have escaped, you still have some control over them. First of all, you know the loc...
$n$ robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerous! Fortunately, even though your robots have escaped, you still have some control over them. First of all, you know the loc...
stdio
null
null
null
https://codeforces.com/problemset/problem/1196/C
[ "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 0 0 1\n4 5 1 0 0 1\n2\n754 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 2 1\n", "4\n2\n-1 -2 0 0 0 0\n0 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 1 0 1\n3 5 0 0 0 0\n2\n1337 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 0 1\n", "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\...
[ "1 -1 -2\n1 2 -100000\n1 754 -100000\n1 -100000 -100000\n", "0\n0\n0\n1 -100000 -100000\n", "1 -1 -2\n1 2 5\n0\n1 -100000 -100000\n", "0\n1 2 5\n0\n1 -100000 -100000\n", "1 -1 -2\n1 2 5\n0\n1 -100000 -100000\n", "0\n0\n0\n1 -100000 -100000\n", "1 -1 -2\n1 2 5\n0\n1 -100000 -100000\n", "1 -1 -2\n1 2 5\...
96
0
3
kod:Filter_47393_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
easy
KodCode easy
Filter
Write a python script that can determine if a given number is a prime number or not. The script should be efficient and concise.
Write a python script that can determine if a given number is a prime number or not. The script should be efficient and concise. Implement the required callable(s) in Python 3. Preserve the requested names and signatures. Provide the complete contents of solution.py in one fenced Python code block. Use only the standa...
pytest
from solution import is_prime def test_small_numbers(): assert is_prime(2) == True assert is_prime(3) == True assert is_prime(4) == False assert is_prime(1) == False assert is_prime(0) == False assert is_prime(-1) == False def test_large_prime(): assert is_prime(101) == True assert is_...
def is_prime(n):
['Qwen2.5-72B-Instruct_100138']
null
null
null
null
3
3
taco:8914
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
The R1 company has recently bought a high rise building in the centre of Moscow for its main office. It's time to decorate the new office, and the first thing to do is to write the company's slogan above the main entrance to the building. The slogan of the company consists of n characters, so the decorators hung a lar...
The R1 company has recently bought a high rise building in the centre of Moscow for its main office. It's time to decorate the new office, and the first thing to do is to write the company's slogan above the main entrance to the building. The slogan of the company consists of n characters, so the decorators hung a lar...
stdio
null
null
null
https://codeforces.com/problemset/problem/412/A
[ "100 50\n5B2N,CXCWOIWH71XV!HCFEUCN3U88JDRIFRO2VHY?!N.RGH.?W14X5S.Y00RIY6YA19BPD0T,WECXYI,O2RF1U4NX9,F5AVLPOYK\n", "1 1\n!\n", "88 30\n5847857685475132927321580125243001071762130696139249809763381765504146602574972381323476\n", "5 1\nIP4!N\n", "100 34\n!X85PT!WJDNS9KA6D2SJBR,U,G7M914W07EK3EAJ4XG..UHA3KOOFYJ?...
[ "LEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nPRINT 5\nRIGHT\nPRINT...
120
0
3
taco:20071
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
You are given a sequence a consisting of n integers. You may partition this sequence into two sequences b and c in such a way that every element belongs exactly to one of these sequences. Let B be the sum of elements belonging to b, and C be the sum of elements belonging to c (if some of these sequences is empty, the...
You are given a sequence a consisting of n integers. You may partition this sequence into two sequences b and c in such a way that every element belongs exactly to one of these sequences. Let B be the sum of elements belonging to b, and C be the sum of elements belonging to c (if some of these sequences is empty, the...
stdio
null
null
null
https://codeforces.com/problemset/problem/946/A
[ "100\n-100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -111 -100 -100 -100 -100 -100 -100 -100 -100 ...
[ "10011\n", "1\n", "30\n", "6\n", "152\n", "79\n", "3\n", "242\n", "91\n", "452\n", "3\n", "5\n", "8\n", "2\n", "8\n", "9\n", "21\n", "4343\n", "157\n", "311\n", "13\n", "5\n", "9\n", "779\n", "103\n", "500\n", "2\n", "15\n", "10\n", "303\n", "3840\n", "7...
240
1
3
kod:Filter_17180_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Filter
### Context You have been tasked with creating a system that can evaluate the expressions contained within a string. The string will contain spaces and can have nested parentheses to group numbers and operators. ### Problem Write a code that can parse the string and evaluate the mathematical expression given. ### R...
### Context You have been tasked with creating a system that can evaluate the expressions contained within a string. The string will contain spaces and can have nested parentheses to group numbers and operators. ### Problem Write a code that can parse the string and evaluate the mathematical expression given. ### R...
pytest
from solution import calculate def test_simple_addition(): assert calculate("1 + 1") == 2.0 def test_simple_subtraction(): assert calculate("5 - 2") == 3.0 def test_simple_multiplication(): assert calculate("3 * 4") == 12.0 def test_simple_division(): assert calculate("10 / 2") == 5.0 def test_comb...
def calculate(expression):
['Llama-3.3-70B-Instruct_43706']
null
null
null
null
2
3
taco:12282
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
Suppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a classroom, you surprisingly find that many seats there are already occupied. Today you and your friends went for class, and found out that some of the seats were occupied. The classroom contains $n$ rows of seat...
Suppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a classroom, you surprisingly find that many seats there are already occupied. Today you and your friends went for class, and found out that some of the seats were occupied. The classroom contains $n$ rows of seat...
stdio
null
null
null
https://codeforces.com/problemset/problem/919/C
[ "5 5 3\n.....\n.....\n*...*\n....*\n.*...\n", "1 1 1\n.\n", "3 3 1\n.*.\n.**\n..*\n", "2 2 2\n.*\n*.\n", "3 3 3\n..*\n*.*\n..*\n", "1 1 1859\n*\n", "2 3 4\n...\n...\n", "3 3 6\n*..\n.**\n.*.\n", "1 1 1511\n*\n", "1 3 7\n.*.\n.**\n.+.\n", "3 3 6\n.*.\n**.\n*..\n", "4 4 2\n....\n....\n....\n.......
[ "18\n", "1\n", "5\n", "0\n", "1\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "24\n", "0\n", "1\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "7\n", "2\n", "0\n", "0\n", "0\n", "0\n", "0\n", "18\n", "0\n" ]
101
0
3
kod:Data_Structure_39724_I
train
KodCode/KodCode-Light-RL-10K
dcf78a8bbba9a613b596ce993c4921a38687dfcc
medium
KodCode medium
Data_Structure
### Pathfinding with Weighted Graphs #### Scenario: You are working on a navigation system that needs to compute the optimal route between locations on a weighted graph. Each location is a node, and each route between locations has a specific travel cost. The goal is to find not only a path but the most cost-effective...
### Pathfinding with Weighted Graphs #### Scenario: You are working on a navigation system that needs to compute the optimal route between locations on a weighted graph. Each location is a node, and each route between locations has a specific travel cost. The goal is to find not only a path but the most cost-effective...
pytest
from solution import find_lowest_cost_path def test_find_lowest_cost_path_simple(): graph = { 'A': [('B', 1), ('C', 4)], 'B': [('C', 2), ('D', 5)], 'C': [('D', 1)], 'D': [] } assert find_lowest_cost_path(graph, 'A', 'D') == ['A', 'B', 'C', 'D'] def test_find_lowest_cost_pat...
def find_lowest_cost_path(graph, start, end):
[242]
null
null
null
null
2
3
taco:14956
train
likaixin/TACO-verified
9e68575e01938f016199eda6f07d1a7ce96b35e1
easy
TACO easy
codeforces
There are five people playing a game called "Generosity". Each person gives some non-zero number of coins b as an initial bet. After all players make their bets of b coins, the following operation is repeated for several times: a coin is passed from one player to some other player. Your task is to write a program that...
There are five people playing a game called "Generosity". Each person gives some non-zero number of coins b as an initial bet. After all players make their bets of b coins, the following operation is repeated for several times: a coin is passed from one player to some other player. Your task is to write a program that...
stdio
null
null
null
https://codeforces.com/problemset/problem/478/A
[ "203 100 101 000 101\n", "2 5 4 0 4\n", "43 127 2 0 23\n", "56 0 0 0 4\n", "99 82 156 99 001\n", "0 5 4 0 4\n", "-2 5 1 0 8\n", "93 100 99 67 98\n", "43 79 1 0 23\n", "0 1 0 0 2\n", "011 -2 0 0 1\n", "0 1 1 0 1\n", "1 3 0 0 1\n", "4 3 4 5 6\n", "1 1 1 1 1\n", "-1 5 1 0 4\n", "156 38 ...
[ "101\n", "3\n", "39\n", "12\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "2\n", "-1\n", "1\n", "-1\n", "1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "2\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "-1\n", "100\n", "-1\n", "-1\n", "20\n" ]
138
2
3