Dataset Viewer
Auto-converted to Parquet Duplicate
name
stringlengths
2
112
description
stringlengths
29
13k
public_tests
dict
private_tests
dict
generated_tests
dict
source
class label
5 classes
difficulty
class label
24 classes
solutions
dict
incorrect_solutions
dict
cf_contest_id
int64
0
1.55k
cf_index
stringclasses
50 values
cf_points
float32
0
5k
cf_rating
int32
0
3.5k
cf_tags
listlengths
0
11
is_description_translated
bool
2 classes
untranslated_description
stringlengths
0
5k
time_limit
dict
memory_limit_bytes
int64
0
1.07B
input_file
stringclasses
2 values
output_file
stringclasses
2 values
data_source
stringclasses
1 value
prompt
listlengths
1
1
raw_prompt
stringlengths
29
13k
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
brcktsrm
Problem description. Vipul is a hardworking super-hero who maintains the bracket ratio of all the strings in the world. Recently he indulged himself in saving the string population so much that he lost his ability for checking brackets (luckily, not permanently ).Being his super-hero friend help him in his time of hard...
{ "input": [ "3\n((()))\n(())()\n()(()" ], "output": [ "YES\nYES\nNO" ] }
{ "input": [], "output": [] }
{ "input": [ "3\n((()))\n(())()\n()())", "3\n((()()\n(())()\n()(()", "3\n((()))\n(())))\n()())", "3\n)))(((\n(())))\n()())", "3\n((()))\n(())()\n))(((", "3\n((()()\n(())()\n()(((", "3\n((()))\n(())()\n()()(", "3\n((()()\n'())()\n()(((", "3\n)))(((\n(())))\n()(*)", "3\n)(()()\n'...
1CODECHEF
6EXTERNAL
{ "language": [ 1, 1, 1 ], "solution": [ "for _ in range(input()):\n try:\n eval(raw_input())\n print 'YES'\n except TypeError:\n print 'YES'\n except:\n print 'NO'", "for _ in range(input()):\n ins = raw_input().strip()\n stck = []\n res = \"YES\"...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: Problem description.\nVipul is a hardworking super-hero who maintains the bracket ratio of all the strings in the world. Recently he ind...
Problem description. Vipul is a hardworking super-hero who maintains the bracket ratio of all the strings in the world. Recently he indulged himself in saving the string population so much that he lost his ability for checking brackets (luckily, not permanently ).Being his super-hero friend help him in his time of hard...
code
{ "ground_truth": "{\"inputs\": [\"3\\n((()))\\n(())()\\n()(()\", \"3\\n((()))\\n(())()\\n()())\", \"3\\n((()()\\n(())()\\n()(()\", \"3\\n((()))\\n(())))\\n()())\", \"3\\n)))(((\\n(())))\\n()())\", \"3\\n((()))\\n(())()\\n))(((\", \"3\\n((()()\\n(())()\\n()(((\", \"3\\n((()))\\n(())()\\n()()(\", \"3\\n((()()\\n'())()...
{ "cf_rating": 0, "difficulty": 6, "index": 0, "name": "brcktsrm", "num_test_cases": 10, "source": 1, "split": "train" }
comm3
The Chef likes to stay in touch with his staff. So, the Chef, the head server, and the sous-chef all carry two-way transceivers so they can stay in constant contact. Of course, these transceivers have a limited range so if two are too far apart, they cannot communicate directly. The Chef invested in top-of-the-line t...
{ "input": [ "3\n1\n0 1\n0 0\n1 0\n2\n0 1\n0 0\n1 0\n2\n0 0\n0 2\n2 1" ], "output": [ "yes\nyes\nno\n" ] }
{ "input": [], "output": [] }
{ "input": [ "3\n1\n0 1\n0 -1\n1 0\n2\n0 1\n0 0\n1 0\n2\n0 0\n0 2\n2 1", "3\n2\n0 1\n0 -1\n1 0\n2\n0 1\n0 0\n1 0\n2\n0 0\n0 2\n2 1", "3\n2\n0 -1\n0 -1\n1 0\n2\n0 0\n0 0\n1 0\n2\n1 0\n1 2\n2 1", "3\n2\n0 -1\n-1 -1\n2 0\n2\n1 0\n0 -1\n1 -1\n2\n1 0\n1 2\n1 1", "3\n2\n0 -1\n0 -1\n2 0\n2\n2 0\n0 -1\n1 ...
1CODECHEF
1EASY
{ "language": [ 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, 1, 1, 1, 1, 1, ...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: The Chef likes to stay in touch with his staff. So, the Chef, the head server, and the sous-chef all carry two-way transceivers so they ...
The Chef likes to stay in touch with his staff. So, the Chef, the head server, and the sous-chef all carry two-way transceivers so they can stay in constant contact. Of course, these transceivers have a limited range so if two are too far apart, they cannot communicate directly. The Chef invested in top-of-the-line t...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1\\n0 1\\n0 0\\n1 0\\n2\\n0 1\\n0 0\\n1 0\\n2\\n0 0\\n0 2\\n2 1\", \"3\\n1\\n0 1\\n0 -1\\n1 0\\n2\\n0 1\\n0 0\\n1 0\\n2\\n0 0\\n0 2\\n2 1\", \"3\\n2\\n0 1\\n0 -1\\n1 0\\n2\\n0 1\\n0 0\\n1 0\\n2\\n0 0\\n0 2\\n2 1\", \"3\\n2\\n0 -1\\n0 -1\\n1 0\\n2\\n0 0\\n0 0\\n1 0\\n2\\n1 0\\n1 ...
{ "cf_rating": 0, "difficulty": 1, "index": 1, "name": "comm3", "num_test_cases": 10, "source": 1, "split": "train" }
gcd2
Frank explained its friend Felman the algorithm of Euclides to calculate the GCD of two numbers. Then Felman implements it algorithm int gcd(int a, int b) { if (b==0) return a; else return gcd(b,a%b); } and it proposes to Frank that makes it but with a little integer and another integer that has up to 250 d...
{ "input": [ "2\n2 6\n10 11" ], "output": [ "2\n1\n" ] }
{ "input": [], "output": [] }
{ "input": [ "2\n3 6\n10 11", "2\n1 3\n10 11", "2\n0 6\n10 11", "2\n0 6\n0 11", "2\n3 6\n8 22", "2\n3 6\n8 4", "2\n5 2\n10 2", "2\n4 10\n8 6", "2\n7 14\n8 6", "2\n7 14\n8 4", "2\n2 6\n5 2", "2\n0 14\n16 2", "2\n0 11\n10 1", "2\n0 14\n16 1", "2\n1 3\n10 5", ...
1CODECHEF
2MEDIUM
{ "language": [ 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, 1, 1, 1, 1, 1, ...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: Frank explained its friend Felman the algorithm of Euclides to calculate the GCD \nof two numbers. Then Felman implements it algorithm \...
Frank explained its friend Felman the algorithm of Euclides to calculate the GCD of two numbers. Then Felman implements it algorithm int gcd(int a, int b) { if (b==0) return a; else return gcd(b,a%b); } and it proposes to Frank that makes it but with a little integer and another integer that has up to 250 d...
code
{ "ground_truth": "{\"inputs\": [\"2\\n2 6\\n10 11\", \"2\\n3 6\\n10 11\", \"2\\n1 3\\n10 11\", \"2\\n0 6\\n10 11\", \"2\\n0 6\\n0 11\", \"2\\n3 6\\n8 22\", \"2\\n3 6\\n8 4\", \"2\\n5 2\\n10 2\", \"2\\n4 10\\n8 6\", \"2\\n7 14\\n8 6\"], \"outputs\": [\"2\\n1\\n\", \"3\\n1\\n\", \"1\\n1\\n\", \"6\\n1\\n\", \"6\\n11\\n...
{ "cf_rating": 0, "difficulty": 2, "index": 2, "name": "gcd2", "num_test_cases": 10, "source": 1, "split": "train" }
luckybal
A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7. The Little Elephant calls some string T of the length M balanced if there exists at least one integer X (1 ≤ X ≤ M) such that the number of digits 4 in the substring T[1, X - 1] is equal to the n...
{ "input": [ "4\n47\n74\n477\n4747477" ], "output": [ "2\n2\n3\n23\n" ] }
{ "input": [], "output": [] }
{ "input": [ "4\n47\n47\n477\n4747477", "4\n7\n47\n477\n4747477", "4\n4\n47\n477\n4747477", "4\n7\n7\n477\n4747477", "4\n7\n44\n477\n4747477", "4\n44\n74\n477\n4747477", "4\n7\n44\n7\n4747477", "4\n47\n44\n477\n4747477", "4\n47\n4\n477\n4747477", "4\n7\n7\n447\n4747477", "4...
1CODECHEF
2MEDIUM
{ "language": [ 1, 1, 1, 1, 1 ], "solution": [ "n = input()\nfor i in range(n):\n str = raw_input()\n l = len(str)\n megacounter = 0\n counter = 0\n i = 0\n while(1):\n while(i<l and str[i]=='7'):\n i=i+1\n counter=counter+1\n if(i>=l):...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7.\nThe Little...
A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7. The Little Elephant calls some string T of the length M balanced if there exists at least one integer X (1 ≤ X ≤ M) such that the number of digits 4 in the substring T[1, X - 1] is equal to the n...
code
{ "ground_truth": "{\"inputs\": [\"4\\n47\\n74\\n477\\n4747477\", \"4\\n47\\n47\\n477\\n4747477\", \"4\\n7\\n47\\n477\\n4747477\", \"4\\n4\\n47\\n477\\n4747477\", \"4\\n7\\n7\\n477\\n4747477\", \"4\\n7\\n44\\n477\\n4747477\", \"4\\n44\\n74\\n477\\n4747477\", \"4\\n7\\n44\\n7\\n4747477\", \"4\\n47\\n44\\n477\\n4747477...
{ "cf_rating": 0, "difficulty": 2, "index": 3, "name": "luckybal", "num_test_cases": 10, "source": 1, "split": "train" }
prpaln
Given a string s. Can you make it a palindrome by deleting exactly one character? Note that size of the string after deletion would be one less than it was before. Input First line of the input contains a single integer T denoting number of test cases. For each test case, you are given a single line containing string...
{ "input": [ "4\naaa\nabc\nabdbca\nabba" ], "output": [ "YES\nNO\nYES\nYES\n" ] }
{ "input": [], "output": [] }
{ "input": [ "4\naaa\nabc\nabdbca\nabca", "4\naaa\nabc\nabdbc`\naaca", "4\naab\nacc\n`bd`cb\naaad", "4\nbaa\nabc\n`bd`bb\naabd", "4\nbab\nabb\nbb`db`\naabd", "4\nbaa\n`aa\nbb`c`b\ndba`", "4\nba`\n`aa\nbb`c_c\ndba`", "4\n`a_\naa`\ndda`^c\nca^a", "4\n_c`\n]`_\ncdad^`\n`c_^", "4\n...
1CODECHEF
2MEDIUM
{ "language": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], "solution": [ "import math\nimport sys\ndef checkpal(s):\n return s==s[::-1]\nfor a in range(input()):\n s=raw_input()\n l=len(s)\n if(l==2):\n print \"YES\"\n else:\n if chec...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: Given a string s. Can you make it a palindrome by deleting exactly one character? Note that size of the string after deletion would be o...
Given a string s. Can you make it a palindrome by deleting exactly one character? Note that size of the string after deletion would be one less than it was before. Input First line of the input contains a single integer T denoting number of test cases. For each test case, you are given a single line containing string...
code
{ "ground_truth": "{\"inputs\": [\"4\\naaa\\nabc\\nabdbca\\nabba\", \"4\\naaa\\nabc\\nabdbca\\nabca\", \"4\\naaa\\nabc\\nabdbc`\\naaca\", \"4\\naab\\nacc\\n`bd`cb\\naaad\", \"4\\nbaa\\nabc\\n`bd`bb\\naabd\", \"4\\nbab\\nabb\\nbb`db`\\naabd\", \"4\\nbaa\\n`aa\\nbb`c`b\\ndba`\", \"4\\nba`\\n`aa\\nbb`c_c\\ndba`\", \"4\\...
{ "cf_rating": 0, "difficulty": 2, "index": 4, "name": "prpaln", "num_test_cases": 10, "source": 1, "split": "train" }
tf01
An established group of scientists are working on finding solution to NP hard problems. They claim Subset Sum as an NP-hard problem. The problem is to determine whether there exists a subset of a given set S whose sum is a given number K. You are a computer engineer and you claim to solve this problem given that all...
{ "input": [ "2\n5 10\n3 4 6 1 9\n3 2\n1 3 4" ], "output": [ "1\n0" ] }
{ "input": [], "output": [] }
{ "input": [], "output": [] }
1CODECHEF
6EXTERNAL
{ "language": [ 1 ], "solution": [ "import sys\n\nfor __ in range(input()) :\n n , k = map(int,sys.stdin.readline().split())\n lists = map(int,sys.stdin.readline().split())\n dp = [0]*(k+1)\n dp[0]=1\n for i in lists :\n for j in range(k-i,-1,-1) :\n if dp[k] :\n ...
{ "language": [], "solution": [] }
0
0
0
[]
false
null
0
codecontests
[ { "content": "You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuestion: An established group of scientists are working on finding solution to NP hard problems. They claim Subset Sum as an NP-hard problem. Th...
An established group of scientists are working on finding solution to NP hard problems. They claim Subset Sum as an NP-hard problem. The problem is to determine whether there exists a subset of a given set S whose sum is a given number K. You are a computer engineer and you claim to solve this problem given that all...
code
{ "ground_truth": "{\"inputs\": [\"2\\n5 10\\n3 4 6 1 9\\n3 2\\n1 3 4\"], \"outputs\": [\"1\\n0\"], \"fn_name\": null}", "style": "rule" }
{ "cf_rating": 0, "difficulty": 6, "index": 5, "name": "tf01", "num_test_cases": 1, "source": 1, "split": "train" }
1012_E. Cycle sort
"You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following ope(...TRUNCATED)
{"input":["5 5\n3 2 3 1 1\n","4 3\n2 1 4 3\n","2 0\n2 2\n"],"output":["1\n5\n1 4 2 3 5 \n","-1\n","0(...TRUNCATED)
{"input":["5 0\n884430748 884430748 708433020 708433020 708433020\n","2 1\n1 1\n","2 0\n2 1\n","5 2\(...TRUNCATED)
{"input":["5 0\n884430748 884430748 182474629 708433020 708433020\n","5 2\n65390026 1454694739 65390(...TRUNCATED)
2CODEFORCES
11E
{"language":[2,2,2,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,2,2,2,2,2,2,2,2,2,2(...TRUNCATED)
{"language":[2,2,2,4,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,2,4,4,2,2,2,2,2,4,2,2(...TRUNCATED)
1,012
E
2,500
3,100
[ "dsu", "math" ]
false
{ "seconds": 2, "nanos": 0 }
256,000,000
codecontests
[{"content":"You will be given a question (problem specification) and will generate a correct Python(...TRUNCATED)
"You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following ope(...TRUNCATED)
code
{"ground_truth":"{\"inputs\": [\"5 5\\n3 2 3 1 1\\n\", \"4 3\\n2 1 4 3\\n\", \"2 0\\n2 2\\n\", \"5 0(...TRUNCATED)
{"cf_rating":3100,"difficulty":11,"index":6,"name":"1012_E. Cycle sort","num_test_cases":10,"source"(...TRUNCATED)
1037_E. Trips
"There are n persons who initially don't know each other. On each morning, two of them, who were not(...TRUNCATED)
{"input":["4 4 2\n2 3\n1 2\n1 3\n1 4\n","5 8 2\n2 1\n4 2\n5 4\n5 2\n4 3\n5 1\n4 1\n3 2\n","5 7 2\n1 (...TRUNCATED)
{"input":["16 20 2\n10 3\n5 3\n10 5\n12 7\n7 6\n9 12\n9 6\n1 10\n11 16\n11 1\n16 2\n10 2\n14 4\n15 1(...TRUNCATED)
{"input":["16 20 2\n10 3\n5 3\n10 5\n12 7\n7 6\n9 10\n9 6\n1 10\n11 16\n11 1\n16 2\n10 2\n14 4\n15 1(...TRUNCATED)
2CODEFORCES
11E
{"language":[2,2,2,4,4,2,2,2,2,2,4,2,2,2,4,2,4,2,4,4,2,4,2,4,2,2,4,2,2,2,4,2,2,4,4,4,2,4,2,4,4,1,4,4(...TRUNCATED)
{"language":[2,2,2,2,4,2,2,4,4,2,2,2,2,4,2,4,2,2,2,4,2,2,2,3,2,2,2,2,2,2,4,2,2,4,2,2,2,4,2,2,2,2,2,2(...TRUNCATED)
1,037
E
2,250
2,200
[ "graphs" ]
false
{ "seconds": 2, "nanos": 0 }
256,000,000
codecontests
[{"content":"You will be given a question (problem specification) and will generate a correct Python(...TRUNCATED)
"There are n persons who initially don't know each other. On each morning, two of them, who were not(...TRUNCATED)
code
{"ground_truth":"{\"inputs\": [\"4 4 2\\n2 3\\n1 2\\n1 3\\n1 4\\n\", \"5 8 2\\n2 1\\n4 2\\n5 4\\n5 2(...TRUNCATED)
{"cf_rating":2200,"difficulty":11,"index":7,"name":"1037_E. Trips","num_test_cases":10,"source":2,"s(...TRUNCATED)
1060_A. Phone Numbers
"Let's call a string a phone number if it has length 11 and fits the pattern \"8xxxxxxxxxx\", where (...TRUNCATED)
{"input":["22\n0011223344556677889988\n","11\n00000000008\n","11\n31415926535\n"],"output":["2\n","1(...TRUNCATED)
{"input":["51\n882889888888689888850888388887688788888888888858888\n","55\n7271714707719515303911625(...TRUNCATED)
{"input":["51\n1732111733638718702525811518175029394157760329139501\n","55\n815096522892298714932212(...TRUNCATED)
2CODEFORCES
7A
{"language":[3,2,3,1,2,3,3,3,4,4,2,3,1,2,3,1,3,1,1,3,4,3,4,2,3,2,4,3,3,1,2,3,3,2,3,1,3,1,2,4,3,3,4,3(...TRUNCATED)
{"language":[2,2,2,2,2,4,4,4,4,3,2,3,4,3,4,3,4,3,2,4,2,2,4,3,3,4,3,2,2,2,1,4,3,4,2,3,4,3,1,4,3,3,4,2(...TRUNCATED)
1,060
A
500
800
[ "brute force" ]
false
{ "seconds": 2, "nanos": 0 }
512,000,000
codecontests
[{"content":"You will be given a question (problem specification) and will generate a correct Python(...TRUNCATED)
"Let's call a string a phone number if it has length 11 and fits the pattern \"8xxxxxxxxxx\", where (...TRUNCATED)
code
{"ground_truth":"{\"inputs\": [\"22\\n0011223344556677889988\\n\", \"11\\n00000000008\\n\", \"11\\n3(...TRUNCATED)
{"cf_rating":800,"difficulty":7,"index":8,"name":"1060_A. Phone Numbers","num_test_cases":10,"source(...TRUNCATED)
1081_G. Mergesort Strikes Back
"Chouti thought about his very first days in competitive programming. When he had just learned to wr(...TRUNCATED)
{"input":["3 2 998244353\n","9 3 998244353\n","3 1 998244353\n","9 4 998244353\n"],"output":["665496(...TRUNCATED)
{"input":["53812 4 967428361\n","7 2 400166453\n","75727 16 485722667\n","65536 10 802338989\n","655(...TRUNCATED)
{"input":["53812 5 967428361\n","12 2 400166453\n","27203 10 802338989\n","59715 12 196344479\n","14(...TRUNCATED)
2CODEFORCES
13G
{"language":[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2(...TRUNCATED)
{"language":[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2(...TRUNCATED)
1,081
G
3,500
3,200
[ "math", "probabilities" ]
false
{ "seconds": 1, "nanos": 0 }
256,000,000
codecontests
[{"content":"You will be given a question (problem specification) and will generate a correct Python(...TRUNCATED)
"Chouti thought about his very first days in competitive programming. When he had just learned to wr(...TRUNCATED)
code
{"ground_truth":"{\"inputs\": [\"3 2 998244353\\n\", \"9 3 998244353\\n\", \"3 1 998244353\\n\", \"9(...TRUNCATED)
{"cf_rating":3200,"difficulty":13,"index":9,"name":"1081_G. Mergesort Strikes Back","num_test_cases"(...TRUNCATED)
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
27