data_source
stringclasses
4 values
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
codecontests
[ { "content": "Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to become a photographer instead.\n\nAs you may know, the coolest photos are on the film (because you can specify the hashtag #film f...
code
{ "ground_truth": "{\"inputs\": [\"2 2\\nC M\\nY Y\\n\", \"1 1\\nW\\n\", \"3 2\\nW W\\nW W\\nB B\\n\", \"1 3\\nW G B\\n\", \"1 1\\nB\\n\", \"1 4\\nG G G C\\n\", \"2 3\\nW W M\\nW W M\\n\", \"1 2\\nW Y\\n\", \"1 2\\nW C\\n\", \"1 3\\nW W C\\n\", \"2 2\\nG G\\nC C\\n\", \"2 3\\nW W C\\nW W W\\n\", \"1 2\\nB C\\n\", \"1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Functions again\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nSomething happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Up...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1 4 2 3 1\", \"4\\n1 5 4 7\", \"8\\n16 14 12 10 8 100 50 0\", \"2\\n1 1\", \"50\\n-5 -9 0 44 -10 37 34 -49 11 -22 -26 44 8 -13 23 -46 34 12 -24 2 -40 -15 -28 38 -40 -42 -42 7 -43 5 2 -11 10 43 9 49 -13 36 2 24 46 50 -15 -26 -6 -6 8 4 -44 -3\", \"100\\n23 64 60 -45 -36 -64 -59 15...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Write function avg which calculates average of numbers in given list.\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.", "role": "user" } ]
code
{ "ground_truth": "{\"fn_name\": \"find_average\", \"inputs\": [[[1, 2, 3]]], \"outputs\": [[2]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Hint\n\n* One grid may be filled more than once\n* Even if it can be represented by one line segment such as '1', it may be represented by two or more line segments.\n\n\n\nSample Input 1\nFormula for Sample Input 1.\n\nSample Input 2\nSample Input 2 formula. Another character may get inside the s...
code
{ "ground_truth": "{\"inputs\": [\"23\\n1 1 3 1\\n3 1 3 3\\n3 3 1 3\\n1 3 1 5\\n1 5 3 5\\n5 2 7 2\\n7 2 7 4\\n7 4 5 4\\n5 4 5 6\\n5 6 7 6\\n11 4 13 4\\n13 0 15 0\\n15 0 15 4\\n18 2 18 2\\n21 5 23 5\\n21 5 21 7\\n21 7 23 7\\n23 7 23 8\\n23 9 21 9\\n24 0 26 0\\n24 0 24 4\\n24 4 26 4\\n26 0 26 4\", \"23\\n1 1 3 1\\n3 1 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Vova's family is building the Great Vova Wall (named by Vova himself). Vova's parents, grandparents, grand-grandparents contributed to it. Now it's totally up to Vova to put the finishing touches.\n\nThe current state of the wall can be respresented by a sequence $a$ of $n$ integers, with $a_i$ be...
code
{ "ground_truth": "{\"inputs\": [\"5\\n2 1 1 2 5\\n\", \"3\\n4 5 3\\n\", \"2\\n10 10\\n\", \"4\\n1 2 2 1\\n\", \"6\\n3 2 3 3 2 3\\n\", \"1\\n1\\n\", \"14\\n7 7 7 4 3 3 4 5 4 4 5 7 7 7\\n\", \"10\\n1 9 7 6 2 4 7 8 1 3\\n\", \"6\\n1 1 1 1 2 1\\n\", \"7\\n1 1 2 2 3 3 1\\n\", \"4\\n2 2 2 3\\n\", \"7\\n4 1 1 2 4 3 3\\n\",...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Bit++\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe classic programming language of Bitland is Bit++. This language is so peculiar and complicated.\n\nThe language is that peculiar as it has exactly one variable, called *x*. Also, there are two ope...
code
{ "ground_truth": "{\"inputs\": [\"1\\n++X\", \"2\\nX++\\n--X\", \"3\\n++X\\n++X\\n++X\", \"2\\n--X\\n--X\", \"5\\n++X\\n--X\\n++X\\n--X\\n--X\", \"28\\nX--\\n++X\\nX++\\nX++\\nX++\\n--X\\n--X\\nX++\\nX--\\n++X\\nX++\\n--X\\nX--\\nX++\\nX--\\n++X\\n++X\\nX++\\nX++\\nX++\\nX++\\n--X\\n++X\\n--X\\n--X\\n--X\\n--X\\nX++...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks.\n\nMore precisely, two different numbers $a$ and $b$ are friends if $gcd(a,b)$, $\\frac{a}{gcd(a,b)}$, $\\frac{b}{gcd(a,b)}$ can form sides of a triangle.\n\nThree numbers $a$, $b$ ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 5 10\\n\", \"6\\n12 432 21 199 7 1\\n\", \"7\\n1 10 100 1000 10000 100000 1000000\\n\", \"100\\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 954 832 442 424 619 906 154 293 395 439 735 738 915 453 748 786 550 871 932 693 326 53 904 732 835 354 364 691 669...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Vasily the Bear loves beautiful strings. String s is beautiful if it meets the following criteria: \n\n 1. String s only consists of characters 0 and 1, at that character 0 must occur in string s exactly n times, and character 1 must occur exactly m times. \n 2. We can obtain character g from st...
code
{ "ground_truth": "{\"inputs\": [\"2 2 0\\n\", \"1 1 0\\n\", \"1 1 1\\n\", \"9134 5673 0\\n\", \"100000 100000 1\\n\", \"100000 2500 0\\n\", \"33 3232 1\\n\", \"100000 9997 1\\n\", \"1 9997 1\\n\", \"2500 1 0\\n\", \"99999 2500 1\\n\", \"2500 9997 0\\n\", \"0 2500 0\\n\", \"67655 1 1\\n\", \"0 9997 1\\n\", \"1 100000...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A Christmas party in city S. had n children. All children came in mittens. The mittens can be of different colors, but each child had the left and the right mitten of the same color. Let's say that the colors of the mittens are numbered with integers from 1 to m, and the children are numbered from...
code
{ "ground_truth": "{\"inputs\": [\"6 3\\n1 3 2 2 1 1\\n\", \"4 2\\n1 2 1 1\\n\", \"1 1\\n1\\n\", \"4 1\\n1 1 1 1\\n\", \"2 2\\n2 2\\n\", \"2 2\\n1 2\\n\", \"4 4\\n4 3 2 1\\n\", \"4 2\\n1 2 1 2\\n\", \"5 3\\n1 1 2 1 1\\n\", \"6 3\\n1 1 2 2 3 3\\n\", \"10 3\\n3 1 2 2 2 1 2 2 2 1\\n\", \"10 3\\n3 1 3 1 1 2 2 2 1 3\\n\",...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Big P is willing to climb up a hill. The hill is divided into several checkpoints where the travelers can buy water,food etc for their trip.\n\nAt each checkpoint there are several roads that go up to other checkpoints (Not necessarily the next checkpoint).\n\nNow Big P is standing at the base of ...
code
{ "ground_truth": "{\"inputs\": [\"60\\n\\n1 2\\n\\n4 6\\n\\n4 7\\n\\n5 6\\n\\n5 7\\n\\n6 8\\n\\n6 9\\n\\n7 8\\n\\n7 9\\n\\n8 10\\n\\n8 11\\n\\n9 10\\n\\n9 11\\n\\n55 56\\n\\n55 57\\n\\n56 58\\n\\n56 59\\n\\n10 12\\n\\n10 13\\n\\n14 16\\n\\n14 17\\n\\n15 16\\n\\n15 17\\n\\n16 18\\n\\n16 19\\n\\n17 18\\n\\n17 19\\n\\n...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Foe Pairs\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nYou are given a permutation *p* of length *n*. Also you are given *m* foe pairs (*a**i*,<=*b**i*) (1<=≤<=*a**i*,<=*b**i*<=≤<=*n*,<=*a**i*<=≠<=*b**i*). \n\nYour task is to count the number of diffe...
code
{ "ground_truth": "{\"inputs\": [\"4 2\\n1 3 2 4\\n3 2\\n2 4\", \"9 5\\n9 7 2 3 1 4 6 5 8\\n1 6\\n4 5\\n2 7\\n7 2\\n2 7\", \"2 1\\n1 2\\n1 2\", \"10 3\\n4 10 5 1 6 8 9 2 3 7\\n10 5\\n2 10\\n4 1\", \"50 10\\n41 15 17 1 5 31 7 38 30 39 43 35 2 26 20 42 48 25 19 32 50 4 8 10 44 12 9 18 13 36 28 6 27 23 40 24 3 14 29 11 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A mouse encountered a nice big cake and decided to take a walk across it, eating the berries on top of the cake on its way. The cake is rectangular, neatly divided into squares; some of the squares have a berry in them, and some don't.\n\nThe mouse is in a bit of a hurry, though, so once she enter...
code
{ "ground_truth": "{\"inputs\": [\"3 4\\n..**\\n*...\\n....\\n\", \"4 3\\n..*\\n.*.\\n..*\\n...\\n\", \"4 4\\n.*..\\n..*.\\n...*\\n..*.\\n\", \"3 4\\n..*)\\n*...\\n....\\n\", \"4 3\\n..*\\n.*.\\n-.*\\n...\\n\", \"4 4\\n.*..\\n*...\\n...*\\n/.*.\\n\", \"4 3\\n..*\\n.*.\\n..*\\n-..\\n\", \"4 3\\n..*\\n.*.\\n/.*\\n...\\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": ">When no more interesting kata can be resolved, I just choose to create the new kata, to solve their own, to enjoy the process --myjinxin2015 said\n\n# Description:\n\n```if:javascript\nGiven an array `arr` that contains some integers(positive, negative or 0), and a `range` list such as `[[start1...
code
{ "ground_truth": "{\"fn_name\": \"max_sum\", \"inputs\": [[[1, -2, 3, 4, -5, -4, 3, 2, 1], [[1, 3], [0, 4], [6, 8]]], [[1, -2, 3, 4, -5, -4, 3, 2, 1], [[1, 3]]], [[1, -2, 3, 4, -5, -4, 3, 2, 1], [[1, 4], [2, 5]]], [[11, -22, 31, 34, -45, -46, 35, 32, 21], [[1, 4], [0, 3], [6, 8], [0, 8]]]], \"outputs\": [[6], [5], [...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In Chefland, each chicken has X legs and each duck has Y legs. Chef's farm can have exactly one type of bird. \n\nGiven that the birds on the farm have a total of Z legs:\nPrint CHICKEN, if the farm can have only chickens but not ducks.\nPrint DUCK, if the farm can have only ducks but not chickens...
code
{ "ground_truth": "{\"inputs\": [\"5\\n2 3 6\\n4 5 20\\n6 7 42\\n2 2 8\\n3 4 15\\n\", \"1\\n4 5 20\\n\", \"2\\n2 3 6\\n3 4 12\\n\", \"3\\n4 5 16\\n3 4 12\\n6 7 42\\n\", \"1\\n1 1 999\\n\", \"1\\n1000 1 1000\\n\", \"3\\n1 2 1000\\n2 3 1000\\n3 4 1000\\n\", \"4\\n1 1 1000\\n1 1 1000\\n1 1 1000\\n1 1 1000\\n\"], \"outpu...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Dezider is making a game board for the game of Convexity. He drilled a bunch of holes in a piece of wood. As the name of the game suggests the holes were on the boundary of a convex polygon. After turning over the piece of wood, Dezider froze—he had damaged the famous Picasso lithograph—The Bull N...
code
{ "ground_truth": "{\"inputs\": [\"4 0 0 1 1 1 0 0 1\\n\", \"8 0 0 2 2 0 2 2 0 1 0 1 2 0 1 2 1\\n\"], \"outputs\": [\"2\\n\", \"3\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "After the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left with one half of a secret message. These messages can each be represented by a permutation of size $n$. Let's call them $a$ and $b$.\n\nNote that a permutation of $n$ elements is a sequence ...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n1 2 3 4 5\\n2 3 4 5 1\\n\",\n \"5\\n5 4 3 2 1\\n1 2 3 4 5\\n\",\n \"4\\n1 3 2 4\\n4 2 3 1\\n\",\n \"1\\n1\\n1\\n\",\n \"8\\n6 7 1 3 5 4 8 2\\n2 8 3 1 7 6 5 4\\n\",\n \"12\\n8 1 5 7 9 11 4 2 6 12 3 10\\n9 4 7 3 8 11 10 1 2 6 5 12\\n\",\n \"20\\n9 15 11...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are the judge at a competitive eating competition and you need to choose a winner!\n\nThere are three foods at the competition and each type of food is worth a different amount of points.\nPoints are as follows:\n\n- Chickenwings: 5 points \n\n- Hamburgers: 3 points \n\n- Hotdogs: 2 points\...
code
{ "ground_truth": "{\"fn_name\": \"scoreboard\", \"inputs\": [[[{\"name\": \"Billy The Beast\", \"chickenwings\": 17, \"hamburgers\": 7, \"hotdogs\": 8}, {\"name\": \"Habanero Hillary\", \"chickenwings\": 5, \"hamburgers\": 17, \"hotdogs\": 11}, {\"name\": \"Joey Jaws\", \"chickenwings\": 8, \"hamburgers\": 8, \"hotd...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm × b mm sheet of paper (a > b). Usually the first step in making an origami is making a square piece of paper from the rectangular sheet by folding the sheet along the bisector of the righ...
code
{ "ground_truth": "{\"inputs\": [\"2 1\\n\", \"10 7\\n\", \"1000000000000 1\\n\", \"3 2\\n\", \"4 2\\n\", \"1000 998\\n\", \"8 5\\n\", \"442 42\\n\", \"3 1\\n\", \"695928431619 424778620208\\n\", \"13 8\\n\", \"1000000000000 3\\n\", \"628625247282 464807889701\\n\", \"293 210\\n\", \"1000000000000 999999999998\\n\", ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Complete the function that counts the number of unique consonants in a string (made up of printable ascii characters).\n\nConsonants are letters used in English other than `\"a\", \"e\", \"i\", \"o\", \"u\"`. We will count `\"y\"` as a consonant.\n\nRemember, your function needs to return the numb...
code
{ "ground_truth": "{\"fn_name\": \"count_consonants\", \"inputs\": [[\"sillystring\"], [\"aeiou\"], [\"abcdefghijklmnopqrstuvwxyz\"], [\"Count my unique consonants!!\"]], \"outputs\": [[7], [0], [21], [7]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A point (x,y), on the cartesian plane, makes an angle theta with the positive direction of the x-axis. Theta varies in the interval [0 ,2PI) radians, i.e, greater than or equal to zero; but less than 2*PI radians. \n\nFor example, the polar angle of the point (1,2) as marked in this plane below,...
code
{ "ground_truth": "{\"inputs\": [\"4 \\n1 0 \\n0 -1 \\n-1 0 \\n0 1 \\n\"], \"outputs\": [\"1 0 \\n0 1 \\n-1 0 \\n0 -1 \\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Dishonest Sellers\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIgor found out discounts in a shop and decided to buy *n* items. Discounts at the store will last for a week and Igor knows about each item that its price now is *a**i*, and after a week o...
code
{ "ground_truth": "{\"inputs\": [\"3 1\\n5 4 6\\n3 1 5\", \"5 3\\n3 4 7 10 3\\n4 5 5 12 5\", \"1 0\\n9\\n8\", \"2 0\\n4 10\\n1 2\", \"4 2\\n19 5 17 13\\n3 18 8 10\", \"5 3\\n28 17 20 45 45\\n39 12 41 27 9\", \"10 5\\n87 96 19 81 10 88 7 49 36 21\\n11 75 28 28 74 17 64 19 81 31\", \"50 45\\n80 125 152 122 85 62 123 19...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are M chairs arranged in a line. The coordinate of the i-th chair (1 ≤ i ≤ M) is i.\n\nN people of the Takahashi clan played too much games, and they are all suffering from backaches. They need to sit in chairs and rest, but they are particular about which chairs they sit in. Specifically, t...
code
{ "ground_truth": "{\"inputs\": [\"6 6\\n1 6\\n1 6\\n1 5\\n1 5\\n2 6\\n2 6\", \"4 4\\n0 3\\n2 3\\n1 3\\n3 4\", \"7 6\\n0 7\\n1 5\\n3 6\\n2 7\\n1 6\\n2 6\\n3 7\", \"3 1\\n1 2\\n1 2\\n1 2\", \"6 6\\n0 6\\n1 6\\n1 5\\n1 5\\n2 6\\n2 6\", \"6 6\\n0 6\\n1 6\\n1 5\\n1 5\\n2 6\\n2 2\", \"1 1\\n1 2\\n0 2\\n1 2\", \"11 6\\n0 6...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Raising Bacteria\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nYou are a lover of bacteria. You want to raise some bacteria in a box. \n\nInitially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every ...
code
{ "ground_truth": "{\"inputs\": [\"5\", \"8\", \"536870911\", \"1\", \"343000816\", \"559980448\", \"697681824\", \"41313494\", \"673935585\", \"117422204\", \"954746654\", \"536838144\", \"1000000000\", \"2\", \"3\", \"4\", \"6\", \"7\", \"9\", \"10\", \"999999999\", \"999999998\", \"999999997\", \"999999996\", \"99...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "BooBoo is a smart baby who likes to travel around cities. And he is on a trip to Europe right now! Smart that he is, he has made a list of N cities to visit, and for each city he has M popular places to visit in each city. But being a baby, he does get exhausted pretty quickly and thus plans his t...
code
{ "ground_truth": "{\"inputs\": [\"98 64\\n15943 15261 16704 4684\\n18005 28872 27376 2748\\n\", \"998 3961\\n7845 3167 21229 11772\\n17623 22702 10710 17844\\n\", \"1949 8097\\n29667 25906 5164 20663\\n16940 19366 1274 1718\", \"97 91\\n21238 16908 18588 841\\n868 12457 12618 23612\\n\", \"1940 9686\\n14200 8539 243...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "The chef was chatting with his friend who was a mathematician.Chef said \"Hi !\".\nHis friend replied that '!' is the symbol of factorial.\nChef had never heard about it and he asked more about it. Then his friend taught him how to calculate the factorial of a number.\nChef loved that But as alway...
code
{ "ground_truth": "{\"inputs\": [\"3\\n5\\n4\\n6\", \"3\\n5\\n7\\n6\", \"3\\n5\\n7\\n12\", \"3\\n5\\n13\\n12\", \"3\\n5\\n8\\n6\", \"3\\n4\\n7\\n6\", \"3\\n5\\n2\\n12\", \"3\\n10\\n13\\n12\", \"3\\n5\\n5\\n6\", \"3\\n2\\n7\\n6\", \"3\\n2\\n2\\n12\", \"3\\n10\\n21\\n12\", \"3\\n3\\n5\\n6\", \"3\\n2\\n7\\n11\", \"3\\n2...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A railroad running from west to east in Atcoder Kingdom is now complete.\nThere are N stations on the railroad, numbered 1 through N from west to east.\nTomorrow, the opening ceremony of the railroad will take place.\nOn this railroad, for each integer i such that 1≤i≤N-1, there will be trains tha...
code
{ "ground_truth": "{\"inputs\": [\"3\\n6 5 1\\n1 10 1\\n\", \"4\\n12 24 6\\n52 16 4\\n99 2 2\\n\", \"4\\n12 13 1\\n44 17 17\\n66 4096 64\\n\", \"3\\n6 6 1\\n1 10 1\", \"4\\n1 13 1\\n44 17 17\\n66 4096 64\", \"4\\n11 24 6\\n52 16 4\\n99 2 2\", \"3\\n6 1 1\\n1 10 2\", \"3\\n6 10 1\\n1 10 1\", \"4\\n15 24 6\\n52 16 4\\n...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.\n\nInitially, the hand of every clock stands still, pointing directly upward.\n\nNow, Dolphin starts all the clocks simultaneously.\n\nIn how many seconds will the hand of every clock point directly u...
code
{ "ground_truth": "{\"inputs\": [\"2\\n2\\n3\\n\", \"5\\n2\\n5\\n10\\n1000000000000000000\\n1000000000000000000\\n\", \"75\\n22\\n1968854689373829\\n87153\\n51936214827607\\n174306\\n89708007429503\\n37408239098102751\\n5282\\n89708007429503\\n57\\n417\\n28328844451422\\n311617288965642\\n822981260158260522\\n1416442...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Anya loves to fold and stick. Today she decided to do just that.\n\nAnya has n cubes lying in a line and numbered from 1 to n from left to right, with natural numbers written on them. She also has k stickers with exclamation marks. We know that the number of stickers does not exceed the number of ...
code
{ "ground_truth": "{\"inputs\": [\"2 2 7\\n4 3\\n\", \"3 1 1\\n1 1 1\\n\", \"2 2 30\\n4 3\\n\", \"1 1 1\\n1\\n\", \"23 2 5065472115\\n428801639 184568779 477337858 18989778 249804431 579004904 679880522 901530462 200642926 941909941 377757672 300378484 103633484 503801915 910270476 13399319 214483686 671551510 986061...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Initial Bet\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThere 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 o...
code
{ "ground_truth": "{\"inputs\": [\"2 5 4 0 4\", \"4 5 9 2 1\", \"0 0 0 0 0\", \"1 2 1 2 3\", \"100 0 0 0 0\", \"2 3 4 5 6\", \"1 1 1 1 1\", \"0 1 2 3 4\", \"100 100 100 100 100\", \"93 100 99 90 98\", \"99 99 99 99 99\", \"99 98 98 99 100\", \"43 83 1 0 23\", \"43 83 1 100 23\", \"57 83 11 4 93\", \"87 38 19 33 100\"...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Quantity of Strings\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nJust in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly *n*, ...
code
{ "ground_truth": "{\"inputs\": [\"1 1 1\", \"5 2 4\", \"7 4 20\", \"8 13 9\", \"10 23 9\", \"10 25 8\", \"997 1752 1000\", \"784 1 1999\", \"341 9 342\", \"777 1 777\", \"542 13 542\", \"1501 893 1501\", \"1321 95 2\", \"2000 1000 3\", \"1769 849 1000\", \"1000 2 1\", \"345 1777 1\", \"1999 2000 2000\", \"1984 1847 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The characters of Chima need your help. Their weapons got mixed up! They need you to write a program that accepts the name of a character in Chima then tells which weapon he/she owns.\n\nFor example: for the character `\"Laval\"` your program should return the solution `\"Laval-Shado Valious\"`\n\...
code
{ "ground_truth": "{\"fn_name\": \"identify_weapon\", \"inputs\": [[\"Laval\"], [\"Crominus\"], [\"Lagravis\"], [\"Cragger\"], [\"Tormak\"], [\"LiElla\"], [\"G'loona\"], [\"Stinkin gorillas\"], [\"qwertyuiopasdfghjklzxcvbnm\"]], \"outputs\": [[\"Laval-Shado Valious\"], [\"Crominus-Grandorius\"], [\"Lagravis-Blazeprow...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "One day Om Nom found a thread with n beads of different colors. He decided to cut the first several beads from this thread to make a bead necklace and present it to his girlfriend Om Nelly.\n\n<image>\n\nOm Nom knows that his girlfriend loves beautiful patterns. That's why he wants the beads on th...
code
{ "ground_truth": "{\"inputs\": [\"21 2\\nababaababaababaababaa\\n\", \"7 2\\nbcabcab\\n\", \"1 2\\na\\n\", \"1 42\\na\\n\", \"2 2\\nab\\n\", \"5 4\\naaaaa\\n\", \"5 5\\naaaaa\\n\", \"321 2\\nabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaaba...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given three positive integers N, x, and y.\n\nCount the number of arrays P of length N such that:\nP_{1} = P_{N} = 1\nThere are exactly x indices i such that P_{i}=1\nThere are exactly y indices i such that P_{i}=2\nThere are exactly N-x-y indices i such that P_{i}=3\nP_{i} \\neq P_{i+1} f...
code
{ "ground_truth": "{\"inputs\": [\" 6 3 2\\n\", \" 9 5 3\\n\", \" 8 4 2\\n\", \" 4 2 2\\n\", \" 2000000 1000000 999999\\n\", \" 1999999 1000000 999998\\n\"], \"outputs\": [\"4\", \"4\", \"12\", \"0\", \"1999998\", \"999999\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "At first, let's define function $f(x)$ as follows: $$ \\begin{matrix} f(x) & = & \\left\\{ \\begin{matrix} \\frac{x}{2} & \\mbox{if } x \\text{ is even} \\\\ x - 1 & \\mbox{otherwise } \\end{matrix} \\right. \\end{matrix} $$\n\nWe can see that if we choose some value $v$ and will apply function $f...
code
{ "ground_truth": "{\"inputs\": [\"11 3\\n\", \"11 6\\n\", \"20 20\\n\", \"14 5\\n\", \"1000000 100\\n\", \"1 1\\n\", \"2 1\\n\", \"100 4\\n\", \"502333439 2047\\n\", \"773014587697599 31\\n\", \"946338791423 262143\\n\", \"1000000000 4\\n\", \"13 2\\n\", \"1073741821 2\\n\", \"1000000000 100\\n\", \"1000000000 10000...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are n boys and m girls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed from left to right by numbers from 1 to n + m. Then the number of integers i (1 ≤ i < n + m) such that po...
code
{ "ground_truth": "{\"inputs\": [\"4 2\\n\", \"3 3\\n\", \"100 100\\n\", \"1 2\\n\", \"10 100\\n\", \"1 34\\n\", \"1 100\\n\", \"90 100\\n\", \"1 4\\n\", \"89 89\\n\", \"6 4\\n\", \"1 98\\n\", \"99 3\\n\", \"1 1\\n\", \"46 2\\n\", \"84 27\\n\", \"5 5\\n\", \"76 48\\n\", \"2 1\\n\", \"56 98\\n\", \"100 90\\n\", \"18 9...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of $n$ students doing yet another trick. \n\nLet's assume that all these students are numbered from $1$ to $n$. The teacher came to student $a$ and put a ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n2 3 2\\n\", \"3\\n1 2 3\\n\", \"3\\n2 3 1\\n\", \"1\\n1\\n\", \"2\\n2 1\\n\", \"100\\n1 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 6...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In this Kata, we define an arithmetic progression as a series of integers in which the differences between adjacent numbers are the same. You will be given an array of ints of `length > 2` and your task will be to convert it into an arithmetic progression by the following rule:\n```Haskell\nFor ea...
code
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[[1, 1, 3, 5, 6, 5]], [[2, 1, 2]], [[1, 2, 3]], [[1, 1, 10]], [[24, 21, 14, 10]], [[3, 2, 1, 1, 1]], [[1, 3, 6, 9, 12]], [[0, 0, 0, 0, 0]], [[5, 4, 3, 2, 1, 1]], [[1, 2, 1]], [[1, 2, 3, 1, 1]], [[1, 3, 6, 8, 10]], [[5, 6, 5, 3, 1, 1]]], \"outputs\": [[4], [1], ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given an array A of N positive integers. Let G be the [gcd] of all the numbers in the array A. \n \nYou have to find if there exist K non-empty, non-intersecting subarrays of A for which the [arithmetic mean] of the gcd of those K subarrays equals G.\n\nFormally, let g_{1}, g_{2}, \\ldots,...
code
{ "ground_truth": "{\"inputs\": [\"1\\n4 2\\n5 10 15 20\\n\", \"1\\n5 3\\n10 20 30 40 50\\n\"], \"outputs\": [\"YES\", \"YES\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "One of the most important products of the R1 company is a popular @r1.com mail service. The R1 mailboxes receive and send millions of emails every day.\n\nToday, the online news thundered with terrible information. The R1 database crashed and almost no data could be saved except for one big string...
code
{ "ground_truth": "{\"inputs\": [\"@\\n\", \"_@0.z\\n\", \"0000000a@000a111.r\\n\", \"a@0.\\n\", \"@0.z\\n\", \"@1.r\\n\", \"0@0.x\\n\", \"a@r.z\\n\", \"a@0z\\n\", \"a@.z\\n\", \"a_0.z\\n\", \"a0.z\\n\", \"@.\\n\", \"a@0._\\n\", \"a@\\n\", \"a@_.z\\n\", \"a@0.z\\n\", \"a\\n\", \".\\n\", \"0\\n\", \"a@0.1\\n\", \"A\\n...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "In Byteland there are N cities, numbered 1 through N. Some pairs of cities are connected by bi-directional roads in such a way that starting from any one city you can visit all other cities either directly or indirectly.\n\nChef is currently at city A and wants to visit all other cities in Bytelan...
code
{ "ground_truth": "{\"inputs\": [[\"2\", \"3\", \"1 2\", \"1 3\", \"1\", \"5\", \"1 2\", \"1 3\", \"2 4\", \"2 5\", \"1\"]], \"outputs\": [[\"2\", \"4\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "In one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Arkady can buy extensions for his field, each extension enlarges one of the field sizes in a particular number of times. Formally, there are n extensions, the i-th of them multiplies the widt...
code
{ "ground_truth": "{\"inputs\": [\"5 5 1 2 3\\n2 2 3\\n\", \"3 3 3 3 5\\n2 3 5 4 2\\n\", \"3 3 2 4 4\\n2 5 4 10\\n\", \"3 4 1 1 3\\n2 3 2\\n\", \"662 859 2 3 17\\n3 2 2 2 3 3 3 2 3 3 2 3 2 2 2 2 2\\n\", \"21865 53623 9 7 116\\n2 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 2...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Turing Tape\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nINTERCAL is the oldest of esoteric programming languages. One of its many weird features is the method of character-based output, known as Turing Tape method. It converts an array of unsigned 8-...
code
{ "ground_truth": "{\"inputs\": [\"Hello, World!\", \"N\", \"!{|aPUBKs[k\\\"HE;>O&(Nf}N4,*#g*<3sQXFJ'?Z/H9L[xx Rc5\\\"8~v}84+wv]w[oO0e':MaNy&6*]jRkYomz[o?=13Y?!fzA3eC\\\\\", \"!{|aPUBKs[k\\\"HE;>O&(Nf}N4,*#g*<3sQXFJ'?Z/H9L[xx Rc5\\\"8~v}84+wv]w\", \":J&UY'O]>@Lc\\\"4ow&?8#yq{s=gH%'`3Yd[CP#\", \"Py0L_[Ymh&.\", \"fH9Bh...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given an array (or list or vector) of arrays (or, guess what, lists or vectors) of integers, your goal is to return the sum of a specific set of numbers, starting with elements whose position is equal to the main array length and going down by one at each step.\n\nSay for example the parent array ...
code
{ "ground_truth": "{\"fn_name\": \"elements_sum\", \"inputs\": [[[[3, 2, 1, 0], [4, 6, 5, 3, 2], [9, 8, 7, 4]]], [[[3], [4, 6, 5, 3, 2], [9, 8, 7, 4]]], [[[3, 2, 1, 0], [4, 6, 5, 3, 2], []]], [[[3, 2, 1, 0], [4, 6, 5, 3, 2], []], 5], [[[3, 2], [4], []]]], \"outputs\": [[16], [15], [7], [12], [0]]}", "style": "rule"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "One fateful spring evening Bergur was playing his favorite video game Striker-Count. Bergur is so good at Striker-Count he usually defeats his opponents without breaking a sweat. Therefore he’s been racking his brain for new ways to win with style. He decides to jump in the air, rotate a full circ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n5 0 1\\n10 0 1\\n0 5 1\\n0 -5 1\\n-5 0 1\\n\", \"6\\n2 2 2\\n6 2 1\\n10 2 1\\n2 6 1\\n6 6 1\\n2 10 1\\n\"], \"outputs\": [\"2\\n\", \"3\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "After learning about polynomial hashing, Heidi decided to learn about shift-xor hashing. In particular, she came across this interesting problem.\n\nGiven a bitstring $y \\in \\{0,1\\}^n$ find out the number of different $k$ ($0 \\leq k < n$) such that there exists $x \\in \\{0,1\\}^n$ for which $...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1010\\n\", \"1\\n0\\n\", \"1\\n1\\n\", \"2\\n00\\n\", \"2\\n10\\n\", \"2\\n01\\n\", \"2\\n11\\n\", \"3\\n000\\n\", \"3\\n100\\n\", \"3\\n010\\n\", \"3\\n110\\n\", \"3\\n001\\n\", \"3\\n101\\n\", \"3\\n011\\n\", \"3\\n111\\n\", \"4\\n0000\\n\", \"4\\n1000\\n\", \"4\\n0100\\n\", \...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Fun Region\n\nDr. Ciel lives in a planar island with a polygonal coastline. She loves strolling on the island along spiral paths. Here, a path is called spiral if both of the following are satisfied.\n\n* The path is a simple planar polyline with no self-intersections.\n* At all of its vertices, t...
code
{ "ground_truth": "{\"inputs\": [\"4\\n10 0\\n20 10\\n10 30\\n0 10\"], \"outputs\": [\"300.00\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "The country has n cities and n - 1 bidirectional roads, it is possible to get from every city to any other one if you move only along the roads. The cities are numbered with integers from 1 to n inclusive.\n\nAll the roads are initially bad, but the government wants to improve the state of some ro...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 1\\n\", \"5\\n1 2 3 4\\n\", \"31\\n1 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\\n\", \"29\\n1 2 2 4 4 6 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28\\n\", \"2\\n1\\n\", \"3\\n1 2\\n\"], \"outputs\": [\"4 3 3\", \"5 8 9 8 5\", \"73741817 536870...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "As you might already know, space has always been a problem in ICPC Jakarta. To cope with this, ICPC Jakarta is planning to build two new buildings. These buildings should have a shape of a rectangle of the same size. Now, their problem is to find land to build the buildings.\n\nThere are N lands a...
code
{ "ground_truth": "{\"inputs\": [\"2\\n5 5\\n3 4\\n\", \"2\\n2 5\\n4 3\\n\", \"3\\n10 1\\n9 8\\n7 6\\n\"], \"outputs\": [\"\\n12.5\\n\", \"\\n8.0\\n\", \"\\n42.0\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Tarly has two different type of items, food boxes and wine barrels. There are f food boxes and w wine barrels. Tarly stores them in various stacks and each stack can consist of either food boxes or wine barrels but not both. The stacks are placed in a line such that no two stacks of food boxes are...
code
{ "ground_truth": "{\"inputs\": [\"1 1 1\\n\", \"1 2 1\\n\", \"1000 1000 1000\\n\", \"4346 1611 880\\n\", \"100 100000 100000\\n\", \"2626 6150 9532\\n\", \"2390 4197 2086\\n\", \"4138 4245 30\\n\", \"3414 2092 6298\\n\", \"40000 40000 4000\\n\", \"20 12 32\\n\", \"6232 1674 3837\\n\", \"0 1 1\\n\", \"100000 100000 1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "There is a beautiful garden of stones in Innopolis.\n\nIts most beautiful place is the $n$ piles with stones numbered from $1$ to $n$.\n\nEJOI participants have visited this place twice. \n\nWhen they first visited it, the number of stones in piles was $x_1, x_2, \\ldots, x_n$, correspondingly. On...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1 2 3 4 5\\n2 1 4 3 5\\n\", \"5\\n1 1 1 1 1\\n1 0 1 0 1\\n\", \"3\\n2 3 9\\n1 7 9\\n\", \"40\\n361 372 139 808 561 460 421 961 727 719 130 235 320 470 432 759 317 886 624 666 917 133 736 710 462 424 541 118 228 216 612 339 800 557 291 128 801 9 0 318\\n364 689 60 773 340 571 627...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Sereja owns a restaurant for n people. The restaurant hall has a coat rack with n hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using the i-th hook costs a_{i} rubles. Only one person can hang clothes on one hook.\n\nTonight Sereja expects m guests in the restaurant. Nat...
code
{ "ground_truth": "{\n \"inputs\": [\n \"2 1\\n2 1\\n2\\n\",\n \"2 1\\n2 1\\n10\\n\",\n \"1 1\\n1\\n2\\n\",\n \"3 96\\n83 22 17\\n19\\n\",\n \"8 4\\n27 72 39 70 13 68 100 36\\n95\\n\",\n \"2 65\\n23 34\\n74\\n\",\n \"2 48\\n12 54\\n69\\n\",\n \"5 30\\n63 58 38 60 24\\n42\\n\",\n \"9 47\\n1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Gerald and Giant Chess\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nGiant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game takes place on an *h*<=×<=*w* field, and it is painted in two colo...
code
{ "ground_truth": "{\"inputs\": [\"3 4 2\\n2 2\\n2 3\", \"100 100 3\\n15 16\\n16 15\\n99 88\", \"1000 1000 4\\n50 50\\n51 50\\n50 51\\n51 51\", \"100000 100000 4\\n50001 50001\\n50000 50000\\n50000 50001\\n50001 50000\", \"2 2 2\\n2 1\\n1 2\", \"100 10 30\\n40 4\\n15 3\\n75 3\\n88 10\\n32 1\\n16 5\\n81 8\\n45 2\\n72 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Panda has a thing for palindromes. Hence he was a given a problem by his master. The master will give Panda an array of strings S having N strings. Now Panda has to select the Palin Pairs from the given strings . \n\nA Palin Pair is defined as : \n\n(i,j) is a Palin Pair if Si = reverse(Sj) a...
code
{ "ground_truth": "{\"inputs\": [\"3\\nbba\\nabb\\nabb\\n\\nSAMPLE\", \"3\\nbba\\nabb\\nabc\\n\\nSAMPLE\", \"3\\nbba\\nabb\\nabb\\n\\nSAMPLF\", \"3\\nbba\\nbba\\nabc\\n\\nSAMPLE\", \"3\\nbba\\nabb\\nabc\\n\\nSAPMLE\", \"3\\nbba\\nabb\\nbac\\n\\nSAPMLE\", \"3\\nbba\\nabb\\nbba\\n\\nSAMPLF\", \"3\\nbba\\nabb\\ncab\\n\\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Rama is in love with geometry. So once he was playing with circles and rectangles. Given the center of circle and radius and also the co-ordinates of vertices of rectangle, he wants to check whether the rectangle lies inside the circle or not.\n\nNote: If all the vertices are lie the circumference...
code
{ "ground_truth": "{\"inputs\": [\"860\\n3696 -9955 9797\\n-795 6780\\n-795 1345\\n4817 6780\\n4817 1345\\n8424 9568 371\\n594 9764\\n594 3251\\n-360 9764\\n-360 3251\\n9615 -4755 6885\\n-6550 6721\\n-6550 9473\\n8991 6721\\n8991 9473\\n7404 170 9631\\n-3535 -458\\n-3535 -9951\\n3100 -458\\n3100 -9951\\n215 9988 -729...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a tree with N vertices numbered 1, 2, ..., N. The i-th edge connects Vertex a_i and Vertex b_i. You are also given a string S of length N consisting of `0` and `1`. The i-th character of S represents the number of pieces placed on Vertex i.\n\nSnuke will perform the following operati...
code
{ "ground_truth": "{\"inputs\": [\"7\\n0010101\\n1 2\\n2 3\\n1 4\\n4 5\\n1 6\\n6 7\", \"7\\n0010110\\n1 2\\n2 3\\n1 4\\n4 5\\n1 6\\n6 7\", \"2\\n01\\n1 2\", \"2\\n01\\n2 2\", \"7\\n0011101\\n1 2\\n2 3\\n1 4\\n4 5\\n1 6\\n6 7\", \"7\\n0111101\\n1 2\\n2 3\\n1 4\\n4 5\\n1 6\\n6 7\", \"7\\n0110110\\n1 1\\n2 3\\n1 4\\n1 5...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The country of Byteland contains $N$ cities and $N-1$ bidirectional roads. There is a path between any two cities. The roads in Byteland were built long ago, and now they are in need of repair. You have been hired to fix all the roads. You intend to do this by dispatching robots on some of the roa...
code
{ "ground_truth": "{\"inputs\": [\"1\\n6\\n0 1\\n1 2\\n0 3\\n3 4\\n4 5\\n\", \"1\\n7\\n0 1\\n1 2\\n2 3\\n3 4\\n2 5\\n5 6\\n\"], \"outputs\": [\"1\", \"2\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "=====Function Descriptions=====\nitertools.combinations_with_replacement(iterable, r)\nThis tool returns\n\nlength subsequences of elements from the input iterable allowing individual elements to be repeated more than once.\n\nCombinations are emitted in lexicographic sorted order. So, if the inpu...
code
{ "ground_truth": "{\"inputs\": [\"HACK 2\"], \"outputs\": [\"AA\\nAC\\nAH\\nAK\\nCC\\nCH\\nCK\\nHH\\nHK\\nKK\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Recently, Petya learned about a new game \"Slay the Dragon\". As the name suggests, the player will have to fight with dragons. To defeat a dragon, you have to kill it and defend your castle. To do this, the player has a squad of $n$ heroes, the strength of the $i$-th hero is equal to $a_i$.\n\nAc...
code
{ "ground_truth": "{\"inputs\": [\"4\\n3 6 2 3\\n5\\n3 12\\n7 9\\n4 14\\n1 10\\n8 7\\n\", \"4\\n3 5 2 3\\n5\\n3 12\\n7 9\\n4 14\\n1 10\\n8 7\\n\", \"4\\n3 5 2 3\\n3\\n3 12\\n7 9\\n4 14\\n1 10\\n8 7\\n\", \"4\\n3 5 2 3\\n5\\n3 12\\n2 9\\n4 14\\n1 7\\n8 7\\n\", \"4\\n3 5 2 3\\n5\\n3 12\\n2 9\\n4 14\\n1 7\\n8 13\\n\", \...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Ilya the Lion wants to help all his friends with passing exams. They need to solve the following problem to pass the IT exam.\n\nYou've got string s = s1s2... sn (n is the length of the string), consisting only of characters \".\" and \"#\" and m queries. Each query is described by a pair of integ...
code
{ "ground_truth": "{\"inputs\": [\"......\\n4\\n3 4\\n2 3\\n1 6\\n2 6\\n\", \"#..###\\n5\\n1 3\\n5 6\\n1 5\\n3 6\\n3 4\\n\", \"#.#.#\\n7\\n1 2\\n3 4\\n3 5\\n2 3\\n3 5\\n1 5\\n1 3\\n\", \"#..##...#.\\n7\\n5 9\\n6 10\\n1 7\\n5 8\\n3 5\\n2 10\\n3 4\\n\", \".#...#..\\n6\\n1 5\\n2 3\\n6 7\\n2 4\\n2 5\\n1 3\\n\", \"#.\\n1\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Given n sticks' lengths, determine whether there is a solution to choose 2k out of them and use these 2k sticks to form two k-convex polygons (non-degenerated), namely, two convex polygons each has exactly k sticks as its sides, and every adjacent sticks are not parallel.\n\n\nInput\nThe first lin...
code
{ "ground_truth": "{\"inputs\": [\"6 3\\n1 2 3 100 200 300\", \"7 3\\n1 2 3 100 200 300\", \"6 1\\n2 -1 -1 110 61 541\", \"2 1\\n-3 -3 1 001 45 192\", \"8 3\\n1 1 1 111 344 325\", \"5 1\\n1 -3 -2 110 75 601\", \"7 3\\n1 0 3 100 200 300\", \"7 3\\n1 0 3 000 200 300\", \"7 3\\n1 0 0 000 200 300\", \"7 3\\n1 0 0 010 200...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Once upon a time in a land of yore, there was a troll who lived ’neath one of the land’s many stone bridges. This troll was quite a mischievous troll, for you see, it had a habit of accusing anyone crossing the bridge of having stolen the troll’s property (which was a somewhat curious accusation g...
code
{ "ground_truth": "{\"inputs\": [\"5 2 1\\n\", \"10 5 2\\n\"], \"outputs\": [\"2\\n\", \"5\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A binary gap within a positive number ```num``` is any sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of ```num```. \n For example:\n ```9``` has binary representation ```1001``` and contains a binary gap of length ```2```.\n ```529``` ...
code
{ "ground_truth": "{\"fn_name\": \"gap\", \"inputs\": [[9]], \"outputs\": [[2]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Given are an integer N and arrays S, T, U, and V, each of length N.\nConstruct an N×N matrix a that satisfy the following conditions:\n - a_{i,j} is an integer.\n - 0 \\leq a_{i,j} \\lt 2^{64}.\n - If S_{i} = 0, the bitwise AND of the elements in the i-th row is U_{i}.\n - If S_{i} = 1, the bitwi...
code
{ "ground_truth": "{\"inputs\": [\"2\\n0 1\\n1 0\\n1 1\\n1 0\\n\", \"2\\n1 1\\n1 0\\n15 15\\n15 11\\n\"], \"outputs\": [\"1 1\\n1 0\\n\", \"15 11\\n15 11\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Kulyash loves perfect squares and hates perfect cubes. \nFor any natural number N, \nF(N) = \\texttt{number of perfect squares smaller than or equal to } N - \\texttt{number of positive perfect cubes smaller than or equal to } N. \n\nKulyash gives you an integer X and asks you to find the minimu...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1\\n2\\n3\\n4\\n5\\n\", \"1\\n10\\n\", \"1\\n20\\n\", \"2\\n15\\n30\\n\", \"1\\n100\\n\", \"1\\n1000000000\\n \", \"1\\n12345\\n\", \"3\\n13579\\n24680\\n36912\\n\", \"2\\n1\\n1000000000\\n\", \"4\\n1000000\\n2000000\\n3000000\\n4000000\\n\", \"1\\n1000000\\n\"], \"outputs\": [\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Motu and Tomu are very good friends who are always looking for new games to play against each other and ways to win these games. One day, they decided to play a new type of game with the following rules:\n- The game is played on a sequence $A_0, A_1, \\dots, A_{N-1}$.\n- The players alternate turn...
code
{ "ground_truth": "{\"inputs\": [\"5\\n4 2\\n5 8 1 4\\n5 1\\n4 2 1 3 7\\n6 3\\n2 8 5 1 3 4\\n4 1\\n6 3 4 2\\n4 1\\n7 2 4 1\\n\", \"1\\n5 2\\n5 6 2 4 1\\n\", \"1\\n6 1\\n1 2 3 5 8 13\\n\"], \"outputs\": [\"YES\\nYES\\nYES\\nYES\\nYES\", \"YES\", \"YES\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given a set of n pens, each of them can be red, blue, green, orange, and violet in color. Count a minimum number of pens that should be taken out from the set so that any two neighboring pens have different colors. Pens are considered to be neighboring if there are no other pens between th...
code
{ "ground_truth": "{\"inputs\": [\"3\\n7\\nRBBOOVV\\n4\\nRRGG\\n6\\nBBVVBB\\n\", \"1\\n8\\nVVVRRRBB\\n\", \"3\\n1000\\nRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBRBR...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "To round an integer a, it is customary to round to some multiple of a power of 10, and you will round it accordingly. This time, rules have changed. Given an int n and an int b, round n to the nearest value which is a multiple of b.\n If n is exactly halfway between two multiples of b, print the l...
code
{ "ground_truth": "{\"inputs\": [\"2\\n5 10\\n100 3\\n\\nSAMPLE\", \"2\\n5 10\\n101 3\\n\\nSAMPLE\", \"2\\n5 10\\n111 3\\n\\nSAMPLE\", \"2\\n5 10\\n110 6\\n\\nSAMPLE\", \"2\\n5 10\\n100 9\\n\\nSAMPLE\", \"2\\n5 10\\n110 2\\n\\nSAMPLD\", \"2\\n5 10\\n100 1\\n\\nSAMPLE\", \"2\\n5 10\\n101 1\\n\\nMASPLE\", \"2\\n5 4\\n1...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a tree consisting of n vertices. A number is written on each vertex; the number on vertex i is equal to a_i.\n\nLet's denote the function g(x, y) as the greatest common divisor of the numbers written on the vertices belonging to the simple path from vertex x to vertex y (including th...
code
{ "ground_truth": "{\"inputs\": [\"4\\n9 16 144 6\\n1 3\\n2 3\\n4 3\\n\", \"6\\n1 2 4 8 16 32\\n1 6\\n6 3\\n3 4\\n4 2\\n6 5\\n\", \"3\\n1 2 3\\n1 2\\n2 3\\n\", \"3\\n2 3 4\\n1 2\\n2 3\\n\", \"1\\n1\\n\", \"3\\n2 3 4\\n1 3\\n2 3\\n\", \"3\\n1 2 4\\n1 2\\n2 3\\n\", \"1\\n13\\n\", \"4\\n4 9 19 20\\n2 4\\n2 3\\n4 1\\n\",...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.\n\nExample 1:\n\n\nInput: [3,0,1]\nOutput: 2\n\n\nExample 2:\n\n\nInput: [9,6,4,2,3,5,7,0,1]\nOutput: 8\n\n\nNote:\nYour algorithm should run in linear runtime complexity. Could yo...
code
{ "ground_truth": "{\"fn_name\": \"missingNumber\", \"inputs\": [[[0, 1, 3]], [[5, 3, 0, 1, 2]], [[7, 5, 6, 0, 1, 3, 2]], [[10, 8, 1, 2, 3, 4, 5, 6, 9, 0]], [[0, 1, 2, 4, 5]], [[0]], [[1, 0]], [[10000, 9999, 9998]], [[1, 0, 3]], [[999999998, 999999999, 1000000000, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[0, 999999998, 9...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Things are heated up between the Finance team and the Marketing team, and they decide to have one-on-one fifa matches to settle it once and for all.\n\nJha, being an intern, won’t play (it’s a battle of legends, after all) and has been given one job: to fix matches in the \"hope\" that he’ll match...
code
{ "ground_truth": "{\"inputs\": [\"3\\n8 5 3\\n8 5 3\\n\\nSAMPLE\", \"4\\n1 10 7 4\\n15 3 8 7\", \"4\\n1 10 7 4\\n15 3 8 10\", \"3\\n8 2 3\\n8 5 3\\n\\nSAMPLE\", \"4\\n1 10 7 4\\n6 3 8 10\", \"4\\n1 9 7 3\\n6 3 8 10\", \"4\\n1 1 7 3\\n11 5 8 18\", \"4\\n2 14 26 9\\n19 3 -1 0\", \"4\\n1 10 7 4\\n6 0 8 4\", \"4\\n1 10 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Hideyo has come by two aerial photos of the same scale and orientation. You can see various types of buildings, but some areas are hidden by clouds. Apparently, they are of the same area, and the area covered by the second photograph falls entirely within the first. However, because they were take...
code
{ "ground_truth": "{\"inputs\": [\"5 5 3 3\\nAF??z\\nW8p8?\\n???Hk\\npU?m?\\nF???c\\nF??\\np?8\\n?H?\", \"6 5 4 2\\naaaaaa\\naaaaaa\\naaaaaa\\naaaaaa\\naaaaab\\naaaa\\naaaa\", \"5 5 3 3\\nAF??z\\np8W8?\\n???Hk\\npU?m?\\nF???c\\nF??\\np?8\\n?H?\", \"6 5 4 2\\naaaaaa\\naaaaaa\\naaaaaa\\naaaaaa\\nbaaaab\\naaaa\\naaaa\",...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "The only difference between easy and hard versions are constraints on $n$ and $k$.\n\nYou are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most $k$ most recent conversations with your friends. Initially, the screen is empty (i.e. the number of di...
code
{ "ground_truth": "{\n \"inputs\": [\n \"7 2\\n1 2 3 2 1 3 2\\n\",\n \"10 4\\n2 3 3 1 1 2 1 2 3 3\\n\",\n \"3 4\\n1 1 2\\n\",\n \"9 2\\n1 2 3 4 5 6 7 8 9\\n\",\n \"1 4\\n1\\n\",\n \"1 5\\n1\\n\",\n \"1 1\\n5\\n\"\n ],\n \"outputs\": [\n \"2\\n2 1 \\n\",\n \"3\\n1 3 2 \\n\",\n \"2\\n2 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given an array of n integers. We need to count all values of ‘k’ such that\narr[0] % k = arr[1] % k = ....... = arr[n-1] % k \n \nExample 1:\nInput:\nN=3\narr[] = {38, 6, 34} \nOutput: 3\nExplanation:\nWe can have values of k as \n1, 2 and 4. \nExample 2:\nInput:\nN=2\narr[] = {3, 2} \nOutput: 1\...
code
{ "ground_truth": "{\"inputs\": [\"N=3\\narr[] = {38, 6, 34}\", \"N=2\\narr[] = {3, 2}\"], \"outputs\": [\"3\", \"1\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Chintu loves to eat candies. He went to a nearby shop to buy n candies.Each candy costs Re 1. But there he finds that he is short by Rs x. So he asked his friend Mintu to lend him some money. Mintu has got Rs n. Mintu being a Math geek agrees to lend him money only on a condition if there are k in...
code
{ "ground_truth": "{\"inputs\": [\"1000\\n1785 1278 17\\n4503 963 40\\n6136 3726 2\\n5252 4099 92\\n6625 6379 89\\n4543 2129 75\\n3153 1493 70\\n1446 48 87\\n381 186 16\\n5746 4337 36\\n7490 3178 92\\n2276 1073 53\\n5653 4502 66\\n3453 1950 81\\n7803 5374 99\\n9857 5521 81\\n7843 4422 78\\n9649 4721 13\\n6237 3750 48...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given an undirected graph consisting of $n$ vertices and $n$ edges, where $n$ is divisible by $6$. Each edge has a weight, which is a positive (greater than zero) integer.\n\nThe graph has the following structure: it is split into $\\frac{n}{3}$ triples of vertices, the first triple consis...
code
{ "ground_truth": "{\"inputs\": [\"12\\n1 3 3 7 8 5 2 2 2 2 4 2\\n\", \"6\\n4 2 6 6 6 4\\n\", \"18\\n5 8 3 8 9 10 7 10 2 7 3 2 1 10 7 7 8 9\\n\", \"18\\n58 40 14 8 86 29 5 50 24 42 96 53 72 54 95 62 30 77\\n\", \"18\\n626 619 11 809 967 233 474 747 648 256 397 174 705 695 520 682 402 925\\n\"], \"outputs\": [\"36\\n\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up with another one — xor of all pairwise sums of elements in...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 2 3\\n\", \"2\\n1 2\\n\", \"51\\n50 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\\n\", \"100\\n1 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 2...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "No Great Victory anniversary in Berland has ever passed without the war parade. This year is not an exception. That’s why the preparations are on in full strength. Tanks are building a line, artillery mounts are ready to fire, soldiers are marching on the main square... And the air forces general ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n3 -3 0\\n2 -1 1\\n4 2 4\\n2 3 7\\n3 6 8\\n\", \"2\\n3 0 2\\n4 1 3\\n\", \"11\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n12 0 5\\n10 100 1000\\n\", \"1\\n31252541 -129298960 -129298947\\n\", \"5\\n8 9 10\\n10 8 10\\n7 8 9\\n8 -9 -5\\n4 -5 -...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given a set $T$, which is a subset of $S$. The set $S$ consists of $0, 1, ... n-1$. Print all subsets of $T$. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the integer representation of a subset is calculated by bitwise...
code
{ "ground_truth": "{\"inputs\": [\"4\\n2 0 3\", \"4\\n2 1 2\", \"4\\n0 0 3\", \"4\\n2 0 1\", \"4\\n1 0 2\", \"4\\n1 1 0\", \"4\\n1 2 -2\", \"4\\n1 3 0\", \"4\\n2 1 3\", \"4\\n0 0 1\", \"4\\n0 1 3\", \"4\\n0 1 1\", \"4\\n0 1 5\", \"4\\n0 1 2\", \"4\\n0 2 1\", \"4\\n0 1 0\", \"4\\n0 2 0\", \"4\\n0 0 0\", \"4\\n0 3 0\",...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Chef loves to play with iron (Fe) and magnets (Ma). He took a row of $N$ cells (numbered $1$ through $N$) and placed some objects in some of these cells. You are given a string $S$ with length $N$ describing them; for each valid $i$, the $i$-th character of $S$ is one of the following:\n- 'I' if t...
code
{ "ground_truth": "{\"inputs\": [[\"2\", \"4 5\", \"I::M\", \"9 10\", \"MIM_XII:M\"]], \"outputs\": [[\"1\", \"2\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "D: Shiritori Compression\n\nproblem\n\nEbi-chan and Kana-chan did a shiritori. Ebi-chan is looking at the memo of the word that came out in Shiritori.\n\nEbi-chan wants to remove redundant continuous subsequences from this word sequence w_1, w_2, ..., w_N until they no longer exist. The redundant ...
code
{ "ground_truth": "{\"inputs\": [\"7\\nbanana\\nat\\ntomb\\nbus\\nsound\\ndoes\\nsome\", \"7\\nbanana\\nta\\ntomb\\nbus\\nsound\\ndoes\\nsome\", \"7\\nananab\\nta\\nsomb\\nbus\\nsound\\ndoes\\nsemo\", \"7\\nbanaoa\\nta\\ntomb\\nbus\\nsound\\ndoes\\nsome\", \"7\\nbanaoa\\nta\\nuomb\\nbus\\nsound\\ndoes\\nsome\", \"7\\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Soldier and Badges\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nColonel has *n* badges. He wants to give one badge to every of his *n* soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increase...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1 3 1 4\", \"5\\n1 2 3 2 5\", \"5\\n1 5 3 2 4\", \"10\\n1 1 2 3 4 5 6 7 8 9\", \"11\\n9 2 10 3 1 5 7 1 4 8 6\", \"4\\n4 3 2 2\", \"1\\n1\", \"50\\n49 37 30 2 18 48 14 48 50 27 1 43 46 5 21 28 44 2 24 17 41 38 25 18 43 28 25 21 28 23 26 27 4 31 50 18 23 11 13 28 44 47 1 26 43 25 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Problem\n\nIn 1333, the greatest scientist in human history, Dr. Ushishi, developed an artificial intelligence with an ID of ai1333 in order to pass on his wisdom to posterity. For the next 100 years, ai1333 brought great benefits to humankind, but on the 100th anniversary of its birth, it created...
code
{ "ground_truth": "{\"inputs\": [\"-1\", \"100\", \"200\", \"-2\", \"-4\", \"-7\", \"-6\", \"-3\", \"-5\", \"-8\", \"-12\", \"-22\", \"-9\", \"-21\", \"-32\", \"-10\", \"-61\", \"-11\", \"-65\", \"-20\", \"-78\", \"-31\", \"-13\", \"-24\", \"-18\", \"-15\", \"-23\", \"-25\", \"-26\", \"-19\", \"-42\", \"-43\", \"-34\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Read problems statements in [Mandarin Chinese], [Russian], and [Bengali] as well.\n\nA programming competition will be held in Chef's city which only accepts teams of size 2. At least one person in a team should know a programming language and at least one person should know about the English lang...
code
{ "ground_truth": "{\"inputs\": [\"1\\n7\\n1110000\\n0001110\\n\"], \"outputs\": [\"3\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given an absolute path for a file (Unix-style), simplify it.\n\nFor example,\npath = \"/home/\", => \"/home\"\npath = \"/a/./b/../../c/\", => \"/c\"\n\nCorner Cases:\n\n\n Did you consider the case where path = \"/../\"?\n In this case, you should return \"/\".\n Another corner c...
code
{ "ground_truth": "{\"fn_name\": \"simplifyPath\", \"inputs\": [[\"/home/\"], [\"/a/./b/../../c/\"], [\"/foo/../bar/\"], [\"/foo/bar/./\"], [\"/../abc/./../\"], [\"/../\"], [\"/home//foo/\"], [\"/a/./b/./.././c/../../\"], [\"/foo///bar/..\"], [\"/..//../foo/\"]], \"outputs\": [[\"/home\"], [\"/c\"], [\"/bar\"], [\"/f...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a string s consisting of n lowercase Latin letters. n is even.\n\nFor each position i (1 ≤ i ≤ n) in string s you are required to change the letter on this position either to the previous letter in alphabetic order or to the next one (letters 'a' and 'z' have only one of these option...
code
{ "ground_truth": "{\"inputs\": [\"5\\n6\\nabccba\\n2\\ncf\\n4\\nadfa\\n8\\nabaazaba\\n2\\nml\\n\", \"1\\n4\\nyaaa\\n\", \"1\\n6\\ndazbyd\\n\", \"4\\n2\\nay\\n2\\nbz\\n2\\nya\\n2\\nzb\\n\", \"1\\n4\\nauux\\n\", \"3\\n2\\nab\\n2\\nbc\\n26\\nabcdefghijklmnopqrstuvwxyz\\n\", \"1\\n2\\nba\\n\", \"2\\n2\\nzb\\n2\\nza\\n\"...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number.\nFor each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, th...
code
{ "ground_truth": "{\"inputs\": [\"4\\n2 4 4 3\\n\", \"2\\n1 2\\n\", \"6\\n5 5 4 4 3 3\\n\"], \"outputs\": [\"4\\n3\\n3\\n4\\n\", \"2\\n1\\n\", \"4\\n4\\n4\\n4\\n4\\n4\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Polycarpus analyzes a string called abracadabra. This string is constructed using the following algorithm: \n\n * On the first step the string consists of a single character \"a\". \n * On the k-th step Polycarpus concatenates two copies of the string obtained on the (k - 1)-th step, while inser...
code
{ "ground_truth": "{\"inputs\": [\"4 7 12 15\\n\", \"1 463129088 536870913 1000000000\\n\", \"1 4 4 7\\n\", \"1 2 3 3\\n\", \"1 1 2 1000000000\\n\", \"8136 12821 10573 15189\\n\", \"169720415 312105195 670978284 671296539\\n\", \"654444727 988815385 77276659 644738371\\n\", \"26733 47464 19138 46248\\n\", \"42765 704...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Shopping\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nAyush is a cashier at the shopping center. Recently his department has started a ''click and collect\" service which allows users to shop online. \n\nThe store contains *k* items. *n* customers hav...
code
{ "ground_truth": "{\"inputs\": [\"2 2 5\\n3 4 1 2 5\\n1 5\\n3 1\", \"4 4 4\\n1 2 3 4\\n3 4 2 1\\n4 3 2 1\\n4 1 2 3\\n4 1 2 3\", \"1 1 1\\n1\\n1\", \"10 1 100\\n1 55 67 75 40 86 24 84 82 26 81 23 70 79 51 54 21 78 31 98 68 93 66 88 99 65 20 52 35 85 16 12 94 100 59 56 18 33 47 46 71 8 38 57 2 92 3 95 6 4 87 22 48 80 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Nazar, a student of the scientific lyceum of the Kingdom of Kremland, is known for his outstanding mathematical abilities. Today a math teacher gave him a very difficult task.\n\nConsider two infinite sets of numbers. The first set consists of odd positive numbers ($1, 3, 5, 7, \\ldots$), and the ...
code
{ "ground_truth": "{\"inputs\": [\"1 3\\n\", \"5 14\\n\", \"88005553535 99999999999\\n\", \"1 1000000000000000000\\n\", \"1 1\\n\", \"1000000000000000000 1000000000000000000\\n\", \"707992299833239702 823650821768525121\\n\", \"4 938109031727472839\\n\", \"1 15\\n\", \"31 32\\n\", \"83 402908796418729484\\n\", \"7 51...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Fuzzy Search\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nLeonid works for a small and promising start-up that works on decoding the human genome. His duties include solving complex problems of finding certain patterns in long strings consisting of le...
code
{ "ground_truth": "{\"inputs\": [\"10 4 1\\nAGCAATTCAT\\nACAT\", \"1 1 0\\nA\\nA\", \"1 1 0\\nA\\nT\", \"1 1 1\\nA\\nT\", \"5 3 0\\nATATA\\nATA\", \"5 3 1\\nATATA\\nATA\", \"7 1 2\\nATGCGTA\\nA\", \"7 1 3\\nATGCGTA\\nA\", \"4 4 0\\nATGC\\nGCTA\", \"4 4 1\\nATGC\\nGCTA\", \"4 4 2\\nATGC\\nGCTA\"], \"outputs\": [\"3\",...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "The three friends, Kuro, Shiro, and Katie, met up again! It's time for a party...\n\nWhat the cats do when they unite? Right, they have a party. Since they wanted to have as much fun as possible, they invited all their friends. Now n cats are at the party, sitting in a circle and eating soup. The ...
code
{ "ground_truth": "{\"inputs\": [\"2 2\\n\", \"3 0\\n\", \"6 2\\n\", \"7 4\\n\", \"4 0\\n\", \"571 402\\n\", \"543 110\\n\", \"1000 972\\n\", \"5 2\\n\", \"132 128\\n\", \"1000 1000\\n\", \"3 3\\n\", \"973 799\\n\", \"980 632\\n\", \"1000 843\\n\", \"924 576\\n\", \"721 343\\n\", \"361 300\\n\", \"311 3\\n\", \"950 4...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Pie or die\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nVolodya and Vlad play the following game. There are *k* pies at the cells of *n*<=<=×<=<=*m* board. Each turn Volodya moves one pie to the neighbouring (by side) cell. If the pie lies at the border o...
code
{ "ground_truth": "{\"inputs\": [\"2 2 1\\n1 2\", \"3 4 0\", \"100 50 2\\n50 25\\n50 25\", \"20 20 4\\n10 10\\n10 10\\n10 10\\n10 10\", \"15 15 1\\n8 8\", \"8 8 2\\n4 4\\n5 5\", \"100 100 2\\n50 96\\n51 96\", \"100 100 2\\n50 95\\n51 95\", \"20 20 1\\n16 10\", \"20 20 4\\n15 9\\n15 10\\n15 11\\n15 12\", \"11 11 1\\n6...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "On his birthday, John’s parents made him a huge birthday cake! Everyone had a wonderful dinner, and now it’s time to eat the cake. There are $n$ candles on the cake. John wants to divide the cake into $n$ pieces so that each piece has exactly one candle on it, and there are no left-over pieces. Fo...
code
{ "ground_truth": "{\"inputs\": [\"4 2 3\\n0 1\\n1 0\\n-1 0\\n0 -1\\n-1 1 0\\n2 1 0\\n\", \"4 3 3\\n0 1\\n1 2\\n-1 2\\n0 -1\\n-1 1 -2\\n-1 -1 2\\n0 -1 0\\n\", \"3 2 3\\n2 1\\n0 0\\n-1 -2\\n1 1 -2\\n3 6 12\\n\", \"3 1 2\\n0 0\\n-1 1\\n1 -1\\n-2 2 1\\n\"], \"outputs\": [\"yes\\n\", \"no\\n\", \"yes\\n\", \"no\\n\"]}", ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a long integer $\\boldsymbol{x}$, count the number of values of $\\class{ML__boldsymbol}{\\boldsymbol{a}}$ satisfying the following conditions: \n\n$a\\oplus x>x$\n$0<a<x$\n\nwhere $\\class{ML__boldsymbol}{\\boldsymbol{a}}$ and $\\boldsymbol{x}$ are long integers and $\\oplus$ is the bitwis...
code
{ "ground_truth": "{\"inputs\": [\"5\\n7\\n15\\n30\\n45\\n60\\n\", \"1\\n25\\n\", \"2\\n10\\n20\\n\", \"3\\n50\\n75\\n100\\n\", \"4\\n12\\n28\\n49\\n64\\n\", \"1\\n1000\\n\", \"2\\n9999\\n10000\\n\", \"2\\n10000000000\\n9999999999\\n\", \"1\\n1234567890\\n\"], \"outputs\": [\"0\\n0\\n1\\n18\\n3\", \"6\", \"5\\n11\", ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "The Zoo in the Grid Kingdom is represented by an infinite grid. The Zoo has n observation binoculars located at the OX axis. For each i between 1 and n, inclusive, there exists a single binocular located at the point with coordinates (i, 0). There are m flamingos in the Zoo, located at points with...
code
{ "ground_truth": "{\"inputs\": [\"5 5\\n2 1\\n4 1\\n3 2\\n4 3\\n4 4\\n\", \"1000000 2\\n194305 1024\\n4388610 1023\\n\", \"3 3\\n227495634 254204506\\n454991267 508409012\\n217792637 799841973\\n\", \"1000000 2\\n136395332 110293751\\n568110113 459392523\\n\", \"3 3\\n1 1\\n2 10\\n3 100\\n\", \"1000000 2\\n881456674...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Socks\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nArseniy is already grown-up and independent. His mother decided to leave him alone for *m* days and left on a vacation. She have prepared a lot of food, left some money and washed all Arseniy's clothe...
code
{ "ground_truth": "{\"inputs\": [\"3 2 3\\n1 2 3\\n1 2\\n2 3\", \"3 2 2\\n1 1 2\\n1 2\\n2 1\", \"3 3 3\\n1 2 3\\n1 2\\n2 3\\n3 1\", \"4 2 4\\n1 2 3 4\\n1 2\\n3 4\", \"10 3 2\\n2 1 1 2 1 1 2 1 2 2\\n4 10\\n9 3\\n5 7\", \"10 3 3\\n2 2 1 3 1 2 1 2 2 2\\n10 8\\n9 6\\n8 10\", \"4 3 2\\n1 1 2 2\\n1 2\\n3 4\\n2 3\", \"4 3 4...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Pashmak and Parmida's problem\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nParmida is a clever girl and she wants to participate in Olympiads this year. Of course she wants her partner to be clever too (although he's not)! Parmida has prepared the fol...
code
{ "ground_truth": "{\"inputs\": [\"7\\n1 2 1 1 2 2 1\", \"3\\n1 1 1\", \"5\\n1 2 3 4 5\", \"24\\n1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4\", \"1\\n1\", \"2\\n1 2\", \"2\\n1 1\", \"4\\n1 1 2 2\", \"5\\n1 1 2 2 2\"], \"outputs\": [\"8\", \"1\", \"0\", \"114\", \"0\", \"0\", \"0\", \"1\", \"2\"]}", "style": "ru...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A plane is flying at a constant height of h meters above the ground surface. Let's consider that it is flying from the point (-10^9, h) to the point (10^9, h) parallel with Ox axis.\n\nA glider is inside the plane, ready to start his flight at any moment (for the sake of simplicity let's consider ...
code
{ "ground_truth": "{\"inputs\": [\"3 4\\n2 5\\n7 9\\n10 11\\n\", \"1 1000000000\\n1 1000000000\\n\", \"5 10\\n5 7\\n11 12\\n16 20\\n25 26\\n30 33\\n\", \"5 10\\n2 3\\n4 5\\n6 7\\n10 14\\n16 20\\n\", \"5 10\\n4 5\\n6 8\\n9 10\\n11 13\\n16 17\\n\", \"5 10\\n2 5\\n6 8\\n9 10\\n12 14\\n18 19\\n\", \"2 3\\n1 2\\n3 4\\n\",...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x_1, the second friend lives at the point x_2, and the third friend lives at the point x_3. They plan to celebrate the New Year together, so they need to meet at one point. What is the minimum to...
code
{ "ground_truth": "{\n \"inputs\": [\n \"7 1 4\\n\",\n \"30 20 10\\n\",\n \"1 4 100\\n\",\n \"100 1 91\\n\",\n \"1 45 100\\n\",\n \"1 2 3\\n\",\n \"71 85 88\\n\",\n \"30 38 99\\n\",\n \"23 82 95\\n\",\n \"22 41 47\\n\",\n \"9 94 77\\n\",\n \"1 53 51\\n\",\n \"25 97 93\\n\",\n ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has two candies, one bag has three candies and so on. In fact, for each integer k from 1 to n2 he has exactly one bag with k candies. \n\nHelp him give n bags of candi...
code
{ "ground_truth": "{\"inputs\": [\"2\\n\", \"68\\n\", \"12\\n\", \"88\\n\", \"44\\n\", \"86\\n\", \"28\\n\", \"4\\n\", \"64\\n\", \"48\\n\", \"54\\n\", \"96\\n\", \"66\\n\", \"18\\n\", \"100\\n\", \"10\\n\", \"58\\n\", \"80\\n\", \"6\\n\", \"8\\n\", \"62\\n\", \"76\\n\", \"74\\n\", \"26\\n\", \"78\\n\", \"36\\n\", \"...
{ "index": 0, "split": "dummy" }