data_source
stringclasses
4 values
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
taco
[ { "content": "Let's define a function, $\\mbox{f}$, on a string, $\\boldsymbol{p}$, of length $\\boldsymbol{l}$ as follows:\n\n$f(p)=(p_1\\cdot a^{l-1}+p_2\\cdot a^{l-2}+\\cdots+p_l\\cdot a^0)\\ \\text{mod}\\ m$\n\nwhere $p_i$ denotes the ASCII value of the $i^{\\mbox{th}}$ character in string $\\boldsymbol{p}$...
code
{ "ground_truth": "{\"inputs\": [\"5 5\\napple\\n1\\n2\\n3\\n4\\n5\\n\", \"6 3\\nabcabc\\n1000\\n2000\\n9500\\n\", \"10 1\\naabbccddaa\\n10000\\n\"], \"outputs\": [\"97\\n101\\n108\\n112\\n112\", \"-1\\n-1\\n-1\", \"-1\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Write a program which reads two integers x and y, and prints them in ascending order.\n\nConstraints\n\n* 0 ≤ x, y ≤ 10000\n* the number of datasets ≤ 3000\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.\n\nThe input e...
code
{ "ground_truth": "{\"inputs\": [\"3 2\\n2 2\\n5 3\\n0 0\", \"3 1\\n2 2\\n5 3\\n0 0\", \"3 1\\n2 2\\n9 3\\n0 0\", \"3 1\\n0 2\\n9 3\\n0 0\", \"3 0\\n0 2\\n9 3\\n0 0\", \"3 0\\n0 2\\n15 3\\n0 0\", \"3 0\\n-1 2\\n15 3\\n0 0\", \"3 0\\n-1 2\\n0 3\\n0 0\", \"3 2\\n2 2\\n5 6\\n0 0\", \"3 1\\n2 3\\n9 3\\n0 0\", \"3 0\\n0 2...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given string S and T consisting of lowercase English letters.\nDetermine if S equals T after rotation.\nThat is, determine if S equals T after the following operation is performed some number of times:\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\nHer...
code
{ "ground_truth": "{\"inputs\": [\"kyoto\\ntokyo\\n\", \"abc\\narc\\n\", \"aaaaaaaaaaaaaaab\\naaaaaaaaaaaaaaab\\n\", \"az\\nza\\n\", \"gxgpuamkx\\nkszhkbpph\\n\", \"kinkezplvf\\ninkezplvfk\\n\", \"qmopodotk\\nodotkqmpo\\n\", \"mlvumuarenexcfycebeurgvjyospdhvuyfvtvnrdyluacvrayggwnpnzijdifyervjaoalcg\\nxovldqfzaorahdig...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Consider a set of points A, initially it is empty. There are three types of queries: \n\n 1. Insert a point (x_i, y_i) to A. It is guaranteed that this point does not belong to A at this moment. \n 2. Remove a point (x_i, y_i) from A. It is guaranteed that this point belongs to A at this moment....
code
{ "ground_truth": "{\"inputs\": [\"6\\n1 1 2\\n3 1 1\\n1 1 1\\n3 2 2\\n2 1 1\\n3 2 4\\n\", \"12\\n1 1 6\\n1 6 1\\n1 5 5\\n1 2 3\\n3 4 4\\n1 3 2\\n3 7 7\\n2 2 3\\n2 6 1\\n3 8 8\\n2 5 5\\n3 1 1\\n\", \"1\\n3 100 99\\n\", \"1\\n3 000 99\\n\", \"12\\n1 1 2\\n1 6 1\\n1 5 5\\n1 2 3\\n3 4 4\\n1 3 2\\n3 7 7\\n2 2 3\\n2 6 1\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "During the \"Russian Code Cup\" programming competition, the testing system stores all sent solutions for each participant. We know that many participants use random numbers in their programs and are often sent several solutions with the same source code to check.\n\nEach participant is identified...
code
{ "ground_truth": "{\"inputs\": [\"2\\n0 1\\n1 1\\n\", \"4\\n0 1\\n1 2\\n1 1\\n0 2\\n\", \"4\\n0 1\\n1 1\\n0 1\\n0 2\\n\", \"5\\n0 1\\n1 1\\n2 1\\n0 1\\n4 1\\n\", \"3\\n0 1\\n0 1\\n2 1\\n\", \"4\\n0 1\\n0 2\\n1 1\\n1 2\\n\", \"6\\n0 1\\n1 1\\n2 1\\n3 1\\n4 1\\n2 1\\n\", \"7\\n0 2\\n0 3\\n0 2\\n0 1\\n0 10\\n1 10\\n0 5...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are n cows playing poker at a table. For the current betting phase, each player's status is either \"ALLIN\", \"IN\", or \"FOLDED\", and does not change throughout the phase. To increase the suspense, a player whose current status is not \"FOLDED\" may show his/her hand to the table. However...
code
{ "ground_truth": "{\"inputs\": [\"3\\nAFI\\n\", \"6\\nAFFAAA\\n\", \"2\\nFF\\n\", \"5\\nIIIIF\\n\", \"5\\nFAFFF\\n\", \"2\\nFA\\n\", \"3\\nAAA\\n\", \"5\\nFAIAF\\n\", \"5\\nAIFFF\\n\", \"3\\nFFF\\n\", \"3\\nFIF\\n\", \"3\\nIII\\n\", \"5\\nFAAII\\n\", \"2\\nIF\\n\", \"8\\nAFFFFIAF\\n\", \"5\\nIIIII\\n\", \"3\\nIAA\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Old MacDonald has a farm and a large potato field, (1010 + 1) × (1010 + 1) square meters in size. The field is divided into square garden beds, each bed takes up one square meter.\n\nOld McDonald knows that the Colorado potato beetle is about to invade his farm and can destroy the entire harvest. ...
code
{ "ground_truth": "{\"inputs\": [\"7\\nR 10\\nD 2\\nL 7\\nU 9\\nD 2\\nR 3\\nD 10\\n\", \"5\\nR 8\\nU 9\\nL 9\\nD 8\\nL 2\\n\", \"12\\nL 3\\nD 4\\nR 4\\nU 3\\nD 2\\nR 3\\nU 3\\nL 2\\nR 5\\nU 4\\nL 6\\nD 3\\n\", \"1\\nL 100500\\n\", \"10\\nU 369960\\nR 298468\\nL 963241\\nD 948752\\nR 912514\\nD 3082\\nL 111173\\nD 658...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: What is for dinner?\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nIn one little known, but very beautiful country called Waterland, lives a lovely shark Valerie. Like all the sharks, she has several rows of teeth, and feeds on crucians. One of Valerie's di...
code
{ "ground_truth": "{\"inputs\": [\"4 3 18\\n2 3\\n1 2\\n3 6\\n2 3\", \"2 2 13\\n1 13\\n2 12\", \"5 4 8\\n4 6\\n4 5\\n1 3\\n2 0\\n3 3\", \"1 1 0\\n1 3\", \"7 1 30\\n1 8\\n1 15\\n1 5\\n1 17\\n1 9\\n1 16\\n1 16\", \"4 2 8\\n1 9\\n1 10\\n1 4\\n2 6\", \"10 4 14\\n2 6\\n1 5\\n2 8\\n2 6\\n2 5\\n4 1\\n4 0\\n2 4\\n3 4\\n1 0\"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Polycarp's workday lasts exactly $n$ minutes. He loves chocolate bars and can eat one bar in one minute. Today Polycarp has $k$ bars at the beginning of the workday.\n\nIn some minutes of the workday Polycarp has important things to do and in such minutes he is not able to eat a chocolate bar. In ...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\n010\\n\", \"8 3\\n01010110\\n\", \"9 5\\n001100110\\n\", \"2 2\\n00\\n\", \"3 2\\n010\\n\", \"3 2\\n000\\n\", \"3 3\\n000\\n\", \"4 2\\n0000\\n\", \"4 2\\n0100\\n\", \"4 2\\n0010\\n\", \"4 2\\n0110\\n\", \"4 3\\n0000\\n\", \"4 3\\n0010\\n\", \"4 3\\n0100\\n\", \"4 3\\n0110\\n\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are planning to build housing on a street. There are n spots available on the street on which you can build a house. The spots are labeled from 1 to n from left to right. In each spot, you can build a house with an integer height between 0 and h.\n\nIn each spot, if a house has height a, you c...
code
{ "ground_truth": "{\"inputs\": [\"20 50 20\\n1 11 24 44\\n14 14 33 24\\n5 14 20 23\\n1 11 19 33\\n4 9 37 7\\n4 18 7 10\\n4 12 20 58\\n6 18 48 36\\n1 17 49 13\\n15 17 49 3\\n9 20 3 47\\n16 20 34 4\\n1 11 19 26\\n4 17 15 23\\n5 9 35 58\\n4 4 47 33\\n8 20 13 22\\n3 9 11 27\\n2 11 14 8\\n3 10 18 15\\n\", \"50 20 20\\n17...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let’s define a grid to be a set of tiles with 2 rows and 13 columns. Each tile has an English letter written in it. The letters don't have to be unique: there might be two or more tiles with the same letter written on them. Here is an example of a grid:\n \n \n ABCDEFGHIJKLM \n NOPQRS...
code
{ "ground_truth": "{\"inputs\": [\"BUVTYZFQSNRIWOXXGJLKACPEMDH\\n\", \"ABCDEFGHIJKLMNOPQRSGTUVWXYZ\\n\", \"MKBGVNDJRAWUEHFSYLIZCOPTXKQ\\n\", \"ABACDEFGHIJKLMNOPQRSTUVWXYZ\\n\", \"BACDEFGHIJKLMNOPQRSTUVWXYZA\\n\", \"BADSLHIYGMZJQKTCOPRVUXFWENN\\n\", \"HVDEBKMJTLKQORNWCZSGXYIPUAF\\n\", \"UNGHFQRCIPBZTEOAYJXLDMSKNWV\\n\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Borya's Diagnosis\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIt seems that Borya is seriously sick. He is going visit *n* doctors to find out the exact diagnosis. Each of the doctors needs the information about all previous visits, so Borya has to v...
code
{ "ground_truth": "{\"inputs\": [\"3\\n2 2\\n1 2\\n2 2\", \"2\\n10 1\\n6 5\", \"3\\n6 10\\n3 3\\n8 2\", \"4\\n4 8\\n10 10\\n4 2\\n8 2\", \"5\\n7 1\\n5 1\\n6 1\\n1 6\\n6 8\", \"6\\n1 3\\n2 5\\n4 7\\n7 5\\n6 8\\n8 8\", \"10\\n4 10\\n8 7\\n6 5\\n2 1\\n2 3\\n8 8\\n2 4\\n2 2\\n6 7\\n7 9\", \"1\\n1 1\", \"1\\n1000 1000\", ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let's define a function f(x) (x is a positive integer) as follows: write all digits of the decimal representation of x backwards, then get rid of the leading zeroes. For example, f(321) = 123, f(120) = 21, f(1000000) = 1, f(111) = 111.\n\nLet's define another function g(x) = (x)/(f(f(x))) (x is a ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n4\\n37\\n998244353\\n1000000007\\n12345678901337426966631415\\n\", \"1\\n10000000\\n\", \"1\\n1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\\n\", \"1\\n999999999999999999999999999999999999999999999999999999999999999999999999...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A chocolate bar has a rectangular shape and consists of n × m slices. In other words, a bar consists of n rows with m slices of chocolate in each row.\n\nEach slice of chocolate is known to weigh 1 gram. Your task is to determine for each of the q chocolate bars whether it is possible to obtain a ...
code
{ "ground_truth": "{\"inputs\": [\"2\\n3 3 4\\n4 4 7\\n\"], \"outputs\": [\"Yes\\nNo\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Marvolo Gaunt's Ring\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nProfessor Dumbledore is helping Harry destroy the Horcruxes. He went to Gaunt Shack as he suspected a Horcrux to be present there. He saw Marvolo Gaunt's Ring and identified it as a Hor...
code
{ "ground_truth": "{\"inputs\": [\"5 1 2 3\\n1 2 3 4 5\", \"5 1 2 -3\\n-1 -2 -3 -4 -5\", \"5 886327859 82309257 -68295239\\n-731225382 354766539 -48222231 -474691998 360965777\", \"4 -96405765 -495906217 625385006\\n-509961652 392159235 -577128498 -744548876\", \"43 959134961 -868367850 142426380\\n921743429 63959718...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The dragon's curve is a self-similar fractal which can be obtained by a recursive method. \n\nStarting with the string `D0 = 'Fa'`, at each step simultaneously perform the following operations:\n\n```\nreplace 'a' with: 'aRbFR'\nreplace 'b' with: 'LFaLb'\n```\n\nFor example (spaces added for more ...
code
{ "ground_truth": "{\"fn_name\": \"Dragon\", \"inputs\": [[\"a\"], [1.1], [-1]], \"outputs\": [[\"\"], [\"\"], [\"\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Chef is going to participate in a new quiz show: \"Who dares to be a millionaire?\"\nAccording to the rules of the game, contestants must answer N questions. The quiz being famous for its difficulty, each question has 26 candidate answers, but only one of which is correct. Answers are denoted by c...
code
{ "ground_truth": "{\"inputs\": [\"3\\n5\\nABCDE\\nEBCDA\\n0 10 20 30 40 50\\n4\\nCHEF\\nQUIZ\\n4 3 2 1 0\\n8\\nABBABAAB\\nABABABAB\\n100 100 100 100 100 100 100 100 100\", \"3\\n5\\nABCDE\\nEBCDA\\n0 8 20 30 40 50\\n4\\nCHEF\\nQUIZ\\n4 3 2 1 0\\n8\\nABBABAAB\\nABABABAB\\n100 100 100 100 100 100 100 100 100\", \"3\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let us consider a grid of squares with N rows and N columns. You want to put some domino pieces on this grid. Each domino piece covers two squares that have a common side. Each square can be covered by at most one piece.\n\nFor each row of the grid, let's define its quality as the number of domino...
code
{ "ground_truth": "{\"inputs\": [\"2\", \"6\", \"0\", \"3\", \"5\", \"4\", \"10\", \"13\", \"14\", \"11\", \"15\", \"7\", \"9\", \"8\", \"28\", \"36\", \"12\", \"17\", \"20\", \"26\", \"18\", \"30\", \"16\", \"47\", \"83\", \"111\", \"101\", \"100\", \"34\", \"110\", \"24\", \"59\", \"38\", \"25\", \"27\", \"29\", \"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Eli- 1 started a part-time job handing out leaflets for N seconds. Eli- 1 wants to hand out as many leaflets as possible with her special ability, Cloning. Eli- gen can perform two kinds of actions below.\n\n* Clone herself and generate Eli- (gen + 1) . (one Eli- gen (cloning) and one Eli- (gen + ...
code
{ "ground_truth": "{\"inputs\": [\"1\\n20 3\", \"1\\n200 1\", \"2\\n20 8\\n20 12\"], \"outputs\": [\"67\", \"148322100\", \"24\\n20\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Given a string s of length n and integer k (1 ≤ k ≤ n). The string s has a level x, if x is largest non-negative integer, such that it's possible to find in s:\n\n * x non-intersecting (non-overlapping) substrings of length k, \n * all characters of these x substrings are the same (i.e. each sub...
code
{ "ground_truth": "{\"inputs\": [\"4 2\\nabab\\n\", \"8 2\\naaacaabb\\n\", \"2 1\\nab\\n\", \"3 2\\nzzz\\n\", \"13 3\\nzzzzzzzzzoosd\\n\", \"4 4\\nzzzz\\n\", \"13 2\\nabbacadaeafag\\n\", \"5 1\\naaaaa\\n\", \"5 1\\nzzzzz\\n\", \"5 1\\naaabb\\n\", \"5 1\\naaaab\\n\", \"38 2\\nsssssssssssgggggggggzzsssaagttttttkdys\\n\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Alice and Bob have decided to play the game \"Rock, Paper, Scissors\". \n\nThe game consists of several rounds, each round is independent of each other. In each round, both players show one of the following things at the same time: rock, paper or scissors. If both players showed the same things th...
code
{ "ground_truth": "{\n \"inputs\": [\n \"2\\n0 1 1\\n1 1 0\\n\",\n \"15\\n5 5 5\\n5 5 5\\n\",\n \"3\\n0 0 3\\n3 0 0\\n\",\n \"686\\n479 178 29\\n11 145 530\\n\",\n \"319\\n10 53 256\\n182 103 34\\n\",\n \"47\\n14 21 12\\n30 9 8\\n\",\n \"94317\\n66277 24448 3592\\n3499 24653 66165\\n\",\n \"3...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "AquaMoon has n friends. They stand in a row from left to right, and the i-th friend from the left wears a T-shirt with a number a_i written on it. Each friend has a direction (left or right). In the beginning, the direction of each friend is right.\n\nAquaMoon can make some operations on friends. ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n4\\n4 3 2 5\\n4\\n3 3 2 2\\n5\\n1 2 3 5 4\\n\", \"1\\n64\\n8 7 7 2 4 9 3 7 9 4 7 10 6 7 6 4 9 9 10 2 2 2 10 3 8 9 3 1 5 10 6 5 7 4 3 5 7 10 7 5 8 4 5 7 10 7 10 8 2 3 8 10 1 3 8 3 9 2 9 2 5 10 5 5\\n\", \"1\\n2\\n4 3\\n\", \"1\\n5\\n1 1 1 3 2\\n\", \"2\\n6\\n3 2 3 2 3 2\\n6\\n1 1...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given n × m table. Each cell of the table is colored white or black. Find the number of non-empty sets of cells such that:\n\n All cells in a set have the same color. Every two cells in a set share row or column. \n\n\n-----Input-----\n\nThe first line of input contains integers n and m ...
code
{ "ground_truth": "{\n \"inputs\": [\n \"1 1\\n0\\n\",\n \"2 3\\n1 0 1\\n0 1 0\\n\",\n \"2 2\\n1 1\\n1 1\\n\",\n \"1 10\\n0 0 0 0 0 0 0 0 0 0\\n\",\n \"11 1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\",\n \"10 11\\n1 1 0 1 1 0 0 0 1 0 0\\n1 0 0 1 1 1 0 0 1 1 0\\n0 0 1 0 1 1 0 1 0 1 1\\n0 1 1 1 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Vectors have their directions and two vectors make an angle between them. Given a set of three-dimensional vectors, your task is to find the pair among them that makes the smallest angle.\n\n\n\nInput\n\nThe input is a sequence of datasets. A dataset specifies a set of three-dimensional vectors, s...
code
{ "ground_truth": "{\"inputs\": [\"4 0 2013 1124\\n1 1 1\\n2 2 2\\n2 1 1\\n1 2 1\\n2 100 131832453 129800231\\n42 0 46\\n42 40 46\\n0 100000 7004674 484521438\\n0 0 0 0\", \"4 0 2013 1124\\n1 1 1\\n2 2 2\\n3 1 1\\n1 2 1\\n2 100 131832453 129800231\\n42 0 46\\n42 40 48\\n0 100000 7004674 484521438\\n0 0 0 0\", \"4 0 2...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Second-Price Auction\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIn this problem we consider a special type of an auction, which is called the second-price auction. As in regular auction *n* bidders place a bid which is price a bidder ready to pay. T...
code
{ "ground_truth": "{\"inputs\": [\"2\\n5 7\", \"3\\n10 2 8\", \"6\\n3 8 2 9 4 14\", \"4\\n4707 7586 4221 5842\", \"5\\n3304 4227 4869 6937 6002\", \"6\\n5083 3289 7708 5362 9031 7458\", \"7\\n9038 6222 3392 1706 3778 1807 2657\", \"8\\n7062 2194 4481 3864 7470 1814 8091 733\", \"9\\n2678 5659 9199 2628 7906 7496 4524...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Four Divisors\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIf an integer *a* is divisible by another integer *b*, then *b* is called the divisor of *a*.\n\nFor example: 12 has positive 6 divisors. They are 1, 2, 3, 4, 6 and 12.\n\nLet’s define a funct...
code
{ "ground_truth": "{\"inputs\": [\"10\", \"20\", \"1\", \"27\", \"100\", \"1000\", \"10000\", \"100000\", \"1000000\", \"100000000\", \"1000000000\", \"10000000000\", \"100000000000\", \"353964\", \"437388\", \"553516\", \"636940\", \"753068\", \"803788\", \"24403439\", \"907519567\", \"790635695\", \"968719119\", \"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Description\nBlithchron is the annual cultural festival of IIT Gandhinagar. A popular event in Blithchron is Adrenaline - a treasure hunt. At a particular stage in Adrenaline, the contestants will come to a vault, whose combination can be deciphered only using the previous clue. The previous clue ...
code
{ "ground_truth": "{\"inputs\": [\"fcuk\\nffccuukk\", \"120\\n110022002200002200\", \"COW\\nCCOOWW\", \"a\\nbcd\", \"asdf\\naaaassssaaaassssddddffff\", \"a\\naaaaaaaaaa\"], \"outputs\": [\"8\", \"768\", \"16\", \"0\", \"64\", \"10\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Shichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\n-----Constraints-----\n - 1 ≤ X ≤ 9\n - X is ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n\", \"6\\n\", \"1\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"7\\n\", \"8\\n\", \"9\\n\"], \"outputs\": [\"YES\\n\", \"NO\\n\", \"NO\\n\", \"NO\\n\", \"YES\\n\", \"NO\\n\", \"YES\\n\", \"NO\\n\", \"NO\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Sherlock is given an array of $N$ integers ($A_0,A_1...A_{N-1}$ by Watson. Now Watson asks Sherlock how many different pairs of indices $\\boldsymbol{i}$ and $j$ exist such that $\\boldsymbol{i}$ is not equal to $j$ but $A_i$ is equal to $A_j$. \n\nThat is, Sherlock has to count the total numb...
code
{ "ground_truth": "{\"inputs\": [\"1\\n6\\n1 2 2 3 3 3\\n\"], \"outputs\": [\"8\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "In this problem your goal is to sort an array consisting of n integers in at most n swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps are performed consecutively, one after another.\n\nNote that in this problem you do not have to m...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n5 2 5 1 4\\n\",\n \"6\\n10 20 20 40 60 60\\n\",\n \"2\\n101 100\\n\",\n \"1\\n1000\\n\",\n \"2\\n1000000000 -1000000000\\n\",\n \"8\\n5 2 6 8 3 1 6 8\\n\",\n \"2\\n200000000 199999999\\n\",\n \"3\\n100000000 100000002 100000001\\n\",\n \"5\\n100...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Dreamoon is a big fan of the Codeforces contests.\n\nOne day, he claimed that he will collect all the places from 1 to 54 after two more rated contests. It's amazing!\n\nBased on this, you come up with the following problem:\n\nThere is a person who participated in n Codeforces rounds. His place i...
code
{ "ground_truth": "{\"inputs\": [\"5\\n6 2\\n3 1 1 5 7 10\\n1 100\\n100\\n11 1\\n1 1 1 1 1 1 1 1 1 1 1\\n1 1\\n1\\n4 57\\n80 60 40 20\\n\", \"1\\n5 2\\n3 4 5 6 7\\n\", \"1\\n6 1\\n1 3 4 5 6 7\\n\", \"1\\n4 3\\n4 5 6 7\\n\", \"1\\n4 1\\n1 3 4 5\\n\", \"1\\n1 1\\n2\\n\", \"1\\n5 1\\n1 3 4 6 6\\n\", \"1\\n3 3\\n4 5 6\\n...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Sereja and Brackets\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nSereja has a bracket sequence *s*1,<=*s*2,<=...,<=*s**n*, or, in other words, a string *s* of length *n*, consisting of characters \"(\" and \")\".\n\nSereja needs to answer *m* queries,...
code
{ "ground_truth": "{\"inputs\": [\"())(())(())(\\n7\\n1 1\\n2 3\\n1 2\\n1 12\\n8 12\\n5 11\\n2 10\", \"(((((()((((((((((()((()(((((\\n1\\n8 15\", \"((()((())(((((((((()(()(()(((((((((((((((()(()((((((((((((((()(((((((((((((((((((()(((\\n39\\n28 56\\n39 46\\n57 63\\n29 48\\n51 75\\n14 72\\n5 70\\n51 73\\n10 64\\n31 56...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Two semifinals have just been in the running tournament. Each semifinal had n participants. There are n participants advancing to the finals, they are chosen as follows: from each semifinal, we choose k people (0 ≤ 2k ≤ n) who showed the best result in their semifinals and all other places in the ...
code
{ "ground_truth": "{\"inputs\": [\"4\\n9840 9920\\n9860 9980\\n9930 10020\\n10040 10090\\n\", \"4\\n9900 9850\\n9940 9930\\n10000 10020\\n10060 10110\\n\", \"3\\n1 3\\n2 4\\n6 5\\n\", \"3\\n1 3\\n2 5\\n4 6\\n\", \"4\\n1 3\\n2 4\\n7 5\\n8 6\\n\", \"4\\n5 1\\n6 2\\n7 3\\n8 4\\n\", \"3\\n1 2\\n4 3\\n6 5\\n\", \"4\\n2 1\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Guess the Array\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThis is an interactive problem. You should use flush operation after each printed line. For example, in C++ you should use fflush(stdout), in Java you should use System.out.flush(), and in P...
code
{ "ground_truth": "{\"inputs\": [\"5\\n4 6 1 5 5\", \"3\\n1 1 1\", \"4\\n100 1 100 1\", \"10\\n9 5 10 7 4 4 8 5 10 5\", \"3\\n1 1 1\", \"3\\n100000 100000 100000\", \"3\\n91906 50782 19777\", \"15\\n5 10 10 7 7 6 4 6 8 10 8 4 10 9 4\", \"30\\n2 3 3 4 3 2 4 4 4 3 3 2 4 2 3 4 4 2 4 3 4 2 2 4 3 3 4 4 4 4\", \"35\\n4 2 2...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given $\\mbox{Q}$ queries. Each query consists of a single number $N$. You can perform any of the $2$ operations on $N$ in each move:\n\n1: If we take 2 integers $\\class{ML__boldsymbol}{\\boldsymbol{a}}$ and $\\boldsymbol{b}$ where $N=a\\times b$ $(a\\neq1$, $b\\neq1)$, then we can change...
code
{ "ground_truth": "{\"inputs\": [\"2\\n3\\n4\\n\"], \"outputs\": [\"3\\n3\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Ann has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a special ticket for m rides (she can buy it several times). It costs b rubles. Ann did the math; she will need to use subway n times. Help Ann, tell her what...
code
{ "ground_truth": "{\"inputs\": [\"5 2 2 3\\n\", \"6 2 1 2\\n\", \"6 4 1 3\\n\", \"1 1000 1 2\\n\", \"101 110 1 100\\n\", \"1000 3 1000 1000\\n\", \"100 8 10 1\\n\", \"477 2 16 14\\n\", \"9 3 3 10\\n\", \"1000 1 1000 1000\\n\", \"10 2 1 1\\n\", \"1000 2 1 1000\\n\", \"995 1 2 1\\n\", \"556 2 16 15\\n\", \"10 3 5 1\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given N positive integers a_1, a_2, ..., a_N.\n\nFor a non-negative integer m, let f(m) = (m\\ mod\\ a_1) + (m\\ mod\\ a_2) + ... + (m\\ mod\\ a_N).\n\nHere, X\\ mod\\ Y denotes the remainder of the division of X by Y.\n\nFind the maximum value of f.\n\nConstraints\n\n* All values in input...
code
{ "ground_truth": "{\"inputs\": [\"5\\n7 46 11 20 11\", \"7\\n994 518 941 851 647 2 581\", \"3\\n3 4 6\", \"5\\n7 46 11 17 11\", \"7\\n994 518 941 851 647 2 568\", \"3\\n3 1 6\", \"5\\n7 46 11 17 13\", \"7\\n994 518 941 523 647 2 568\", \"3\\n3 2 6\", \"5\\n7 13 11 17 13\", \"7\\n994 518 941 523 647 1 568\", \"3\\n3 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Count the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \\cdots, A_{N} and B_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:\n\n* A_i \\neq B_i, for every i such that 1\\leq i\\leq N.\n* A_i \\neq A_j and B_i \\neq B_j, for every (i...
code
{ "ground_truth": "{\"inputs\": [\"141421 356237\", \"2 2\", \"2 3\", \"1 2\", \"2 6\", \"0 2\", \"2 4\", \"1 4\", \"3 4\", \"141421 225813\", \"1 1\", \"1 6\", \"2 7\", \"82963 225813\", \"1 3\", \"1 8\", \"1 7\", \"61759 225813\", \"2 8\", \"85920 225813\", \"2 14\", \"3299 225813\", \"3 14\", \"3299 39455\", \"3 2...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1's, return 0.\nTwo 1's are adjacent if there are only 0's separating them (possibly no 0's). The distance between two 1's is the absolute d...
code
{ "ground_truth": "{\"fn_name\": \"binaryGap\", \"inputs\": [[22]], \"outputs\": [2]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Gabriel and Caterpillar\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe 9-th grade student Gabriel noticed a caterpillar on a tree when walking around in a forest after the classes. The caterpillar was on the height *h*1 cm from the ground. On the he...
code
{ "ground_truth": "{\"inputs\": [\"10 30\\n2 1\", \"10 13\\n1 1\", \"10 19\\n1 2\", \"1 50\\n5 4\", \"1 1000\\n2 1\", \"999 1000\\n1 1\", \"999 1000\\n1 1000\", \"1 1000\\n999 1\", \"1 1000\\n100 99\", \"500 509\\n1 1\", \"500 555\\n6 1\", \"1 100000\\n2 1\", \"99990 100000\\n1 1\", \"90000 100000\\n2 1\", \"10 10000...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "This is a very easy warm-up problem.\nYou are given a string. Your task is to determine whether number of occurrences of some character in the string is equal to the sum of the numbers of occurrences of other characters in the string. \n\nInput\nThe first line of the input contains an integer T d...
code
{ "ground_truth": "{\"inputs\": [\"4\\nacab\\nzzqzqq\\nabc\\nkklkwwww\", \"4\\nacab\\nzzqzqq\\ncba\\nkklkwwww\", \"4\\nacbb\\nzzqzqq\\ncba\\nkkmkwvww\", \"4\\ncbba\\nqrzqyz\\nbab\\nkllkxwvw\", \"4\\naccc\\nqrzqyz\\nbab\\nkklkxwvw\", \"4\\nabbb\\nzzqzqq\\ncba\\nkkmkwwww\", \"4\\ncbbb\\nqqzqyz\\nbab\\nkllkxwvw\", \"4\\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "-----Input-----\n\nThe input consists of a single string of uppercase letters A-Z. The length of the string is between 1 and 10 characters, inclusive.\n\n\n-----Output-----\n\nOutput \"YES\" or \"NO\".\n\n\n-----Examples-----\nInput\nNEAT\n\nOutput\nYES\n\nInput\nWORD\n\nOutput\nNO\n\nInput\nCODER...
code
{ "ground_truth": "{\"inputs\": [\"NEAT\\n\", \"WORD\\n\", \"CODER\\n\", \"APRILFOOL\\n\", \"AI\\n\", \"JUROR\\n\", \"YES\\n\", \"Q\\n\", \"PUG\\n\", \"SOURPUSS\\n\", \"CROUP\\n\", \"BURG\\n\", \"DODO\\n\", \"WET\\n\", \"MAYFLY\\n\", \"VITALIZE\\n\", \"KHAKI\\n\", \"WAXY\\n\", \"WEEVIL\\n\", \"THIAMINE\\n\", \"ALKALI...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Imagine that you are in a building that has exactly n floors. You can move between the floors in a lift. Let's number the floors from bottom to top with integers from 1 to n. Now you're on the floor number a. You are very bored, so you want to take the lift. Floor number b has a secret lab, the en...
code
{ "ground_truth": "{\"inputs\": [\"5 2 4 1\\n\", \"5 2 4 2\\n\", \"5 3 4 1\\n\", \"5000 2314 1234 5000\\n\", \"3 2 3 1\\n\", \"4988 3629 4106 4488\\n\", \"300 1 300 300\\n\", \"2 1 2 1\\n\", \"4999 1 2 4999\\n\", \"3999 2 10 5000\\n\", \"10 1 4 4999\\n\", \"22 9 18 3\\n\", \"10 1 10 2\\n\", \"5 3 2 2\\n\", \"50 5 2 5...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "As Kevin is in BigMan's house, suddenly a trap sends him onto a grid with n rows and m columns.\n\nBigMan's trap is configured by two arrays: an array a_1,a_2,…,a_n and an array b_1,b_2,…,b_m.\n\nIn the i-th row there is a heater which heats the row by a_i degrees, and in the j-th column there is ...
code
{ "ground_truth": "{\"inputs\": [\"5 5 1\\n1 3 2 3 1\\n1 3 2 3 1\\n5\\n\", \"3 3 2\\n1 2 2\\n2 1 2\\n3\\n4\\n\", \"5 5 2\\n2 1 11 1 2\\n2 1 11 1 2\\n12\\n13\\n\", \"1 1 1\\n1\\n2\\n3\\n\", \"10 10 10\\n2 8 6 1 2 7 6 9 2 8\\n4 9 4 3 5 2 9 3 7 3\\n8\\n8\\n8\\n20\\n1\\n14\\n13\\n20\\n2\\n1\\n\", \"5 5 2\\n2 1 11 1 2\\n2...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "In this problem we consider a special type of an auction, which is called the second-price auction. As in regular auction n bidders place a bid which is price a bidder ready to pay. The auction is closed, that is, each bidder secretly informs the organizer of the auction price he is willing to pay...
code
{ "ground_truth": "{\"inputs\": [\"6\\n3 8 2 9 4 14\\n\", \"2\\n5 7\\n\", \"3\\n10 2 8\\n\", \"3\\n30 20 10\\n\", \"3\\n3 4 1\\n\", \"3\\n30 10 20\\n\", \"100\\n2515 3324 7975 6171 4240 1217 4829 5203 8603 6900 3031 4699 4732 6070 4221 3228 6497 7359 9130 4346 4619 1109 3945 5442 3271 16 9711 2045 6410 2301 3406 8125...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given 5 integers - N,A,B,C,D.\nLet us say all the integers of length N, having only A or B in their decimal representation are good integers. Also, among all the good integers, all those integers whose sum of digits should contains either C or D or both on it, are best integers.\nFind the ...
code
{ "ground_truth": "{\"inputs\": [\"N = 2, A = 1, B = 2, C = 3, D = 5\", \"N = 1, A = 1, B = 1, C = 2, D = 3\", \"N = 4, A = 6, B = 7, C = 5, D = 3\"], \"outputs\": [\"2\", \"0\", \"4\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "At ACME Corp, the seller Robin is selling software like hotcakes. To sell the software, he arranges meetings all over the country. Of course, he always needs to travel there, and sometimes even stay the night. Other times, he decides that a hot dog on the way to a meeting counts as accommodation.\...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 -2 3\\n\", \"5\\n129 44 394 253 147\\n\", \"10\\n-100 40000 -6500 -230 -18 34500 -450 13000 -100 5000\\n\"], \"outputs\": [\"2\\n\", \"0\\n\", \"7398\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Sleep in Class\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe academic year has just begun, but lessons and olympiads have already occupied all the free time. It is not a surprise that today Olga fell asleep on the Literature. She had a dream in whi...
code
{ "ground_truth": "{\"inputs\": [\"3\\nUUD\", \"10\\nUUDUDUUDDU\", \"10\\nDUDDUUDUDD\", \"1\\nD\", \"2\\nDU\", \"3\\nDUU\", \"4\\nDDDU\", \"5\\nDDDUD\", \"50\\nDDDDDDDDDDDDDDDDDDDDDDDDDUUUUUUUUUUUUUUUUUUUUUUUUU\", \"50\\nUUUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDDDDDDDDDDD\", \"1\\nD\", \"1\\nU\"], \"outputs\": [\"5 6 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Chef has recently been playing a lot of chess in preparation for the ICCT (International Chef Chess Tournament).\nSince putting in long hours is not an easy task, Chef's mind wanders elsewhere. He starts counting the number of squares with odd side length on his chessboard..\nHowever, Chef is not ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1\\n2\\n3\\n4\\n5\\n\", \"1\\n6\\n\", \"1\\n7\\n\", \"5\\n8\\n9\\n10\\n11\\n12\\n\", \"1\\n13\\n\", \"1\\n2\\n\", \"1\\n999\\n\", \"5\\n1\\n2\\n3\\n4\\n5\\n\", \"1\\n10\\n\", \"1\\n1000\\n\", \"1\\n999\\n\"], \"outputs\": [\"1\\n4\\n10\\n20\\n35\", \"56\", \"84\", \"120\\n165\\n...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given an array a consisting of n positive integers. You pick two integer numbers l and r from 1 to n, inclusive (numbers are picked randomly, equiprobably and independently). If l > r, then you swap values of l and r. You have to calculate the expected value of the number of unique element...
code
{ "ground_truth": "{\n \"inputs\": [\n \"2\\n1 2\\n\",\n \"2\\n2 2\\n\",\n \"10\\n9 6 8 5 5 2 8 9 2 2\\n\",\n \"20\\n49 33 9 8 50 21 12 44 23 39 24 10 17 4 17 40 24 19 27 21\\n\",\n \"1\\n1000000\\n\"\n ],\n \"outputs\": [\n \"1.500000\\n\",\n \"1.000000\\n\",\n \"3.100000\\n\",\n \"7.01...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Consider a 32-bit real type with 7 bits from the right as the decimal part, the following 24 bits as the integer part, and the leftmost 1 bit as the sign part as shown below (b1, ..., b32). Represents 0 or 1).\n\n<image>\n\n\nTo translate this format into a decimal representation that is easy for ...
code
{ "ground_truth": "{\"inputs\": [\"8\\n00000000\\n80000000\\n00000080\\n00000040\\n000000c0\\n00000100\\n80000780\\n80000f70\", \"8\\n00000000\\n80000000\\n00000080\\n00000040\\n000000c0\\n00000100\\n15330257\\n80000f70\", \"8\\n00000000\\n80000000\\n00000080\\n00000040\\n000000c0\\n00000100\\n21251916\\n80000f70\", ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "An elementary school student Takahashi has come to a variety store.\n\nHe has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?\n\nNote that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.\n\nConst...
code
{ "ground_truth": "{\"inputs\": [\"500 100 1000\", \"19 123 143\", \"19 123 142\", \"50 100 120\", \"500 000 1000\", \"31 123 143\", \"19 123 141\", \"50 100 127\", \"500 101 1000\", \"55 123 143\", \"1 123 141\", \"50 000 127\", \"500 001 1000\", \"64 123 143\", \"1 123 281\", \"50 001 127\", \"726 101 1000\", \"64 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Dinesh is very fond of sweets recently his aunt Riya gifted him an array $a$ of sweets of size $N$. The ith sweet is of the type $a[i]$. His mother told him that he can choose one type of sweet in a day and eat at most 2 sweets of that type. Since he has to eat all the sweets as quickly as possibl...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1 2 2 2\\n\", \"4\\n1 1 2 2\\n\", \"10000\\n1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Description\nYou are given two strings S and T, such that length of S is greater than the length of T.\nThen a substring of S is defined as a sequence of characters which appear consecutively in S.\n\nFind the total number of distinct substrings of M such that T is a substring of M\n\nInput Format...
code
{ "ground_truth": "{\"inputs\": [\"aaaa a\", \"abcd cb\", \"a abab\", \"aaaa b\", \"dcba cb\", \"aa`a a\", \"dcac dc\", \"a``a a\", \"b abab\", \"aaaa c\", \"dcba bc\", \"b baba\", \"aaa` c\", \"dcab bc\", \"b aaba\", \"aa`a c\", \"dcab bd\", \"b aaaa\", \"aa`a b\", \"dbac bd\", \"b abaa\", \"a`aa b\", \"dcac bd\", \...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k - 1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should answer: will the flea visit all the hassocks or not. W...
code
{ "ground_truth": "{\"inputs\": [\"37\\n\", \"7\\n\", \"24\\n\", \"688\\n\", \"39\\n\", \"170\\n\", \"580\\n\", \"35\\n\", \"728\\n\", \"44\\n\", \"19\\n\", \"22\\n\", \"64\\n\", \"25\\n\", \"30\\n\", \"871\\n\", \"10\\n\", \"580\\n\", \"17\\n\", \"518\\n\", \"200\\n\", \"613\\n\", \"50\\n\", \"14\\n\", \"49\\n\", \"...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a sequence of N integers, a[1], a[2], , , , a[N]. \nFind out the maximum possible average value of sub-sequences of array a.\n\n\nInput\n\nFirst line of the input contains a single integer T denoting number of test cases\n\n\nFor each test case, first line contains a single integer ...
code
{ "ground_truth": "{\"inputs\": [\"1\\n5\\n1 3 2 1 3\", \"1\\n5\\n1 6 2 1 3\", \"1\\n5\\n1 3 2 1 1\", \"1\\n5\\n0 4 2 1 3\", \"1\\n5\\n1 7 2 1 2\", \"1\\n5\\n2 5 4 1 1\", \"1\\n5\\n2 1 0 1 1\", \"1\\n5\\n1 9 2 1 2\", \"1\\n5\\n-2 8 2 2 3\", \"1\\n5\\n1 14 4 1 4\", \"1\\n5\\n0 13 2 2 2\", \"1\\n5\\n-2 16 0 4 2\", \"1\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Kancha wants to participate in a new event of Technobyte. Event says that you have to write a number in seven segment display using matchsticks. Please refer to the diagram below for how many sticks are used for each digit !!\n\nNow, event coordinator gave kancha a long string. your task is to tel...
code
{ "ground_truth": "{\"inputs\": [\"10\\n4523521178603692869044796170148349853679689223589819975621633677282235231443204731632537466129523854\\n1302325049960398304982582357280685122562102438321157305518841538649586388982800700181595650321563194\\n251295733278683052230861115062849399250309766152058993361514855777201148...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Iahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree consists of n nodes numbered from 1 to n, each node i having an initial value a_{i}. The root of the tree is node 1.\n\nThis tree has a special property: when a value val is added to a value of...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5 5\\n1 2 1 1 2\\n1 2\\n1 3\\n2 4\\n2 5\\n1 2 3\\n1 1 2\\n2 1\\n2 2\\n2 4\\n\",\n \"10 10\\n137 197 856 768 825 894 86 174 218 326\\n7 8\\n4 7\\n8 9\\n7 10\\n1 2\\n2 4\\n3 6\\n3 5\\n2 3\\n1 9 624\\n2 1\\n2 4\\n1 6 505\\n1 8 467\\n1 3 643\\n2 1\\n1 8 631\\n2 4\\n1 7 244\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Vasya plays the sleuth with his friends. The rules of the game are as follows: those who play for the first time, that is Vasya is the sleuth, he should investigate a \"crime\" and find out what is happening. He can ask any questions whatsoever that can be answered with \"Yes\" or \"No\". All the ...
code
{ "ground_truth": "{\"inputs\": [\"Is it an apple?\\n\", \"Is it a banana ?\\n\", \"Is it an apple and a banana simultaneouSLY?\\n\", \"Is it a melon?\\n\", \"iehvZNQXDGCuVmJPOEysLyUryTdfaIxIuTzTadDbqRQGoCLXkxnyfWSGoLXebNnQQNTqAQJebbyYvHOfpUnXeWdjx?\\n\", \"hh?\\n\", \"j ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Limak is a little polar bear, who isn't afraid of geometry.\nHe has n 2-dimensional non-zero vectors \\vec{a_1}, \\vec{a_2}, \\ldots, \\vec{a_n}, each described by two integers x_i, y_i.\nShow him that you can count ways to choose an ordered triple of distinct indices i, j, k satisfying the two co...
code
{ "ground_truth": "{\"inputs\": [\"200\\n-4 -2\\n-1 8\\n-4 -4\\n3 -1\\n4 6\\n2 3\\n-6 -5\\n3 2\\n-10 -4\\n-1 6\\n1 -7\\n-4 7\\n-6 -3\\n-10 -3\\n4 3\\n9 3\\n-9 7\\n9 -1\\n-3 3\\n5 3\\n-6 1\\n-8 -3\\n-1 10\\n1 4\\n-10 -10\\n-4 6\\n-8 -7\\n5 5\\n10 9\\n3 -10\\n-1 4\\n0 4\\n10 8\\n-3 -9\\n-6 2\\n0 -3\\n8 10\\n-7 7\\n6 7\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Alfred wants to buy a toy moose that costs c dollars. The store doesn’t give change, so he must give the store exactly c dollars, no more and no less. He has n coins. To make c dollars from his coins, he follows the following algorithm: let S be the set of coins being used. S is initially empty. A...
code
{ "ground_truth": "{\"inputs\": [\"200000\\n10\\n31506\\n28490\\n134366\\n5638\\n19457\\n2007\\n14856\\n103670\\n24455\\n68460\\n\", \"200000\\n11\\n38\\n2612\\n128255\\n56198\\n1\\n1\\n258\\n31\\n8785\\n3565\\n256\\n\", \"13\\n4\\n1\\n4\\n4\\n4\\n\", \"200000\\n59\\n1177\\n120041\\n43628\\n160804\\n114044\\n65881\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Milly loves chocolates very much. She is at the land of chocolates. This land has N rooms such that there are some chocolates of different brands in every room. It is possible that there can be multiple chocolates of same brand in a particular room. Now she is in a dilemma that whether she can eat...
code
{ "ground_truth": "{\"inputs\": [\"1\\n3 2\\n1 KITKAT\\n2 FIVESTAR KITKAT\\n2 KITKAT PERK\\n\\nSAMPLE\", \"3\\n10 40\\n10 ggl fhklnkh addejhpo igkknigiq c egfhh egfhh edhdhholl fhklnkh ahg\\n10 chj di bhfmgmj edgjhoo djkdgh chj heek djkdgh ggl ahg\\n10 gjkegonh hbgjlk edhdhholl chj chj ecgielp c edhdhholl fjkghilnj a...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Given the time shown by a wall clock, you have to output the internal angle between the minute and hour hand of the clock.\n(Wall Clock displays a 12 hour format.)\n\nFor instance, if the time shown is 01:00 , the angle between the hands is 30 degrees.\n\nInput : Time in HH:MM format \nOutput: The...
code
{ "ground_truth": "{\"inputs\": [\"04:00\\n\\nSAMPLE\", \"05:55\", \"01:01\", \"06:55\", \"05:56\", \"04:00\\n\\nSAMELP\", \"01:10\", \"00:10\", \"04:01\\n\\nEAMRMP\", \"00:04\\n\\nOLSMAE\", \"04:10\\n\\nNLSMAE\", \"01:00\", \"02:00\", \"12:00\", \"10:40\\n\\nMAMRQE\", \"10:41\\n\\nMAMRQE\", \"00:05\\n\\nOLEMAS\", \"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given $n$ words, each of which consists of lowercase alphabet letters. Each word contains at least one vowel. You are going to choose some of the given words and make as many beautiful lyrics as possible.\n\nEach lyric consists of two lines. Each line consists of two words separated by whi...
code
{ "ground_truth": "{\"inputs\": [\"14\\nwow\\nthis\\nis\\nthe\\nfirst\\nmcdics\\ncodeforces\\nround\\nhooray\\ni\\nam\\nproud\\nabout\\nthat\\n\", \"7\\narsijo\\nsuggested\\nthe\\nidea\\nfor\\nthis\\nproblem\\n\", \"4\\nsame\\nsame\\nsame\\ndiffer\\n\", \"1\\nimpossible\\n\", \"1\\nimpossible\\n\", \"4\\naaaa\\naaaa\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Amusing Joke\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nSo, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two \"New Year and Christmas Men\" meet, thear assistants cut out of cardboard t...
code
{ "ground_truth": "{\"inputs\": [\"SANTACLAUS\\nDEDMOROZ\\nSANTAMOROZDEDCLAUS\", \"PAPAINOEL\\nJOULUPUKKI\\nJOULNAPAOILELUPUKKI\", \"BABBONATALE\\nFATHERCHRISTMAS\\nBABCHRISTMASBONATALLEFATHER\", \"B\\nA\\nAB\", \"ONDOL\\nJNPB\\nONLNJBODP\", \"Y\\nW\\nYW\", \"OI\\nM\\nIMO\", \"VFQRWWWACX\\nGHZJPOQUSXRAQDGOGMR\\nOPAWD...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The new semester at Hogwarts has just started, but something is not quite right – the staircases are not cooperating with the school administrators! Hogwarts has a single room of movable staircases connecting the $N$ floors. There are $M$ staircases in total, and no two staircases connect the same...
code
{ "ground_truth": "{\"inputs\": [\"5 4\\n0 1\\n0 3\\n1 2\\n2 4\\n0 2\\n0 4\\n2 3\\n2 4\\n\", \"3 3\\n0 1\\n0 2\\n1 2\\n0 1\\n1 2\\n0 2\\n\"], \"outputs\": [\"2\\nR 0\\nG 2\\n\", \"0\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You're given an ancient book that unfortunately has a few pages in the wrong position, fortunately your computer has a list of every page number in order from ``1`` to ``n``.\n\nYou're supplied with an array of numbers, and should return an array with each page number that is out of place. Incorre...
code
{ "ground_truth": "{\"fn_name\": \"find_page_number\", \"inputs\": [[[1, 2, 10, 3, 4, 5, 8, 6, 7]], [[1, 2, 3, 4, 50, 5, 6, 7, 51, 8, 40, 9]], [[1, 2, 3000, 3, 4, 5, 8, 6, 7, 8, 100, 9, 40, 10, 11, 13]], [[1, 2, 3, 4, 50, 5, 6, 7, 51, 8, 9]], [[4, 1, 2, 3, 3, 4, 26, 5, 6, 2, 7]]], \"outputs\": [[[10, 8]], [[50, 51, 4...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "zscoder loves simple strings! A string t is called simple if every pair of adjacent characters are distinct. For example ab, aba, zscoder are simple whereas aa, add are not simple.\n\nzscoder is given a string s. He wants to change a minimum number of characters so that the string s becomes simple...
code
{ "ground_truth": "{\"inputs\": [\"zscoder\\n\", \"aab\\n\", \"caaab\\n\", \"zza\\n\", \"aa\\n\", \"dtottttotd\\n\", \"ab\\n\", \"nnop\\n\", \"qasdasd\\n\", \"gg\\n\", \"rxxxrrxrxxxxxrrrrrxxxxrrrrxrxxrxxrxrxrrrxrrxrrxrxxxrxrrxrrxrxrxxxxxrxxxxrrrxrxxrxxrxxxrrrrrxrrxrrxrr\\n\", \"h\\n\", \"xx\\n\", \"zz\\n\", \"u\\n\",...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Nuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, and the columns are numbered 1 through M from left to right. Each square in the grid is painted in either blue or white. If S_{i,j} is 1, the square at the i-th row and j-th column is blue;...
code
{ "ground_truth": "{\"inputs\": [\"3 4 4\\n1101\\n0110\\n1101\\n1 1 3 4\\n1 1 3 1\\n2 2 3 4\\n1 2 2 4\", \"5 5 6\\n11010\\n01110\\n10101\\n11101\\n01010\\n1 1 5 5\\n1 2 4 5\\n2 3 3 4\\n3 3 3 3\\n3 1 3 5\\n1 1 3 4\", \"3 4 4\\n1101\\n0110\\n1101\\n1 1 3 4\\n1 1 3 1\\n2 2 3 4\\n1 2 3 4\", \"5 5 6\\n11010\\n01110\\n1010...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Chef has recently learnt some new facts about the famous number π. For example, he was surprised that ordinary fractions are sometimes used to represent this number approximately. For example, 22/7, 355/113 or even 103993/33102.\nSoon, by calculating the value of 22/7 and 355/113 on paper Chef bec...
code
{ "ground_truth": "{\"inputs\": [\"3\\n0\\n6\\n20\", \"3\\n1\\n6\\n20\", \"3\\n2\\n6\\n20\", \"3\\n0\\n8\\n20\", \"3\\n0\\n9\\n20\", \"3\\n1\\n9\\n20\", \"3\\n0\\n13\\n20\", \"3\\n0\\n13\\n1\", \"3\\n1\\n13\\n1\", \"3\\n1\\n13\\n0\", \"3\\n1\\n0\\n0\", \"3\\n1\\n1\\n0\", \"3\\n2\\n1\\n0\", \"3\\n2\\n1\\n1\", \"3\\n0\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: The Contest\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nPasha is participating in a contest on one well-known website. This time he wants to win the contest and will do anything to get to the first place!\n\nThis contest consists of *n* problems, and...
code
{ "ground_truth": "{\"inputs\": [\"2\\n3 4\\n2\\n1 4\\n7 9\", \"1\\n5\\n1\\n1 4\", \"1\\n5\\n1\\n1 5\", \"5\\n100000 100000 100000 100000 100000\\n0\", \"5\\n886 524 128 4068 298\\n3\\n416 3755\\n4496 11945\\n17198 18039\", \"10\\n575 3526 1144 1161 889 1038 790 19 765 357\\n2\\n4475 10787\\n16364 21678\", \"1\\n4\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Once, during a lesson, Sasha got bored and decided to talk with his friends. Suddenly, he saw Kefa. Since we can talk endlessly about Kefa, we won't even start doing that. The conversation turned to graphs. Kefa promised Sasha to tell him about one interesting fact from graph theory if Sasha helps...
code
{ "ground_truth": "{\"inputs\": [\"3 1 1 2\\n\", \"5 15 1 5\\n\", \"3 2 1 3\\n\", \"1000000 1000000 709877 145493\\n\", \"999811 995909 552335 962586\\n\", \"995002 10711 668009 431573\\n\", \"1000000 2 1000000 1\\n\", \"999828 991491 117039 307131\\n\", \"999885 995557 206421 701734\\n\", \"2 999947 2 1\\n\", \"9999...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: They Are Everywhere\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nSergei B., the young coach of Pokemons, has found the big house which consists of *n* flats ordered in a row from left to right. It is possible to enter each flat from the street. It is ...
code
{ "ground_truth": "{\"inputs\": [\"3\\nAaA\", \"7\\nbcAAcbc\", \"6\\naaBCCe\", \"1\\nA\", \"1\\ng\", \"52\\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\", \"2\\nAA\", \"4\\nqqqE\", \"10\\nrrrrroooro\", \"15\\nOCOCCCCiCOCCCOi\", \"20\\nVEVnVVnWnVEVVnEVBEWn\", \"25\\ncpcyPPjPPcPPPPcppPcPpppcP\", \"30\\nsssssAs...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Tsumugi brought $n$ delicious sweets to the Light Music Club. They are numbered from $1$ to $n$, where the $i$-th sweet has a sugar concentration described by an integer $a_i$.\n\nYui loves sweets, but she can eat at most $m$ sweets each day for health reasons.\n\nDays are $1$-indexed (numbered $1...
code
{ "ground_truth": "{\n \"inputs\": [\n \"9 2\\n6 19 3 4 4 2 6 7 8\\n\",\n \"1 1\\n7\\n\",\n \"2 1\\n135072 38422\\n\",\n \"2 2\\n51200 19970\\n\",\n \"37 13\\n164823 8992 21818 77521 130870 83201 174985 168799 9565 84443 105083 54131 130813 42829 98759 60103 198520 125068 59611 45609 124003 106143 541...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Gildong recently learned how to find the longest increasing subsequence (LIS) in $O(n\\log{n})$ time for a sequence of length $n$. He wants to test himself if he can implement it correctly, but he couldn't find any online judges that would do it (even though there are actually many of them). So in...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\n3 <<\\n7 >><>><\\n5 >>><\\n\"\n ],\n \"outputs\": [\n \"1 2 3\\n1 2 3\\n5 4 3 7 2 1 6\\n4 3 1 7 5 2 6\\n4 3 2 1 5\\n5 4 2 1 3\\n\"\n ]\n}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Note: This kata is inspired by [Convert a Number to a String!](http://www.codewars.com/kata/convert-a-number-to-a-string/). Try that one too.\n\n## Description\n\nWe need a function that can transform a string into a number. What ways of achieving this do you know?\n\nNote: Don't worry, all inputs...
code
{ "ground_truth": "{\"fn_name\": \"string_to_number\", \"inputs\": [[\"4\"]], \"outputs\": [[4]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "After being invaded by the Kingdom of AlDebaran, bombs are planted throughout our country, AtCoder Kingdom.\nFortunately, our military team called ABC has managed to obtain a device that is a part of the system controlling the bombs.\nThere are N bombs, numbered 1 to N, planted in our country. Bom...
code
{ "ground_truth": "{\"inputs\": [\"3 4\\n5 1\\n10 1\\n8 0\\n1 10\\n4 5\\n6 7\\n8 9\\n\", \"4 2\\n2 0\\n3 1\\n5 1\\n7 0\\n1 4\\n4 7\\n\", \"3 2\\n5 0\\n10 0\\n8 0\\n6 9\\n66 99\\n\", \"12 20\\n536130100 1\\n150049660 1\\n79245447 1\\n132551741 0\\n89484841 1\\n328129089 0\\n623467741 0\\n248785745 0\\n421631475 0\\n49...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A chain letter is a kind of a message which urges the recipient to forward it to as many contacts as possible, usually with some kind of mystic explanation. Of course, this is only a superstition, and you don't believe in it, but all your friends do. You know that today there will be one of these ...
code
{ "ground_truth": "{\"inputs\": [\"4\\n0111\\n1011\\n1101\\n1110\\n\", \"4\\n0110\\n1010\\n1100\\n0000\\n\", \"4\\n0101\\n1001\\n0001\\n1110\\n\"], \"outputs\": [\"3\\n\", \"0\\n\", \"2\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given an array a consisting of n integers a_1, a_2, ..., a_n. You want to split it into exactly k non-empty non-intersecting subsegments such that each subsegment has odd sum (i. e. for each subsegment, the sum of all elements that belong to this subsegment is odd). It is impossible to rea...
code
{ "ground_truth": "{\"inputs\": [\"3\\n5 3\\n7 18 3 14 1\\n5 4\\n1 2 3 4 5\\n6 2\\n1 2 8 4 10 2\\n\", \"1\\n1 1\\n2\\n\", \"3\\n5 3\\n7 18 3 14 1\\n5 4\\n1 2 3 4 5\\n6 2\\n2 2 8 4 10 2\\n\", \"3\\n5 3\\n7 18 3 14 1\\n5 4\\n1 2 3 4 5\\n6 2\\n3 1 8 4 10 2\\n\", \"3\\n5 3\\n7 26 2 14 1\\n4 4\\n1 2 4 4 1\\n6 3\\n3 2 8 4 ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Given are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequences different...
code
{ "ground_truth": "{\"inputs\": [\"5 4\\n1 4 2 3 5\\n\", \"8 4\\n4 2 4 2 4 2 4 2\\n\", \"10 7\\n14 15 92 65 35 89 79 32 38 46\\n\"], \"outputs\": [\"4\\n\", \"7\\n\", \"8\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "We have an array A of non-negative integers.\nFor every (contiguous) subarray B = [A[i], A[i+1], ..., A[j]] (with i <= j), we take the bitwise OR of all the elements in B, obtaining a result A[i] | A[i+1] | ... | A[j].\nReturn the number of possible results.  (Results that occur more than once are...
code
{ "ground_truth": "{\"fn_name\": \"subarrayBitwiseORs\", \"inputs\": [[[0, 1, 2]], [[5, 6, 7]], [[1, 2, 3, 4]], [[1, 1, 1]], [[2, 3, 4, 5, 6]], [[0]], [[1]], [[9, 10, 11, 12, 13]], [[0, 0, 0, 0, 0]], [[123456789]], [[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...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You have an n by m grid. Each grid square has a certain value associated with it. This is given by the numbers vi,j.\n\nYou can capture grid squares in two different ways.\nYou can directly capture a grid square. This costs ci,j.\n You can indirectly capture a grid square. You can only do this if ...
code
{ "ground_truth": "{\"inputs\": [\"3 5\\n9 0 3 2 4\\n0 2 8 6 2\\n5 3 4 1 3\\n5 1 7 9 5\\n2 4 1 2 4\\n9 1 2 2 0\\n9 1 8 9 7\\n2 7 3 2 9\\n9 1 9 8 2\\n\\nSAMPLE\", \"2 1\\n20\\n24293\\n173\\n1180\\n51947\\n76994\", \"6 6\\n71859 43509 78307 37710 68651 11715\\n91820 39108 37781 14649 95399 38262\\n254 16744 35985 32112...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Tourists in the numerous Welsh valleys are in need of an IT solution to their transportation troubles. They want to see all the local Points of interest (POIs) in a specific order already set out by their trusty tour guides.\n\nVisitors have to rely on various types of transportation: car, ricksha...
code
{ "ground_truth": "{\"inputs\": [\"4 4\\n100 30000\\n200 20000\\n300 10000\\n400 0\\n50 10000\\n75 20000\\n400 -40000\\n\", \"1 3\\n20 50000\\n100 10000\\n10 -60000\\n\"], \"outputs\": [\"2\\n\", \"IMPOSSIBLE\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Hobbits' Party\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nEveryone knows that hobbits love to organize all sorts of parties and celebrations. There are *n* hobbits living in the Shire. They decided to organize the Greatest Party (GP) that would last...
code
{ "ground_truth": "{\"inputs\": [\"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"14\", \"15\", \"16\", \"20\", \"21\", \"44\", \"45\", \"189\", \"190\", \"191\", \"209\", \"210\", \"230\", \"231\", \"251\", \"252\", \"253\", \"254\", \"255\", \"3\", \"9000\", \"9100\", \"9200\", \"9300\", \"9400\", \"9500...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "The Tom has become health conscious and is now lifting weights at the gym. But its his first time so the trainer gives him a simple job to do.\n\nHe has been given a weight lifting rod and N heavy weights, each weighing 2^0, 2^1, .... , 2^n-1. He has to stick each of the \"N\" weights on the rod, ...
code
{ "ground_truth": "{\"inputs\": [\"4\\n2\\n5\\n4\\n7\\n\\nSAMPLE\", \"8\\n6\\n8\\n3\\n2\\n11\\n13\\n15\\n17\", \"8\\n6\\n8\\n3\\n2\\n11\\n13\\n15\\n2\", \"4\\n2\\n5\\n4\\n3\\n\\nSAMPLE\", \"8\\n6\\n8\\n3\\n2\\n8\\n13\\n15\\n2\", \"4\\n2\\n5\\n4\\n5\\n\\nSAMPLE\", \"8\\n12\\n8\\n3\\n2\\n8\\n13\\n15\\n2\", \"4\\n2\\n5\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given the following recurrences, \n\nF(n) = a * F(n - 1) * G(n - 2) + b * G(n - 1) * F(n - 2) for n ≥ 2\n\nG(n) = c * G(n - 1) * F(n - 2) + d * (3 ^ F(n - 1) ) for n ≥2\n\nH(n) = e * F(n) + f * G(n) for n ≥ 0\n\nF[0] = F[1] = G[0] = 0\n\nG[1] = 1\n\nInput\n\nFirst line contains the followi...
code
{ "ground_truth": "{\"inputs\": [\"1 2 3 4 5 6\\n2\\n2 \\n3\\n\\nSAMPLE\"], \"outputs\": [\"30\\n54\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "T is a complete binary tree consisting of n vertices. It means that exactly one vertex is a root, and each vertex is either a leaf (and doesn't have children) or an inner node (and has exactly two children). All leaves of a complete binary tree have the same depth (distance from the root). So n is...
code
{ "ground_truth": "{\"inputs\": [\"15 2\\n4\\nUURL\\n8\\nLRLLLLLLLL\\n\", \"1 1\\n1\\nU\\n\", \"7 10\\n3\\nLLULULLLR\\n4\\nLUUURLLLUURRU\\n1\\nULURR\\n6\\nLURLLLLRLR\\n2\\nULULURU\\n7\\nRRUUUURLRLR\\n7\\nUUURRULRRLUL\\n7\\nULLLRUULULR\\n6\\nUURRLL\\n6\\nRULUUULLRLLLUULL\\n\", \"1 1\\n1\\nL\\n\", \"4503599627370495 1\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given three strings s, t and p consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.\n\nDuring each operation you choose any character from p, erase it from p and insert it into string s (you may insert this character anywhere you w...
code
{ "ground_truth": "{\"inputs\": [\"4\\nab\\nacxb\\ncax\\na\\naaaa\\naaabbcc\\na\\naaaa\\naabbcc\\nab\\nbaaa\\naaaaa\\n\", \"1\\naaaaaabbbbbbbbcccccccccccdddd\\naaaaabbbbbbccccccccddddddddd\\naaaaabbbbbbbbbcccccccccddddd\\n\", \"1\\naaaaaabbbbbbbbcccccccccccdddd\\naaaaabbbbbbccccccccddddddddd\\ndddddcccccccccbbbbbbbbb...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Our code monk, high on excitement after solving the rest of the problems , goes on a trek in the mountains .\n On his way, he encounters Janemba, the evil magician! Janemba takes our monk to a poison field and plays a game with him described as follows: \nThe poison field is described as NxN mat...
code
{ "ground_truth": "{\"inputs\": [\"4\\n2 1\\n1 3\\n2 4\\n2 2\\n1 3\\n2 4\\n2 3\\n1 3\\n2 4\\n2 4\\n1 3\\n2 4\\n\\nSAMPLE\", \"2\\n2 3\\n4 10\\n2 9\\n2 1\\n4 5\\n5 2\", \"4\\n2 1\\n1 3\\n2 4\\n2 2\\n1 3\\n2 4\\n2 3\\n1 6\\n2 4\\n2 4\\n1 3\\n2 4\\n\\nSAMPLE\", \"4\\n2 1\\n1 3\\n2 4\\n2 2\\n1 3\\n2 4\\n2 3\\n1 6\\n4 4\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Solve The Mystery\n\nInput:\nFirst line contains T - number of test cases.\nFollowing T lines each contains a string of characters in the range [a-z] only \n\nOutput:\nPrint a numeric string for each test case. \n\nConstraints:\n1 ≤ T ≤ 100\n1 ≤ Length of String ≤ 100 \n\nSAMPLE INPUT\n10\nkey\...
code
{ "ground_truth": "{\"inputs\": [\"10\\nkey\\nto\\ncontrol\\nnine\\ntails\\nis\\nin\\nyour\\nhand\\nphone\\n\\nSAMPLE\", \"10\\nyxreuzmhd\\nvcpgzn\\nfdz\\nh\\npng\\ngo\\nvmhgmhmuy\\ngmwfkpf\\nblheu\\nspuuxwa\", \"10\\nkey\\nto\\ncontrol\\nnine\\ntails\\nis\\nin\\nyour\\nhand\\nepiphany\", \"10\\nyxreuzmhd\\nvcpgzn\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Dr. Hedro is astonished. According to his theory, we can make sludge that can dissolve almost everything on the earth. Now he's trying to produce the sludge to verify his theory.\n\nThe sludge is produced in a rectangular solid shaped tank whose size is N × N × 2. Let coordinate of two corner poin...
code
{ "ground_truth": "{\"inputs\": [\"2\\n4\\n0\", \"2\\n8\\n0\", \"2\\n6\\n0\", \"2\\n2\\n0\", \"2\\n0\\n0\", \"2\\n14\\n0\", \"2\\n12\\n0\", \"2\\n10\\n0\", \"2\\n18\\n0\", \"2\\n24\\n0\", \"2\\n0\\n1\", \"2\\n0\\n-1\", \"2\\n0\\n-2\", \"2\\n0\\n2\", \"2\\n0\\n4\", \"2\\n0\\n-4\", \"2\\n0\\n0\", \"2\\n0\\n-1\", \"2\\n...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the students of the school took the exams in English, German, Math, and History, a table of results was formed.\n\nThere are $n$ students, each of them has a unique id (from $1$ to $n...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n100 98 100 100\\n100 100 100 100\\n100 100 99 99\\n90 99 90 100\\n100 98 60 99\\n\",\n \"6\\n100 80 90 99\\n60 60 60 60\\n90 60 100 60\\n60 100 60 80\\n100 100 0 100\\n0 0 0 0\\n\",\n \"1\\n0 0 0 0\\n\",\n \"1\\n15 71 57 86\\n\",\n \"5\\n4 8 2 6\\n8 3 5 2\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Snuke arranged N colorful balls in a row. The i-th ball from the left has color c_i and weight w_i.\n\nHe can rearrange the balls by performing the following two operations any number of times, in any order:\n\n* Operation 1: Select two balls with the same color. If the total weight of these balls...
code
{ "ground_truth": "{\"inputs\": [\"1 1 1\\n1 1\", \"4 7 3\\n3 2\\n4 3\\n2 1\\n4 4\", \"21 77 68\\n16 73\\n16 99\\n19 66\\n2 87\\n2 16\\n7 17\\n10 36\\n10 68\\n2 38\\n10 74\\n13 55\\n21 21\\n3 7\\n12 41\\n13 88\\n18 6\\n2 12\\n13 87\\n1 9\\n2 27\\n13 15\", \"4 7 3\\n3 1\\n4 3\\n2 1\\n4 4\", \"21 77 68\\n16 73\\n16 99\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are league games and tournament games in sports competitions. In soccer league games, points are given to each of the wins, losses, and draws, and the rankings are competed based on the points. The points are win (3 points), negative (0 points), and draw (1 point), respectively.\n\nEnter the...
code
{ "ground_truth": "{\"inputs\": [\"4\\nJapan 1 0 2\\nEgypt 1 2 0\\nCanada 0 2 1\\nSpain 2 0 1\\n3\\nIndia 0 2 0\\nPoland 1 0 1\\nItaly 1 0 1\\n0\", \"4\\nJapan 1 0 2\\nEgypt 1 2 0\\nCanada 0 2 1\\nSpain 2 0 1\\n3\\nIndia 0 2 0\\nPoland 1 0 1\\nItaly 1 -1 1\\n0\", \"4\\nJapan 1 0 2\\nEgypt 1 2 0\\nCanada 0 2 1\\nSpain...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Rachel has some candies and she decided to distribute them among $N$ kids. The ith kid receives $A_i$ candies. The kids are happy iff the difference between the highest and lowest number of candies received is less than $X$.\nFind out if the children are happy or not.\n\n-----Input:-----\n- First ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n5 5\\n2 3 4 5 6\\n5 6\\n6 7 8 9 10\\n4 4\\n1 2 3 4\\n2 3\\n1 8\\n1 1\\n1\\n\", \"2\\n2 0\\n1 1\\n2 1\\n1 2\\n\", \"2\\n2 0\\n1 1\\n2 1\\n1 1\\n\", \"4\\n4 0\\n1 1 1 1\\n5 5\\n5 5 5 5 5\\n2 0\\n2 2\\n3 1\\n3 3 3\\n\", \"1\\n2 40000\\n50000 100000\\n\", \"1\\n2 100000\\n1 100000\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "D --Invisible\n\nProblem Statement\n\nYou are trying to play a card game called \"Invisible\" with your friends. This card game uses two types of cards, a \"scoring card\" and a \"jamming card\". A positive value is written on each score card. The rules of this card game are as follows.\n\n* The g...
code
{ "ground_truth": "{\"inputs\": [\"2 2\\n100 -1\\n200 300\", \"2 2\\n100 -1\\n200 62\", \"2 2\\n110 -1\\n200 62\", \"2 2\\n111 -1\\n200 62\", \"2 2\\n100 -1\\n200 398\", \"2 2\\n100 -1\\n200 37\", \"2 2\\n110 -1\\n200 85\", \"2 2\\n111 -1\\n42 62\", \"2 1\\n100 -1\\n200 37\", \"2 2\\n100 -1\\n200 85\", \"2 1\\n101 -1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Tanya and Stairways\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nLittle girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from $1$ to the number of steps in this stairway. She sp...
code
{ "ground_truth": "{\"inputs\": [\"7\\n1 2 3 1 2 3 4\", \"4\\n1 1 1 1\", \"5\\n1 2 3 4 5\", \"5\\n1 2 1 2 1\", \"1\\n1\", \"48\\n1 2 3 4 1 2 3 1 1 2 3 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 2 1 2 1 2 1 1 2 1 2 1 2 3 1 2 1 2 1\", \"2\\n1 2\", \"3\\n1 1 2\", \"4\\n1 1 2 3\", \"8\\n1 2 3 1 2 3 4 5\", \"5\\n1 1 1 2 3\"], ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "problem\n\nCreate a program that counts the number of consecutive JOI or IOI characters in a given character string. The character string consists only of uppercase letters of the alphabet. For example, the character string \"JOIOIOI\" in the figure below contains JOI in one place and IOI in two p...
code
{ "ground_truth": "{\"inputs\": [\"JOIJOI\\nJOIOIOIOI\\nJOIOIJOINXNXJIOIOIOJ\", \"None\", \"JOIJOI\\nJOIOIOIOI\\nJOIOIOIJXNXNIOJIOIOJ\", \"eonN\", \"JOIJOI\\nJOIOINIOI\\nJOIOIOIJXNXNIOJIOIOJ\", \"JOIJOI\\nJOIOINIOI\\nJOIOIJOINXNXJIOIOIOJ\", \"JOIJOI\\nJOIOINIOI\\nJOIPIJOINXNXJIOIOIOJ\", \"JOIJOH\\nJOIOINIOI\\nJOIPIJO...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a string S. The task is to print all unique permutations of the given string in lexicographically sorted order.\nExample 1:\nInput: ABC\nOutput:\nABC ACB BAC BCA CAB CBA\nExplanation:\nGiven string ABC has permutations in 6 \nforms as ABC, ACB, BAC, BCA, CAB and CBA .\nExample 2:\nInput: ABS...
code
{ "ground_truth": "{\"fn_name\": \"find_permutation\", \"inputs\": [[\"DOG\"], [\"CAT\"], [\"ABCD\"], [\"FED\"], [\"SING\"], [\"A\"], [\"B\"], [\"BA\"], [\"AAA\"], [\"BBBB\"], [\"ABCDE\"], [\"AAAAB\"]], \"outputs\": [[[\"DGO\", \"DOG\", \"GDO\", \"GOD\", \"ODG\", \"OGD\"]], [[\"ACT\", \"ATC\", \"CAT\", \"CTA\", \"TAC...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A dial lock is a kind of lock which has some dials with printed numbers. It has a special sequence of numbers, namely an unlocking sequence, to be opened.\n\nYou are working at a manufacturer of dial locks. Your job is to verify that every manufactured lock is unlocked by its unlocking sequence. I...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1357 4680\\n6\\n777777 003330\\n0\", \"4\\n1433 4680\\n6\\n777777 003330\\n0\", \"4\\n1357 4680\\n6\\n509138 003330\\n0\", \"4\\n1357 4680\\n6\\n297443 003330\\n0\", \"4\\n1357 5363\\n6\\n777777 003330\\n0\", \"4\\n1357 1908\\n6\\n509138 003330\\n0\", \"4\\n2443 5385\\n6\\n56874...
{ "index": 0, "split": "dummy" }