data_source
stringclasses
4 values
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
codeforces
[ { "content": "Title: Maze 2D\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe last product of the R2 company in the 2D games' field is a new revolutionary algorithm of searching for the shortest path in a 2<=×<=*n* maze.\n\nImagine a maze that looks like a 2<=×<=*n* recta...
code
{ "ground_truth": "{\"inputs\": [\"4 7\\n.X..\\n...X\\n5 1\\n1 3\\n7 7\\n1 4\\n6 1\\n4 7\\n5 7\", \"10 3\\nX...X..X..\\n..X...X..X\\n11 7\\n7 18\\n18 10\", \"1 1\\n.\\n.\\n1 2\", \"2 1\\n..\\n.X\\n1 2\", \"2 1\\n..\\nX.\\n1 2\", \"2 1\\n..\\nX.\\n1 4\", \"2 1\\n.X\\n..\\n1 4\", \"2 1\\nX.\\n..\\n2 3\", \"2 1\\n..\\n....
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a number N. You can perform an operation on it multiple times, in which you can change digit 5 to 6 and vice versa.\nYou have to return the sum of the maximum number and the minimum number which can be obtained by performing such operations.\nExample 1:\nInput: N = 35\nOutput: 71\nExplanatio...
code
{ "ground_truth": "{\"fn_name\": \"performOperation\", \"inputs\": [[35], [55], [65], [5], [77], [1], [56565656], [99999999], [11111111], [66666666], [555555555555555555], [999999999999999999]], \"outputs\": [[71], [121], [121], [11], [154], [2], [122222221], [199999998], [22222222], [122222221], [1222222222222222221...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "# Task\n A noob programmer was given two simple tasks: sum and sort the elements of the given array `arr` = [a1, a2, ..., an]. \n \n He started with summing and did it easily, but decided to store the sum he found in some random position of the original array which was a bad idea. Now he needs to ...
code
{ "ground_truth": "{\"fn_name\": \"shuffled_array\", \"inputs\": [[[1, 12, 3, 6, 2]], [[1, -3, -5, 7, 2]], [[2, -1, 2, 2, -1]], [[-3, -3]]], \"outputs\": [[[1, 2, 3, 6]], [[-5, -3, 2, 7]], [[-1, -1, 2, 2]], [[-3]]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Everybody knows of [spaghetti sort](https://en.wikipedia.org/wiki/Spaghetti_sort). You decided to implement an analog sorting algorithm yourself, but as you survey your pantry you realize you're out of spaghetti! The only type of pasta you have is ravioli, but you are not going to let this stop yo...
code
{ "ground_truth": "{\"inputs\": [\"3\\n3 1 2\\n\", \"3\\n1 2 3\\n\", \"4\\n90 91 90 91\\n\", \"4\\n54 54 54 55\\n\", \"10\\n55 39 93 42 97 40 36 38 11 97\\n\", \"3\\n90 39 98\\n\", \"5\\n21 57 40 94 17\\n\", \"8\\n46 4 30 85 52 6 84 13\\n\", \"6\\n47 100 96 2 96 43\\n\", \"4\\n61 28 3 81\\n\", \"5\\n14 91 91 91 84\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Mike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry problem. Let's define f([l, r]) = r - l + 1 to be the number of integer points in the segment [l, r] with l ≤ r (say that <image>). You are given two integers n and k and n closed intervals ...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\n1 3\\n1 3\\n1 3\\n\", \"3 1\\n1 2\\n2 3\\n3 4\\n\", \"3 2\\n1 2\\n1 3\\n2 3\\n\", \"9 6\\n-44 -29\\n-11 85\\n11 84\\n-63 1\\n75 89\\n-37 61\\n14 73\\n78 88\\n-22 -18\\n\", \"1 1\\n45 70\\n\", \"2 2\\n-93 -22\\n12 72\\n\", \"1 1\\n-35 -8\\n\", \"2 2\\n26 99\\n-56 40\\n\", \"1 1...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "The goal of the 15 puzzle problem is to complete pieces on $4 \\times 4$ cells where one of the cells is empty space.\n\nIn this problem, the space is represented by 0 and pieces are represented by integers from 1 to 15 as shown below.\n\n\n1 2 3 4\n6 7 8 0\n5 10 11 12\n9 13 14 15\n\n\nYou can mov...
code
{ "ground_truth": "{\"inputs\": [\"1 2 3 4\\n6 7 8 0\\n5 10 11 12\\n9 13 14 15\", \"0 2 3 4\\n6 7 8 0\\n5 10 11 12\\n9 13 14 15\", \"0 4 3 0\\n6 7 8 0\\n5 10 11 12\\n9 13 14 15\", \"0 4 3 0\\n6 7 8 0\\n5 10 11 12\\n9 13 14 0\", \"0 2 3 8\\n6 7 0 0\\n5 10 11 12\\n9 13 14 15\", \"0 2 3 0\\n6 7 4 0\\n5 10 11 12\\n9 13 1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a non-negative number N. The task is to apply at most one swap operation on the number N so that the result is the smallest possible number.\nNote: Input and Output should not contain leading zeros.\nExample 1:\nInput: N = \"9625635\"\nOutput: \"2695635\"\nExplanation: Swapped the digits 9 a...
code
{ "ground_truth": "{\"fn_name\": \"smallestNumber\", \"inputs\": [[\"\\\"45231\\\"\\\\n\"], [\"\\\"4441234\\\"\\\\n\"], [\"\\\"1\\\"\\\\n\"], [\"\\\"2222222222\\\"\\\\n\"], [\"\\\"111119\\\"\\\\n\"], [\"\\\"111111111111111111111111111119\\\"\\\\n\"]], \"outputs\": [[\"\\\"\\\"52314\\\\n\"], [\"\\\"\\\"4412344\\\\n\"]...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters.\n\nThere is a filler word ogo in Oleg's speech. All words that can be obtained from ogo by adding go ...
code
{ "ground_truth": "{\"inputs\": [\"7\\naogogob\\n\", \"9\\nogoogoogo\\n\", \"13\\nogogmgogogogo\\n\", \"2\\nog\\n\", \"1\\no\\n\", \"60\\nggoooogoggogooogogooggoogggggogogogggggogggogooogogogggogooo\\n\", \"46\\nsdfkogogogogergergogogergerogogogogoergoegogog\\n\", \"15\\nggooogoooggoggg\\n\", \"15\\nogogogogogogogo\\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Equation\n\nTime Limit: 1 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nYou are given an equation: \n\nYour task is to find the number of distinct roots of the equation and print all of them in ascending order.\n\nInput Specification:\nThe first line contains three integer...
code
{ "ground_truth": "{\"inputs\": [\"1 -5 6\", \"1 1 1\", \"1 2 1\", \"0 0 0\", \"0 -2 1\", \"0 -2 0\", \"0 0 1\", \"0 0 -100000\", \"0 10000 -100000\", \"1 100000 -100000\", \"0 3431 43123\", \"100 200 100\", \"50000 100000 50000\", \"-1 10 20\", \"-50000 100000 -50000\", \"1 -2 1\", \"1000 -5000 6000\", \"0 -100000 0...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Levko loves permutations very much. A permutation of length n is a sequence of distinct positive integers, each is at most n.\n\nLet’s assume that value gcd(a, b) shows the greatest common divisor of numbers a and b. Levko assumes that element pi of permutation p1, p2, ... , pn is good if gcd(i, p...
code
{ "ground_truth": "{\"inputs\": [\"1 1\\n\", \"4 2\\n\", \"8485 8484\\n\", \"4 1\\n\", \"7 4\\n\", \"8834 8834\\n\", \"8576 0\\n\", \"6896 0\\n\", \"1 0\\n\", \"18168 7942\\n\", \"100000 100000\\n\", \"7 7\\n\", \"5795 5792\\n\", \"5 5\\n\", \"4 4\\n\", \"13852 12727\\n\", \"5938 2\\n\", \"26593 8877\\n\", \"14564 14...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Somewhere out there, there are N islands numbered from 1 to N with no network connectivity. Communication is such a pain for the islands' dwellers. So the Kings of the islands go to nearby islands and decide to connect the islands with underwater cables for bidirectional communication.\nInitially ...
code
{ "ground_truth": "{\"inputs\": [\"5 7\\n0 1 2\\n1 2 1\\n0 3 4\\n1 1 4\\n0 3 2\\n1 2 3\\n1 1 4\"], \"outputs\": [\"Yes\\nNo\\nYes\\nYes\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Takahashi and Aoki are playing a stone-taking game. Initially, there are N piles of stones, and the i-th pile contains A_i stones and has an associated integer K_i.\n\nStarting from Takahashi, Takahashi and Aoki take alternate turns to perform the following operation:\n\n* Choose a pile. If the i-...
code
{ "ground_truth": "{\"inputs\": [\"4\\n3141 59\\n26535 897\\n93 23\\n8462 64\", \"3\\n28 3\\n16 4\\n19 2\", \"3\\n3 2\\n4 3\\n5 1\", \"2\\n5 2\\n3 3\", \"4\\n3141 59\\n26535 897\\n73 23\\n8462 64\", \"2\\n7 2\\n3 6\", \"3\\n28 3\\n16 4\\n22 2\", \"3\\n3 2\\n4 3\\n6 1\", \"4\\n3141 59\\n51840 897\\n73 23\\n8462 64\", ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given a sequence $s$ consisting of $n$ digits from $1$ to $9$.\n\nYou have to divide it into at least two segments (segment — is a consecutive sequence of elements) (in other words, you have to place separators between some digits of the sequence) in such a way that each element belongs to...
code
{ "ground_truth": "{\"inputs\": [\"4\\n6\\n654321\\n4\\n1337\\n2\\n33\\n4\\n2122\\n\", \"1\\n4\\n3333\\n\", \"21\\n3\\n123\\n3\\n123\\n3\\n123\\n3\\n123\\n3\\n123\\n3\\n213\\n3\\n123\\n3\\n123\\n3\\n123\\n3\\n321\\n3\\n123\\n3\\n321\\n3\\n132\\n3\\n322\\n3\\n321\\n3\\n341\\n3\\n123\\n3\\n421\\n3\\n421\\n3\\n421\\n3\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Vivek was roaming around in the electronics shop, where he saw a box called as BlackBox. He was intrigued by its function, so he bought it. It's functionality states that for given integer input N ≤ 1000 - it outputs the sum of all the digits in factorial of N (N!).\n\nNow Vivek wants to extend ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1\\n2\\n3\\n4\\n5\\n\\nSAMPLE\", \"1000\\n917\\n816\\n831\\n979\\n848\\n744\\n882\\n615\\n657\\n977\\n860\\n951\\n614\\n971\\n634\\n838\\n882\\n625\\n821\\n918\\n722\\n712\\n769\\n761\\n618\\n649\\n888\\n629\\n720\\n932\\n834\\n895\\n692\\n692\\n823\\n711\\n838\\n983\\n762\\n962...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Jim runs a big burger restaurant and, to entertain his customers, he always tell them jokes. He is running out of jokes and he needs you to help him find new ones.\n\nAn often heard programmer joke goes like this:\n\n\"Why do programmers always mix up Christmas and Halloween? Because Dec 25 is Oct...
code
{ "ground_truth": "{\"inputs\": [\"4\\n10 25\\n8 31\\n2 3\\n4 4\\n\", \"2\\n2 1\\n2 1\\n\", \"2\\n11 11\\n10 11\\n\", \"10\\n10 25\\n8 31\\n2 3\\n4 4\\n10 25\\n8 31\\n2 3\\n4 4\\n10 25\\n8 31\\n\"], \"outputs\": [\"1\", \"1\", \"0\", \"15\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A well-known art union called \"Kalevich is Alive!\" manufactures objects d'art (pictures). The union consists of n painters who decided to organize their work as follows.\n\nEach painter uses only the color that was assigned to him. The colors are distinct for all painters. Let's assume that the ...
code
{ "ground_truth": "{\"inputs\": [\"5 1\\n1\\n2\\n3\\n4\\n5\\n\", \"4 2\\n2 5\\n3 1\\n5 3\\n10 1\\n\", \"1 2\\n51 44\\n\", \"2 2\\n1 10\\n1 1\\n\", \"1 1\\n66\\n\", \"7 1\\n80\\n92\\n24\\n88\\n40\\n45\\n7\\n\", \"10 3\\n6 10 3\\n2 7 9\\n10 4 7\\n6 3 4\\n6 2 6\\n8 4 4\\n5 9 8\\n6 9 7\\n2 7 10\\n2 6 2\\n\", \"2 2\\n1 1\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given a tree consisting of n nodes numbered from 1 to n. The weights of edges of the tree can be any binary integer satisfying following Q conditions.\n\n- \n\t\tEach condition is of form u, v, x where u, v are nodes of the tree and x is a binary number. \n\n\t\tFor satisfying this conditi...
code
{ "ground_truth": "{\"inputs\": [[\"3\", \"3 2\", \"1 2\", \"1 3\", \"1 2 0\", \"1 3 0\", \"3 0\", \"1 2\", \"2 3\", \"3 1\", \"1 2\", \"2 3\", \"1 2 1\"]], \"outputs\": [[\"1\", \"4\", \"2\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "See Russian Translation\n\nCarol wants to sort an array of n integers. The array contains a permutation of {1,2,..,n}. \n\nCarol can only sort subarrays at a time. More specifically, she has a list of m subarrays in order that she will sort by. A subarray is a contiguous portion of the original ar...
code
{ "ground_truth": "{\"inputs\": [\"5 2\\n1 4\\n1 5\\n\", \"8 2\\n4 6\\n7 8\\n\", \"27 44\\n6 12\\n14 18\\n7 13\\n19 21\\n13 14\\n4 4\\n4 24\\n9 24\\n21 24\\n9 17\\n11 21\\n6 20\\n23 26\\n20 27\\n16 22\\n14 21\\n8 26\\n11 14\\n5 19\\n26 27\\n4 25\\n11 18\\n10 24\\n1 13\\n5 13\\n4 22\\n15 27\\n2 20\\n10 21\\n12 16\\n2 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Given a matrix (H × W) which contains only 1 and 0, find the area of the largest square matrix which only contains 0s.\n\nConstraints\n\n* 1 ≤ H, W ≤ 1,400\n\nInput\n\n\nH W\nc1,1 c1,2 ... c1,W\nc2,1 c2,2 ... c2,W\n:\ncH,1 cH,2 ... cH,W\n\n\nIn the first line, two integers H and W separated by a s...
code
{ "ground_truth": "{\"inputs\": [\"4 5\\n0 0 1 0 0\\n1 0 0 0 0\\n0 0 0 1 0\\n0 0 0 1 0\", \"4 5\\n0 0 1 0 0\\n1 0 0 0 1\\n0 0 0 1 0\\n0 0 0 1 0\", \"1 5\\n1 0 1 0 0\\n1 0 0 0 0\\n0 0 0 1 -1\\n0 -1 0 1 0\", \"1 1\\n1 0 0 0 0\\n1 0 0 0 1\\n0 -1 0 1 -1\\n0 -1 0 2 0\", \"4 5\\n0 0 1 0 0\\n1 0 0 0 1\\n0 0 0 1 0\\n0 -1 0 1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Prime Matrix\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nYou've got an *n*<=×<=*m* matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and increase it by...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\n1 2 3\\n5 6 1\\n4 4 1\", \"2 3\\n4 8 8\\n9 2 9\", \"2 2\\n1 3\\n4 2\", \"1 1\\n14\", \"5 3\\n2 14 8\\n8 8 2\\n8 10 10\\n1 2 1\\n100 100 8\", \"6 5\\n8 8 8 8 20\\n13 8 16 13 9\\n11 5 3 14 18\\n13 8 6 18 6\\n6 8 9 14 7\\n2 14 14 9 3\", \"5 7\\n9 5 3 9 2 8 2\\n15 7 9 8 18 4 6\\n2...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Queue at the School\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nDuring the break the schoolchildren, boys and girls, formed a queue of *n* people in the canteen. Initially the children stood in the order they entered the canteen. However, after a whi...
code
{ "ground_truth": "{\"inputs\": [\"5 1\\nBGGBG\", \"5 2\\nBGGBG\", \"4 1\\nGGGB\", \"2 1\\nBB\", \"2 1\\nBG\", \"6 2\\nBBGBBG\", \"8 3\\nBBGBGBGB\", \"10 3\\nBBGBBBBBBG\", \"22 7\\nGBGGBGGGGGBBBGGBGBGBBB\", \"50 4\\nGBBGBBBGGGGGBBGGBBBBGGGBBBGBBBGGBGGBGBBBGGBGGBGGBG\", \"50 8\\nGGGGBGGBGGGBGBBBGGGGGGGGBBGBGBGBBGGBGGB...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Reading books is one of Sasha's passions. Once while he was reading one book, he became acquainted with an unusual character. The character told about himself like that: \"Many are my names in many countries. Mithrandir among the Elves, Tharkûn to the Dwarves, Olórin I was in my youth in the West ...
code
{ "ground_truth": "{\"inputs\": [\"bbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbggggggggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbb...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Snuke has R red balls and B blue balls. He distributes them into K boxes, so that no box is empty and no two boxes are identical. Compute the maximum possible value of K.\n\nFormally speaking, let's number the boxes 1 through K. If Box i contains r_i red balls and b_i blue balls, the following con...
code
{ "ground_truth": "{\"inputs\": [\"8 3\"], \"outputs\": [\"5\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Mike takes part in olympiads in informatics. You think he is a rookie? Wrong! He is an experienced and well-prepared competitor! He participated in many important contests and won some of them. Now his level is rather high. \n\nIn order to keep fit, Mike decided to improve his training sessions. H...
code
{ "ground_truth": "{\"inputs\": [\"3 10\\n3 4 5\", \"3 11\\n3 4 5\", \"3 11\\n3 7 5\", \"3 22\\n3 7 5\", \"3 3\\n3 7 5\", \"3 6\\n3 7 5\", \"3 6\\n4 7 5\", \"3 6\\n1 7 5\", \"6 6\\n4 7 1\", \"3 0\\n3 11 2\", \"6 4\\n4 7 1\", \"5 0\\n3 11 2\", \"10 4\\n4 7 1\", \"5 1\\n3 11 2\", \"5 4\\n4 7 1\", \"9 1\\n-1 13 3\", \"1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Sum\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nVasya studies positional numeral systems. Unfortunately, he often forgets to write the base of notation in which the expression is written. Once he saw a note in his notebook saying *a*<=+<=*b*<==<=?, and t...
code
{ "ground_truth": "{\"inputs\": [\"78 87\", \"1 1\", \"9 7\", \"11 11\", \"43 21\", \"84 89\", \"12 34\", \"99 11\", \"11 99\", \"99 99\", \"1 2\", \"1 3\", \"2 1\", \"2 2\", \"2 3\", \"3 1\", \"3 2\", \"3 3\", \"1 466\", \"1 1000\", \"1 999\", \"149 1\", \"999 1\", \"1000 1\", \"998 998\", \"998 999\", \"998 1000\",...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Some days ago, WJMZBMR learned how to answer the query \"how many times does a string x occur in a string s\" quickly by preprocessing the string s. But now he wants to make it harder.\n\nSo he wants to ask \"how many consecutive substrings of s are cyclical isomorphic to a given string x\". You a...
code
{ "ground_truth": "{\"inputs\": [\"baabaabaaa\\n5\\na\\nba\\nbaa\\naabaa\\naaba\\n\", \"aabbaa\\n3\\naa\\naabb\\nabba\\n\", \"abbabbabba\\n5\\nab\\nbba\\nbbab\\nb\\nbbabb\\n\", \"babbabbabbabbabbabbabbabbabbab\\n10\\nbbab\\nabbabbab\\nabba\\nabbab\\nabbabba\\na\\nbabb\\nabba\\naabaaaa\\nbabbab\\n\", \"bbbbbbbbbbbbbbb...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Write a function that takes one or more arrays and returns a new array of unique values in the order of the original provided arrays.\n\nIn other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.\n\nThe unique numbers s...
code
{ "ground_truth": "{\"fn_name\": \"unite_unique\", \"inputs\": [[[1, 2], [3, 4]], [[1, 3, 2], [5, 2, 1, 4], [2, 1]], [[4, 3, 2, 2]], [[4, \"a\", 2], []], [[], [4, \"a\", 2]], [[], [4, \"a\", 2], []], [[]], [[], []], [[], [1, 2]], [[], [1, 2, 1, 2], [2, 1, 1, 2, 1]]], \"outputs\": [[[1, 2, 3, 4]], [[1, 3, 2, 5, 4]], [...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.\n\nDima put the chessboard in front of Inna and placed the candy in position (i, j) on t...
code
{ "ground_truth": "{\"inputs\": [\"5 5 2 3 1 1\\n\", \"5 7 1 3 2 2\\n\", \"2 6 1 2 2 2\\n\", \"100 100 50 50 500 500\\n\", \"1000000 2 2 2 2 1\\n\", \"33999 99333 33000 99000 3 9\\n\", \"5 1 3 1 1 1\\n\", \"6 1 5 1 2 2\\n\", \"100 100 70 5 1 1\\n\", \"1 100 1 50 1 50\\n\", \"11 11 3 3 4 4\\n\", \"5 8 4 2 1 2\\n\", \"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "We need a function ```prime_bef_aft()``` that gives the largest prime below a certain given value ```n```, \n\n```befPrime or bef_prime``` (depending on the language), \n\nand the smallest prime larger than this value, \n\n```aftPrime/aft_prime``` (depending on the language).\n\nThe result should ...
code
{ "ground_truth": "{\"fn_name\": \"prime_bef_aft\", \"inputs\": [[3], [4], [100], [97], [101], [120], [130]], \"outputs\": [[[2, 5]], [[3, 5]], [[97, 101]], [[89, 101]], [[97, 103]], [[113, 127]], [[127, 131]]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come ...
code
{ "ground_truth": "{\"inputs\": [\"25\\n2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 28\\n\", \"3\\n14 15 92\\n\", \"5\\n16 23 8 15 4\\n\", \"1\\n1\\n\", \"25\\n3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 28 2\\n\", \"25\\n13 15 24 2 21 18 9 4 16 6 10 25 20 11 23 17 8 3 1 12 5 19 ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "After a hard day Vitaly got very hungry and he wants to eat his favorite potato pie. But it's not that simple. Vitaly is in the first room of the house with n room located in a line and numbered starting from one from left to right. You can go from the first room to the second room, from the secon...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\naAbB\\n\",\n \"4\\naBaCaB\\n\",\n \"5\\nxYyXzZaZ\\n\",\n \"26\\naAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY\\n\",\n \"26\\nzAyBxCwDvEuFtGsHrIqJpKoLnMmNlOkPjQiRhSgTfUeVdWcXbY\\n\",\n \"5\\naArRaRaR\\n\",\n \"2\\ndA\\n\",\n \"2\\ncB\\n\",\n ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a binary string of length n (i. e. a string consisting of n characters '0' and '1').\n\nIn one move you can swap two adjacent characters of the string. What is the lexicographically minimum possible string you can obtain from the given one if you can perform no more than k moves? It ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n8 5\\n11011010\\n7 9\\n1111100\\n7 11\\n1111100\\n\", \"2\\n8 5\\n11011010\\n7 9\\n1111100\\n\", \"1\\n2 1\\n00\\n\", \"2\\n8 5\\n11011010\\n7 9\\n1011100\\n\", \"3\\n8 5\\n11011000\\n7 9\\n1111100\\n7 11\\n1111100\\n\", \"2\\n8 5\\n01011010\\n7 9\\n1011100\\n\", \"2\\n8 1\\n010...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Alice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be played on an undirected rooted tree of n vertices. Vertex 1 is the root of the tree.\n\nAlice starts at vertex 1 and Bob starts at vertex x (x ≠ 1). The moves are made ...
code
{ "ground_truth": "{\"inputs\": [\"4 3\\n1 2\\n2 3\\n2 4\\n\", \"5 2\\n1 2\\n2 3\\n3 4\\n2 5\\n\", \"3 3\\n1 2\\n3 2\\n\", \"8 3\\n2 1\\n3 1\\n4 3\\n5 1\\n6 1\\n7 1\\n8 6\\n\", \"10 4\\n5 4\\n8 3\\n4 6\\n5 3\\n7 9\\n1 3\\n5 10\\n2 9\\n9 8\\n\", \"2 2\\n2 1\\n\", \"3 3\\n2 1\\n3 1\\n\", \"34 33\\n2 1\\n3 2\\n4 3\\n5 2...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Pasha and String\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nPasha got a very beautiful string *s* for his birthday, the string consists of lowercase Latin letters. The letters in the string are numbered from 1 to |*s*| from left to right, where |*s*...
code
{ "ground_truth": "{\"inputs\": [\"abcdef\\n1\\n2\", \"vwxyz\\n2\\n2 2\", \"abcdef\\n3\\n1 2 3\", \"jc\\n5\\n1 1 1 1 1\", \"wljqgdlxyc\\n13\\n3 4 3 3 5 4 4 2 4 4 5 3 3\", \"keicnqmuqinhsmtudqcilocxkbqgzhbkitmqwttdyoyvcbxincwjryzknubpacsngorexaldfurondbednowemnnlphhboycfavs\\n2\\n5 12\", \"xwcxggxvfqbdklewbxkjzibmufna...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Word $s$ of length $n$ is called $k$-complete if $s$ is a palindrome, i.e. $s_i=s_{n+1-i}$ for all $1 \\le i \\le n$; $s$ has a period of $k$, i.e. $s_i=s_{k+i}$ for all $1 \\le i \\le n-k$. \n\nFor example, \"abaaba\" is a $3$-complete word, while \"abccba\" is not.\n\nBob is given a word $s$ ...
code
{ "ground_truth": "{\n \"inputs\": [\n \"4\\n6 2\\nabaaba\\n6 3\\nabaaba\\n36 9\\nhippopotomonstrosesquippedaliophobia\\n21 7\\nwudixiaoxingxingheclp\\n\"\n ],\n \"outputs\": [\n \"2\\n0\\n23\\n16\\n\"\n ]\n}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a positive number k, we need to find a minimum value of positive integer n, such that XOR of n and n+1 is equal to k. If no such n exist then print -1.\nExample 1:\nInput: k = 3\nOutput: 1\nExplaination: 1 xor 2 = 3.\nExample 2:\nInput: k = 6\nOutput: -1\nExplaination: There is no such n, so...
code
{ "ground_truth": "{\"fn_name\": \"xorCal\", \"inputs\": [[3], [5], [1], [7], [2], [100], [99], [50], [49], [75], [101], [102]], \"outputs\": [[1], [-1], [2], [3], [-1], [-1], [-1], [-1], [-1], [-1], [-1], [-1]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Sardar Singh has many men fighting for him, and he would like to calculate the power of each of them to better plan for his fight against Ramadhir.\n\nThe power of a string S of lowercase English alphabets is defined to be \n\n\\sum_{i = 1}^{|S|} i\\cdot ord(S_{i})\n\nwhere ord(S_{i}) is the posit...
code
{ "ground_truth": "{\"inputs\": [\"1\\nabcde\\n\", \"1\\nhappy\\n\", \"1\\nsardar\\n\", \"3\\nabcd\\nhijk\\nwxyz\\n\", \"1\\nsingh\\n\", \"1\\nzzzzz\\n\", \"1\\nabcabc\\n\", \"1\\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\\n\", \"1\\nbcdefghijklmnopqrstuvwxy...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given an array $a$ consisting of $n$ integers $a_1, a_2, \\dots, a_n$.\n\nYour problem is to find such pair of indices $i, j$ ($1 \\le i < j \\le n$) that $lcm(a_i, a_j)$ is minimum possible.\n\n$lcm(x, y)$ is the least common multiple of $x$ and $y$ (minimum positive number such that both...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n2 4 8 3 6\\n\",\n \"5\\n5 2 11 3 7\\n\",\n \"6\\n2 5 10 1 10 2\\n\",\n \"2\\n1 1\\n\",\n \"2\\n10000000 9999999\\n\",\n \"4\\n21 23 26 28\\n\",\n \"2\\n7 2\\n\",\n \"2\\n6 7\\n\",\n \"2\\n4 4\\n\",\n \"2\\n8 8\\n\",\n \"2\\n6 5\\n\",\n ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Stepan has a very big positive integer.\n\nLet's consider all cyclic shifts of Stepan's integer (if we look at his integer like at a string) which are also integers (i.e. they do not have leading zeros). Let's call such shifts as good shifts. For example, for the integer 10203 the good shifts are ...
code
{ "ground_truth": "{\"inputs\": [\"521\\n3\\n\", \"5678901234567890123456789\\n10000\\n\", \"1001\\n5\\n\", \"79\\n60847671\\n\", \"260597722\\n10577910\\n\", \"8460711003592660299377170851036141857177105821455679225940496548902563144980707248030407967017317182\\n13315371\\n\", \"1908\\n86567928\\n\", \"552352155\\n1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. The characters in the string are numbered starting from 1. \n\nYour task is to find out if it is possible to rearrange characters in string s so that for any prime number p ≤ |s| and for any ...
code
{ "ground_truth": "{\"inputs\": [\"wtwwttwttwwwwwwwwtwtwwwwwtwwtwwtwwwwwtwtwtwtwwtwwwtwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwtwwwwwwwwwwwtwwwwwtwttwwwwtwwwwwwwwwwwwwwwwwtwwwwtwwwwwwwwwwwwwttwtwwwwwtwwtwwwwwwwtwwttttwwwwwwwwwwwwwwwwwwwtwwwttwtwwtwwtwwtwwwwtwwtwtwwtwwwwwwwwwwtwwww\\n\", \"rrrvjurvrrsukrsrvxskrrrrbrapyrmrm...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Write a program which judges wheather given length of three side form a right triangle. Print \"YES\" if the given sides (integers) form a right triangle, \"NO\" if not so.\n\nConstraints\n\n* 1 ≤ length of the side ≤ 1,000\n* N ≤ 1,000\n\nInput\n\nInput consists of several data sets. In the first...
code
{ "ground_truth": "{\"inputs\": [\"3\\n4 3 5\\n4 3 6\\n8 8 8\", \"3\\n4 3 5\\n0 3 6\\n8 8 8\", \"3\\n4 5 5\\n-2 3 6\\n8 8 8\", \"3\\n2 2 -2\\n-1 1 0\\n3 2 0\", \"3\\n0 2 -2\\n0 1 1\\n0 4 15\", \"3\\n-1 -2 0\\n0 1 -1\\n-2 0 2\", \"3\\n-1 -2 -1\\n0 1 0\\n-2 0 2\", \"3\\n1 1 0\\n29 1 -1\\n0 1 -1\", \"3\\n4 3 5\\n-1 3 6\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.\nFor now, suppose you are a dominator of m 0s and n 1s respectively. On the other hand, there is an array with strings consisting of only 0s and 1s.\n\n\nNow your task is to find t...
code
{ "ground_truth": "{\"fn_name\": \"findMaxForm\", \"inputs\": [[[\"\\\"10\\\"\", \"\\\"0001\\\"\", \"\\\"111001\\\"\", \"\\\"1\\\"\", \"\\\"0\\\"\"], 5, 3]], \"outputs\": [4]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In another Kata I came across a weird `sort` function to implement. We had to sort characters as usual ( 'A' before 'Z' and 'Z' before 'a' ) except that the `numbers` had to be sorted **after** the `letters` ( '0' after 'z') !!!\n\n(After a couple of hours trying to solve this unusual-sorting-kata...
code
{ "ground_truth": "{\"fn_name\": \"unusual_sort\", \"inputs\": [[[\"0\", \"9\", \"8\", \"1\", \"7\", \"2\", \"6\", \"3\", \"5\", \"4\"]], [[\"3\", \"2\", \"1\", \"c\", \"b\", \"a\"]], [[\"c\", \"b\", \"a\", \"9\", \"5\", \"0\", \"X\", \"Y\", \"Z\"]], [[3, \"3\", \"2\", 2, \"2\", \"1\", 1, \"a\", \"b\", \"c\"]], [[]],...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given a matrix a, consisting of n rows and m columns. Each cell contains an integer in it.\n\nYou can change the order of rows arbitrarily (including leaving the initial order), but you can't change the order of cells in a row. After you pick some order of rows, you traverse the whole matr...
code
{ "ground_truth": "{\"inputs\": [\"6 1\\n3\\n6\\n2\\n5\\n1\\n4\\n\", \"2 4\\n1 2 3 4\\n10 3 7 3\\n\", \"4 2\\n9 9\\n10 8\\n5 3\\n4 3\\n\", \"5 5\\n1337 1337 1337 1337 1337\\n1337 1337 1337 1337 1337\\n1337 1337 1337 1337 1337\\n1337 1337 1337 1337 1337\\n1337 1337 1337 1337 1337\\n\", \"1 2\\n11 21\\n\", \"2 1\\n21\\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Easy Tape Programming\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThere is a programming language in which every program is a non-empty sequence of \"&lt;\" and \"&gt;\" signs and digits. Let's explain how the interpreter of this programming language...
code
{ "ground_truth": "{\"inputs\": [\"7 4\\n1>3>22<\\n1 3\\n4 7\\n7 7\\n1 7\", \"5 2\\n>>>>>\\n1 5\\n1 2\", \"1 3\\n9\\n1 1\\n1 1\\n1 1\", \"7 1\\n0101010\\n1 7\", \"10 30\\n306<<>4>04\\n2 2\\n6 6\\n1 10\\n1 8\\n2 4\\n9 10\\n2 8\\n3 5\\n7 7\\n2 6\\n1 3\\n3 7\\n4 9\\n3 10\\n5 9\\n7 10\\n1 3\\n5 7\\n4 10\\n6 10\\n6 7\\n4 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Our old friend Alexey has finally entered the University of City N — the Berland capital. Alexey expected his father to get him a place to live in but his father said it was high time for Alexey to practice some financial independence. So, Alexey is living in a dorm. \n\nThe dorm has exactly one s...
code
{ "ground_truth": "{\"inputs\": [\"3\\n0 5\\n2 8\\n1 6\\n\", \"3\\n0 10\\n1 5\\n7 15\\n\", \"2\\n1 5\\n1 2\\n\", \"2\\n1 9\\n3 5\\n\", \"21\\n0 97\\n46 59\\n64 95\\n3 16\\n86 95\\n55 71\\n51 77\\n26 28\\n47 88\\n30 40\\n26 34\\n2 12\\n9 10\\n4 19\\n35 36\\n41 92\\n1 16\\n41 78\\n56 81\\n23 35\\n40 68\\n\", \"20\\n69 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "So you've found a meeting room - phew! You arrive there ready to present, and find that someone has taken one or more of the chairs!! You need to find some quick.... check all the other meeting rooms to see if all of the chairs are in use.\n\nYour meeting room can take up to 8 chairs. `need` will ...
code
{ "ground_truth": "{\"fn_name\": \"meeting\", \"inputs\": [[[[\"XXX\", 3], [\"XXXXX\", 6], [\"XXXXXX\", 9]], 4], [[[\"XXX\", 1], [\"XXXXXX\", 6], [\"X\", 2], [\"XXXXXX\", 8], [\"X\", 3], [\"XXX\", 1]], 5], [[[\"XX\", 2], [\"XXXX\", 6], [\"XXXXX\", 4]], 0], [[[\"XX\", 2], [\"XXXX\", 6], [\"XXXXX\", 4]], 8], [[[\"XX\",...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order.\n\nOne of the problems of HDD hard drives is the following: the magnetic head should move from one sec...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\n3 1 2\\n\",\n \"5\\n1 3 5 4 2\\n\",\n \"1\\n1\\n\",\n \"1\\n1\\n\",\n \"1\\n1\\n\",\n \"10\\n8 2 10 3 4 6 1 7 9 5\\n\",\n \"10\\n1 2 3 4 5 6 7 8 9 10\\n\",\n \"10\\n1 3 5 7 9 10 8 6 4 2\\n\",\n \"100\\n11 9 35 34 51 74 16 67 26 21 14 80 84 79 7 ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Arkady's morning seemed to be straight of his nightmare. He overslept through the whole morning and, still half-asleep, got into the tram that arrived the first. Some time after, leaving the tram, he realized that he was not sure about the line number of the tram he was in.\n\nDuring his ride, Ark...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\n3 1 4 6\\n2 1 4\\n5 10 5 6 4 1\\n\",\n \"5\\n1 1\\n10 10 9 8 7 100 5 4 3 99 1\\n5 1 2 3 4 5\\n5 4 1 3 2 5\\n4 10 1 5 3\\n\",\n \"2\\n1 100\\n2 2 100\\n\",\n \"10\\n6 73 60 96 87 4 19\\n7 87 73 25 19 96 4 60\\n7 19 60 87 4 25 96 73\\n6 4 87 60 19 25 96\\n5 25 9...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Problem D: Exportation in Space\n\nIn an era of space travelling, Mr. Jonathan A. Goldmine exports a special material named \"Interstellar Condensed Powered Copper\". A piece of it consists of several spheres floating in the air. There is strange force affecting between the spheres so that their r...
code
{ "ground_truth": "{\"inputs\": [\"4\\n0 0 0\\n0 0 1\\n0 1 0\\n1 0 0\", \"8\\n0 0 0\\n0 0 1\\n0 1 0\\n0 1 1\\n1 0 0\\n1 0 1\\n1 1 0\\n1 1 1\", \"4\\n0 0 0\\n0 -1 1\\n0 1 0\\n1 0 0\", \"8\\n0 0 0\\n0 0 1\\n0 1 0\\n0 1 1\\n1 0 0\\n2 0 1\\n1 1 0\\n1 1 1\", \"8\\n0 0 0\\n0 0 1\\n0 1 0\\n0 1 1\\n1 0 1\\n2 0 1\\n1 1 0\\n1 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Marek and his schoolmates have just finished their studies at the university. They wanted to celebrate it with a game of paintball. After an hour of playing a very strange thing happened – everyone had exactly one bullet left. Marek, being a very curious person, wanted to know whether it’s possibl...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\n1 2\\n2 3\\n1 3\\n\", \"3 2\\n1 2\\n1 3\\n\"], \"outputs\": [\"2\\n3\\n1\\n\", \"Impossible\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Snuke got an integer sequence from his mother, as a birthday present. The sequence has N elements, and the i-th of them is i. Snuke performs the following Q operations on this sequence. The i-th operation, described by a parameter q_i, is as follows:\n\n* Take the first q_i elements from the seque...
code
{ "ground_truth": "{\"inputs\": [\"10 10\\n9\\n13\\n18\\n8\\n10\\n10\\n9\\n19\\n22\\n27\", \"5 3\\n6\\n4\\n11\", \"10 10\\n9\\n13\\n18\\n8\\n10\\n10\\n9\\n19\\n33\\n27\", \"10 10\\n9\\n13\\n18\\n8\\n10\\n1\\n9\\n19\\n33\\n27\", \"10 8\\n9\\n13\\n18\\n8\\n10\\n1\\n9\\n19\\n33\\n27\", \"10 10\\n9\\n13\\n18\\n7\\n10\\n1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Guess the Tree\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIahub and Iahubina went to a picnic in a forest full of trees. Less than 5 minutes passed before Iahub remembered of trees from programming. Moreover, he invented a new problem and Iahubina h...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1 1 1 4\", \"5\\n1 1 5 2 1\", \"13\\n1 1 1 1 1 1 1 1 1 4 4 4 13\", \"4\\n1 1 1 3\", \"24\\n1 1 1 1 1 1 1 1 1 1 1 1 24 1 1 1 1 1 1 1 1 1 1 1\", \"24\\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24\", \"10\\n1 1 1 1 7 1 1 1 4 10\", \"24\\n1 1 3 1 1 10 2 9 13 1 8 1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In this Kata, you will be given an array of integers and your task is to return the number of arithmetic progressions of size `3` that are possible from that list. In each progression, the differences between the elements must be the same.\n\n```\n[1, 2, 3, 5, 7, 9] ==> 5\n// [1, 2, 3], [1, 3, 5],...
code
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[[1, 2, 3, 4, 5]], [[1, 2, 3, 5, 7, 9]], [[0, 5, 8, 9, 11, 13, 14, 16, 17, 19]], [[0, 1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 19]], [[0, 1, 4, 5, 7, 9, 10, 13, 15, 16, 18, 19]], [[0, 1, 2, 3, 5, 8, 11, 13, 14, 16, 18, 19]]], \"outputs\": [[4], [5], [10], [17], [15], ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "This is probably the simplest problem ever. You just need to count the number of ordered triples of different numbers (X1, X2, X3), where Xi could be any positive integer from 1 to Ni, inclusive (i = 1, 2, 3).\nNo, wait. I forgot to mention that numbers N1, N2, N3 could be up to 1018. Well, in any...
code
{ "ground_truth": "{\"inputs\": [[\"5\", \"3 3 3\", \"2 4 2\", \"1 2 3\", \"25 12 2012\", \"1 1 2013\"]], \"outputs\": [[\"6\", \"4\", \"1\", \"578880\", \"0\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Gildong was hiking a mountain, walking by millions of trees. Inspired by them, he suddenly came up with an interesting idea for trees in data structures: What if we add another edge in a tree?\n\nThen he found that such tree-like graphs are called 1-trees. Since Gildong was bored of solving too ma...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n1 2\\n2 3\\n3 4\\n4 5\\n5\\n1 3 1 2 2\\n1 4 1 3 2\\n1 4 1 3 3\\n4 2 3 3 9\\n5 2 3 3 9\\n\",\n \"9\\n3 9\\n3 4\\n7 2\\n6 9\\n5 3\\n6 2\\n8 3\\n1 9\\n10\\n8 4 8 2 5\\n9 2 7 4 4\\n8 5 7 3 3\\n1 2 3 8 4\\n2 9 2 4 3\\n6 4 3 4 5\\n6 7 6 6 4\\n7 5 3 1 4\\n5 4 7 8 3\\n4 5 1...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Consider a rooted tree. A rooted tree has one special vertex called the root. All edges are directed from the root. Vertex u is called a child of vertex v and vertex v is called a parent of vertex u if there exists a directed edge from v to u. A vertex is called a leaf if it doesn't have children ...
code
{ "ground_truth": "{\n \"inputs\": [\n \"4\\n1\\n1\\n1\\n\",\n \"7\\n1\\n1\\n1\\n2\\n2\\n2\\n\",\n \"8\\n1\\n1\\n1\\n1\\n3\\n3\\n3\\n\",\n \"3\\n1\\n1\\n\",\n \"13\\n1\\n2\\n2\\n2\\n1\\n6\\n6\\n6\\n1\\n10\\n10\\n10\\n\",\n \"7\\n1\\n2\\n2\\n1\\n1\\n1\\n\",\n \"7\\n1\\n1\\n1\\n1\\n2\\n2\\n\",\n ...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Mischievous Mess Makers\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIt is a balmy spring afternoon, and Farmer John's *n* cows are ruminating about link-cut cacti in their stalls. The cows, labeled 1 through *n*, are arranged so that the *i*-th cow o...
code
{ "ground_truth": "{\"inputs\": [\"5 2\", \"1 10\", \"100000 2\", \"1 1\", \"8 3\", \"7 1\", \"100000 40000\", \"1 1000\", \"100 45\", \"9 2\", \"456 78\", \"100000 50000\", \"100000 50001\", \"100000 50002\", \"100000 50003\", \"100000 49998\", \"100000 49997\", \"99999 49998\", \"99999 49997\", \"99999 49996\", \"9...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are standing on a point (n, m) and you want to go to origin (0, 0) by taking steps either left or up i.e. from each point you are allowed to move either in (n-1, m) or (n, m-1). Find the number of paths from point to origin.\nExample 1:\nInput:\nN=3, M=0\nOutput: 1\nExplanation: Path used was ...
code
{ "ground_truth": "{\"inputs\": [\"N=3, M=0\", \"N=3, M=6\"], \"outputs\": [\"1\", \"84\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Vova and Marina love offering puzzles to each other. Today Marina offered Vova to cope with the following task.\n\nVova has a non-directed graph consisting of n vertices and m edges without loops and multiple edges. Let's define the operation of contraction two vertices a and b that are not connec...
code
{ "ground_truth": "{\"inputs\": [\"4 2\\n1 3\\n2 4\\n\", \"4 6\\n1 2\\n2 3\\n1 3\\n3 4\\n2 4\\n1 4\\n\", \"5 4\\n1 2\\n2 3\\n3 4\\n3 5\\n\", \"1 0\\n\", \"1000 4\\n100 200\\n200 300\\n300 400\\n400 100\\n\", \"59 24\\n40 3\\n14 10\\n17 5\\n40 15\\n22 40\\n9 40\\n46 41\\n17 24\\n20 15\\n49 46\\n17 50\\n14 25\\n8 14\\n...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Zbazi in Zeydabad\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nA tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad).\n\nThe country Zeydabad is a rectangular table consisting of *n* rows and *m* columns. Each cell on the coun...
code
{ "ground_truth": "{\"inputs\": [\"4 4\\nzzzz\\nzzz.\\n.z..\\nzzzz\", \"1 4\\nz.z.\", \"2 2\\nzz\\nzz\"], \"outputs\": [\"16\", \"2\", \"5\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Team RCB has earned X points in the games it has played so far in this year's IPL. To qualify for the playoffs they must earn at least a total of Y points. They currently have Z games left, in each game they earn 2 points for a win, 1 point for a draw, and no points for a loss.\n\nIs it possible f...
code
{ "ground_truth": "{\"inputs\": [\"5\\n2 8 4\\n5 7 1\\n3 9 3\\n1 3 1\\n4 5 3\\n\", \"2\\n4 6 1\\n5 7 1\\n\", \"5\\n2 10 5\\n4 7 2\\n3 3 1\\n0 1 1\\n4 6 1\\n\", \"1\\n1000 2001 1000\\n\", \"1\\n1000 2001 1000\\n\"], \"outputs\": [\"YES\\nYES\\nYES\\nYES\\nYES\", \"YES\\nYES\", \"YES\\nYES\\nYES\\nYES\\nYES\", \"YES\",...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The technology behind the fridge has changed little over the years. Even so, many of the original owners of the Fred W. Wolf domestic refrigerator of 1913 would be amazed by the size and features of the modern appliances. However, since the 1960s one thing has been common for all fridge owners aro...
code
{ "ground_truth": "{\"inputs\": [\"7129045863\\n\", \"55\\n\", \"123456789\\n\"], \"outputs\": [\"11\\n\", \"1\\n\", \"10\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Problem\n\nNanatsu has x Umaka sticks and y puffs.\n\nThere are n candy exchangers. Each exchanger i\n\n* Nanatsu-kun's Umaka stick ai book and exchanger's Fugashi bi book\n* Nanatsu-kun's Fugashi ci book and exchanger's pig meso di pieces\n\n\n\nIt will be exchanged only once by either one of the...
code
{ "ground_truth": "{\"inputs\": [\"4\\n10 0\\n5 1 1 1\\n2 1 2 1\\n4 1 1 1\\n3 1 3 1\", \"3\\n3 4\\n3 2 4 1\\n5 1 2 1\\n3 1 3 2\", \"3\\n3 4\\n3 1 3 1\\n3 1 4 1\\n3 1 3 1\", \"4\\n0 0\\n1 10 1 10\\n2 5 2 5\\n3 25 0 6\\n1 15 2 20\", \"4\\n0 1\\n1 10 1 10\\n2 5 4 5\\n2 25 0 6\\n1 24 2 20\", \"3\\n3 5\\n2 0 8 1\\n5 0 2 -...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "On the math lesson a teacher asked each pupil to come up with his own lucky numbers. As a fan of number theory Peter chose prime numbers. Bob was more original. He said that number t is his lucky number, if it can be represented as: \n\nt = a2 + b2, where a, b are arbitrary positive integers.\n\n...
code
{ "ground_truth": "{\"inputs\": [\"30000000 39149117\\n\", \"4587457 53343959\\n\", \"12453 60066316\\n\", \"13 13\\n\", \"17 163498014\\n\", \"7 54321\\n\", \"5 13\\n\", \"20000000 28474683\\n\", \"15 23\\n\", \"100 152262461\\n\", \"5 5\\n\", \"13 170334008\\n\", \"1 1\\n\", \"100000000 101000000\\n\", \"2 2\\n\", ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "This problem is actually a subproblem of problem G from the same contest.\n\nThere are $n$ candies in a candy box. The type of the $i$-th candy is $a_i$ ($1 \\le a_i \\le n$).\n\nYou have to prepare a gift using some of these candies with the following restriction: the numbers of candies of each t...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\n8\\n1 4 8 4 5 6 3 8\\n16\\n2 1 3 3 4 3 4 4 1 3 2 2 2 4 1 1\\n9\\n2 2 4 4 4 7 7 7 7\\n\"\n ],\n \"outputs\": [\n \"3\\n10\\n9\\n\"\n ]\n}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Mid semester exams are approaching and 'IDC' wants to study with the toppers of the batch.\nSo he decide to take a temporary room near all the toppers of the computer science batch.\n\nAll room are on a straight line and room numbers are integers. \nSince he is very lazy and doesnt want to walk. H...
code
{ "ground_truth": "{\"inputs\": [\"100\\n11\\n81 79 91 64 24 32 75 29 51 26 62\\n15\\n51 3 37 48 8 14 97 73 9 46 93 64 25 26 43\\n10\\n11 85 50 43 77 67 19 9 94 0\\n13\\n21 80 74 15 31 29 4 32 38 18 81 63 28\\n8\\n57 92 4 35 36 73 98 76\\n2\\n50 95\\n2\\n59 89\\n2\\n72 10\\n14\\n98 26 25 28 30 9 66 1 90 81 29 70 21 0...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Consider an array containing cats and dogs. Each dog can catch only one cat, but cannot catch a cat that is more than `n` elements away. Your task will be to return the maximum number of cats that can be caught.\n\nFor example:\n```Haskell\nsolve(['D','C','C','D','C'], 2) = 2, because the dog at i...
code
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[[\"D\", \"C\", \"C\", \"D\", \"C\"], 1], [[\"C\", \"C\", \"D\", \"D\", \"C\", \"D\"], 2], [[\"C\", \"C\", \"D\", \"D\", \"C\", \"D\"], 1], [[\"D\", \"C\", \"D\", \"C\", \"C\", \"D\"], 3], [[\"C\", \"C\", \"C\", \"D\", \"D\"], 3], [[\"C\", \"C\", \"C\", \"D\", ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "An NBA game runs 48 minutes (Four 12 minute quarters). Players do not typically play the full game, subbing in and out as necessary. Your job is to extrapolate a player's points per game if they played the full 48 minutes.\n\nWrite a function that takes two arguments, ppg (points per game) and mpg...
code
{ "ground_truth": "{\"fn_name\": \"nba_extrap\", \"inputs\": [[2, 5], [3, 9], [16, 27], [11, 19], [14, 33], [1, 7.5], [6, 13]], \"outputs\": [[19.2], [16.0], [28.4], [27.8], [20.4], [6.4], [22.2]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The main land of Japan called Honshu is an island surrounded by the sea. In such an island, it is natural to ask a question: \"Where is the most distant point from the sea?\" The answer to this question for Honshu was found in 1996. The most distant point is located in former Usuda Town, Nagano Pr...
code
{ "ground_truth": "{\"inputs\": [\"4\\n0 0\\n10000 0\\n10000 10000\\n0 10000\\n3\\n0 0\\n10010 0\\n7000 1000\\n6\\n0 40\\n100 20\\n250 40\\n250 70\\n100 90\\n0 70\\n3\\n0 0\\n10000 10000\\n5000 5001\\n0\", \"4\\n0 0\\n10000 0\\n10000 10000\\n0 10000\\n3\\n0 0\\n10010 0\\n7000 1000\\n6\\n0 40\\n100 20\\n250 40\\n250 7...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "How many different ways can you make change for an amount, given a list of coins? In this problem, your code will need to efficiently compute the answer.\n\nTask\n\nWrite a program that, given\n\nAn amount N and types of infinite available coins M.\n\nA list of M coins - C={C1,C2,C3,..,CM}\n\nPrin...
code
{ "ground_truth": "{\"inputs\": [\"4 3\\n1 2 3\\n\\nSAMPLE\", \"240 23\\n23 20 35 42 19 3 34 9 28 38 13 41 26 14 27 39 24 37 46 29 43 1 21\", \"4 3\\n1 2 3\", \"250 26\\n8 47 13 24 25 31 32 35 3 19 40 48 1 4 17 38 22 30 33 15 44 46 36 9 20 49\", \"240 23\\n23 20 35 42 19 3 34 9 28 38 13 41 26 14 27 39 24 52 46 29 43 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Takahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of cha...
code
{ "ground_truth": "{\"inputs\": [\"0 100\", \"30 100\", \"12 100\", \"-1 100\", \"15 100\", \"6 111\", \"9 100\", \"16 110\", \"17 101\", \"25 111\", \"59 011\", \"89 001\", \"30 010\", \"9 010\", \"1 100\", \"-2 100\", \"17 100\", \"2 100\", \"-2 000\", \"2 101\", \"0 000\", \"-2 001\", \"3 101\", \"0 001\", \"1 001...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A grid is a perfect starting point for many games (Chess, battleships, Candy Crush!).\n\nMaking a digital chessboard I think is an interesting way of visualising how loops can work together.\n\nYour task is to write a function that takes two integers `rows` and `columns` and returns a chessboard p...
code
{ "ground_truth": "{\"fn_name\": \"chess_board\", \"inputs\": [[1, 1], [1, 2], [2, 1], [2, 2], [6, 6]], \"outputs\": [[[[\"O\"]]], [[[\"O\", \"X\"]]], [[[\"O\"], [\"X\"]]], [[[\"O\", \"X\"], [\"X\", \"O\"]]], [[[\"O\", \"X\", \"O\", \"X\", \"O\", \"X\"], [\"X\", \"O\", \"X\", \"O\", \"X\", \"O\"], [\"O\", \"X\", \"O\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shrek's stars were to the right of the chimney and the Donkey's stars were to the left. Most days the Donke...
code
{ "ground_truth": "{\n \"inputs\": [\n \"15\\n1/3 2/1\\n3 1\\n6 2\\n4 2\\n2 5\\n4 5\\n6 6\\n3 4\\n1 6\\n2 1\\n7 4\\n9 3\\n5 3\\n1 3\\n15 5\\n12 4\\n\",\n \"15\\n2/1 2/0\\n3 1\\n6 2\\n9 3\\n12 4\\n15 5\\n2 1\\n4 2\\n5 3\\n7 4\\n1 3\\n3 4\\n2 5\\n4 5\\n1 6\\n6 6\\n\",\n \"15\\n2/1 2/0\\n3 1\\n6 2\\n9 3\\n12 4...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are a set of points S on the plane. This set doesn't contain the origin O(0, 0), and for each two distinct points in the set A and B, the triangle OAB has strictly positive area.\n\nConsider a set of pairs of points (P1, P2), (P3, P4), ..., (P2k - 1, P2k). We'll call the set good if and only...
code
{ "ground_truth": "{\"inputs\": [\"10\\n30 30 -26 26\\n0 15 -36 36\\n-28 28 -34 34\\n10 10 0 4\\n-8 20 40 50\\n9 45 12 30\\n6 15 7 35\\n36 45 -8 20\\n-16 34 -4 34\\n4 34 8 17\\n\", \"10\\n-46 46 0 36\\n0 20 -24 48\\n-50 50 -49 49\\n-20 50 8 40\\n-15 30 14 28\\n4 10 -4 5\\n6 15 8 10\\n-20 50 -3 15\\n4 34 -16 34\\n16 3...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are in the future. It's the time of autonomous cars. Switching lanes is a pretty difficult task for autonomous cars, and you have the logs from an experiment you had run with two cars. You want to verify whether the logs are corrupted, or could be valid.\nIn that experiment, you had a highway ...
code
{ "ground_truth": "{\"inputs\": [\"1\\n6\\n1 1 1 2 1\\n2 1 2 2 2\\n3 1 3 2 3\\n4 2 4 1 4\\n5 2 5 1 5\\n6 2 6 1 6\\n\", \"1\\n6\\n1 1 1 2 2\\n2 1 2 2 3\\n3 1 3 2 4\\n4 2 4 1 5\\n5 2 5 1 6\\n6 1 6 2 6\\n\", \"2\\n2\\n1 1 1 2 1\\n2 1 2 2 2\\n2\\n1 1 1 2 2\\n2 1 2 2 3\\n\", \"1\\n2\\n1 1 1 2 1\\n999999999 2 1000000000 1 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Vasya likes to solve equations. Today he wants to solve (x~div~k) ⋅ (x mod k) = n, where div and mod stand for integer division and modulo operations (refer to the Notes below for exact definition). In this equation, k and n are positive integer parameters, and x is a positive integer unknown. If ...
code
{ "ground_truth": "{\"inputs\": [\"1 2\\n\", \"4 6\\n\", \"6 3\\n\", \"2 2\\n\", \"22248 608\\n\", \"999995 1000\\n\", \"5 5\\n\", \"999002 457\\n\", \"2 997\\n\", \"999883 200\\n\", \"1 1000\\n\", \"1000000 2\\n\", \"996004 999\\n\", \"9 8\\n\", \"810000 901\\n\", \"1593 66\\n\", \"199942 1000\\n\", \"1000000 1000\\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The European Space Agency has $N$ telescopes observing distant planets. They have classified $M$ different types of events. They noticed that every day on each planet there is exactly one type of event. They measure events in days because they discovered each event lasts at least one day, and at m...
code
{ "ground_truth": "{\"inputs\": [\"1 1\\n26 02 03 03 1\\n\", \"1 1\\n26 02 03 03 2\\n\", \"3 3\\n22 03 01 10 9 10 10\\n05 05 16 12 1 7 10\\n20 06 15 01 4 9 10\\n\"], \"outputs\": [\"5\\n\", \"185\\n\", \"102 204 125\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Ancay youyay eakspay igpay atinlay? (Can you speak pig latin?) If you can’t, here are the rules:\n - If a word begins with a consonant, take all of the letters before the first vowel and move them to the end of the word, then add ay to the end of the word. Examples: pig $\\to $ igpay, there$\\to $...
code
{ "ground_truth": "{\"inputs\": [\"i cant speak pig latin\\n\", \"the quick brown fox\\njumps over the lazy dog\\nand ordinary foxes\\ndont jump over lazy dogs\\n\"], \"outputs\": [\"iyay antcay eakspay igpay atinlay\\n\", \"ethay uickqay ownbray oxfay\\numpsjay overyay ethay azylay ogday\\nandyay ordinaryyay oxesfay...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way.\n\nThere are $n$ ghosts in the universe, they move in the $OXY$ plane, each one of them has its own velocity that does not change in time: $\\overrightarrow{V} = V_{x}\\overrig...
code
{ "ground_truth": "{\"inputs\": [\"4 1 1\\n1 -1 -1\\n2 1 1\\n3 1 1\\n4 -1 -1\\n\", \"3 1 0\\n-1 1 0\\n0 0 -1\\n1 -1 -2\\n\", \"3 1 0\\n0 0 0\\n1 0 0\\n2 0 0\\n\", \"10 7 -626288749\\n795312099 49439844 266151109\\n-842143911 23740808 624973405\\n-513221420 -44452680 -391096559\\n-350963348 -5068756 -160670209\\n69088...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let X = 10^{100}. Inaba has N checker pieces on the number line, where the i-th checker piece is at coordinate X^{i} for all 1 \\leq i \\leq N.\n\nEvery second, Inaba chooses two checker pieces, A and B, and move A to the symmetric point of its current position with respect to B. After that, B is ...
code
{ "ground_truth": "{\"inputs\": [\"3\", \"4\", \"22\", \"6\", \"43\", \"11\", \"2\", \"1\", \"7\", \"10\", \"5\", \"12\", \"13\", \"8\", \"9\", \"19\", \"15\", \"26\", \"16\", \"17\", \"14\", \"18\", \"48\", \"20\", \"21\", \"32\", \"25\", \"34\", \"40\", \"27\", \"24\", \"35\", \"50\", \"30\", \"31\", \"23\", \"41\"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You will be given a list of 32 bit unsigned integers. Flip all the bits ($1\\rightarrow0$ and $\\textbf{0}\\rightarrow1$) and return the result as an unsigned integer. \n\nExample \n\n$n=9_{10}$ \n\n$\\textbf{9}_{10}=1\\textbf{001}_{2}$. We're working with 32 bits, so: \n\n$000000000000000000...
code
{ "ground_truth": "{\"inputs\": [\"3\\n2147483647\\n1\\n0\\n\", \"2\\n4\\n123456\\n\", \"3\\n0\\n802743475\\n35601423\\n\"], \"outputs\": [\"2147483648\\n4294967294\\n4294967295\\n\", \"4294967291\\n4294843839\\n\", \"4294967295\\n3492223820\\n4259365872\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A number N is represented in Linked List such that each digit corresponds to a node in linked list. You need to add 1 to it.\nExample 1:\nInput:\nLinkedList: 4->5->6\nOutput: 457 \nExample 2:\nInput:\nLinkedList: 1->2->3\nOutput: 124 \nYour Task:\nYour task is to complete the function addOne() whi...
code
{ "ground_truth": "{\"inputs\": [\"LinkedList:4->5->6\", \"LinkedList:1->2->3\"], \"outputs\": [\"457\", \"124\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up with such a problem.\n\nYou are given an array a consisting of n positive integers and queries to it. The queries can be of two types:\n\n 1. Make a unit cyclic shift ...
code
{ "ground_truth": "{\"inputs\": [\"8\\n8 4 2 2 7 7 8 8\\n8\\n1 8 8\\n2 8 1 7\\n1 8 1\\n1 7 3\\n2 8 8 3\\n1 1 4\\n1 2 7\\n1 4 5\\n\", \"7\\n6 6 2 7 4 2 5\\n7\\n1 3 6\\n2 2 4 2\\n2 2 4 7\\n2 2 2 5\\n1 2 6\\n1 1 4\\n2 1 7 3\\n\", \"10\\n7 2 3 4 3 2 4 4 9 1\\n10\\n1 4 5\\n1 1 6\\n1 3 10\\n1 5 7\\n2 5 8 5\\n2 6 7 7\\n2 1 ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "This is a hard version of the problem. In this version, the given array can contain equal elements and the constraints on $n$ are greater than in the easy version of the problem.\n\nYou are given an array $a$ of $n$ integers (the given array can contain equal elements). You can perform the followi...
code
{ "ground_truth": "{\n \"inputs\": [\n \"9\\n5\\n4 7 2 2 9\\n5\\n3 5 8 1 7\\n5\\n1 2 2 4 5\\n2\\n0 1\\n3\\n0 1 0\\n4\\n0 1 0 0\\n4\\n0 1 0 1\\n4\\n0 1 0 2\\n20\\n16 15 1 10 0 14 0 10 3 9 2 5 4 5 17 9 10 20 0 9\\n\"\n ],\n \"outputs\": [\n \"2\\n2\\n0\\n0\\n1\\n1\\n1\\n1\\n16\\n\"\n ]\n}", "style": "rule" ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You have a given picture with size w × h. Determine if the given picture has a single \"+\" shape or not. A \"+\" shape is described below:\n\n * A \"+\" shape has one center nonempty cell. \n * There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, d...
code
{ "ground_truth": "{\"inputs\": [\"3 7\\n.*...*.\\n***.***\\n.*...*.\\n\", \"5 10\\n..........\\n..*.......\\n.*.******.\\n..*.......\\n..........\\n\", \"5 6\\n......\\n..*...\\n.****.\\n..*...\\n..*...\\n\", \"3 5\\n..*..\\n****.\\n.*...\\n\", \"5 6\\n..**..\\n..**..\\n******\\n..**..\\n..**..\\n\", \"7 7\\n..........
{ "index": 0, "split": "dummy" }
taco
[ { "content": "# Description:\n\n Count the number of exclamation marks and question marks, return the product.\n\n# Examples\n\n```\nProduct(\"\") == 0\nproduct(\"!\") == 0\nProduct(\"!ab? ?\") == 2\nProduct(\"!!\") == 0\nProduct(\"!??\") == 2\nProduct(\"!???\") == 3\nProduct(\"!!!??\") == 6\nProduct(\"!!!???\"...
code
{ "ground_truth": "{\"fn_name\": \"product\", \"inputs\": [[\"\"], [\"!\"], [\"!!??!!\"]], \"outputs\": [[0], [0], [8]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Chef is looking to buy a TV and has shortlisted two models. The first one costs A rupees, while the second one costs B rupees.\n\nSince there is a huge sale coming up on Chefzon, Chef can get a flat discount of C rupees on the first TV, and a flat discount of D rupees on the second one.\n\nHelp Ch...
code
{ "ground_truth": "{\"inputs\": [\"5\\n40 100 0 40\\n68 67 0 0\\n60 80 10 20\\n77 55 33 11\\n40 50 5 5\\n\", \"5\\n1 1 0 0\\n1 100 1 50\\n1 2 1 0\\n2 2 0 0\\n2 3 1 1\\n\", \"1\\n1 2 1 1\\n\"], \"outputs\": [\"First\\nSecond\\nFirst\\nAny\\nFirst\", \"Any\\nFirst\\nFirst\\nAny\\nFirst\", \"First\"]}", "style": "rule...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you probably know, he found himself in year 2084, and buying kefir there is much more complicated.\n\nKolya is hungry, so he went to the nearest milk shop. In 2084 you...
code
{ "ground_truth": "{\"inputs\": [\"10\\n11\\n9\\n8\\n\", \"10\\n5\\n6\\n1\\n\", \"10\\n5\\n10\\n1\\n\", \"999999999999999999\\n2\\n50000000000000000\\n49999999999999999\\n\", \"10\\n5\\n5\\n1\\n\", \"100\\n10\\n10\\n9\\n\", \"1001\\n1000\\n1000\\n999\\n\", \"10\\n4\\n14\\n13\\n\", \"10\\n1\\n2\\n1\\n\", \"10\\n20\\n1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "## Task:\n\nYou have to write a function `pattern` which returns the following Pattern(See Examples) upto n number of rows. \n\n* Note:```Returning``` the pattern is not the same as ```Printing``` the pattern.\n\n### Rules/Note:\n\n* The pattern should be created using only unit digits.\n* If `n <...
code
{ "ground_truth": "{\"fn_name\": \"pattern\", \"inputs\": [[1], [2], [3], [7], [17], [27], [0], [-89]], \"outputs\": [[\"1\"], [\"22\\n21\"], [\"333\\n322\\n321\"], [\"7777777\\n7666666\\n7655555\\n7654444\\n7654333\\n7654322\\n7654321\"], [\"77777777777777777\\n76666666666666666\\n76555555555555555\\n765444444444444...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "We have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the r...
code
{ "ground_truth": "{\"inputs\": [\"2 3 3\\n2 2\\n1 1\\n1 3\\n\", \"3 3 4\\n3 3\\n3 1\\n1 1\\n1 2\\n\", \"5 5 10\\n2 5\\n4 3\\n2 3\\n5 5\\n2 2\\n5 4\\n5 3\\n5 1\\n3 5\\n1 4\\n\"], \"outputs\": [\"3\\n\", \"3\\n\", \"6\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Does the card fit in a snack? (Are Cards Snacks?)\n\nsquare1001 You have $ N $ cards.\n\nEach of these cards has an integer written on it, and the integer on the $ i $ th card is $ A_i $.\n\nsquare1001 Your random number today is $ K $. square1001 You want to choose some of these $ N $ cards so th...
code
{ "ground_truth": "{\"inputs\": [\"5 9\\n8 6 9 1 2\", \"7 9\\n8 6 9 1 2\", \"7 9\\n8 6 12 1 2\", \"7 9\\n8 6 12 2 0\", \"7 1\\n2 8 -1 1 1\", \"7 9\\n8 6 12 1 0\", \"7 9\\n8 6 23 2 0\", \"7 9\\n13 6 23 2 0\", \"7 9\\n21 6 23 2 0\", \"7 9\\n18 6 23 2 0\", \"7 9\\n18 6 39 2 0\", \"7 9\\n18 6 62 2 0\", \"7 9\\n18 6 37 2 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as “Western calendar” in Japan.\n\nThe other calendar system is era-based calendar, or so-called “Japanese calendar.” This system c...
code
{ "ground_truth": "{\"inputs\": [\"4 3\\nmeiji 10 1877\\ntaisho 6 1917\\nshowa 62 1987\\nheisei 22 2010\\n2046\\n1917\\n1988\\n1 1\\nuniversalcentury 123 2168\\n2010\\n0 0\", \"4 3\\nmeiji 10 1877\\ntaisho 6 1917\\nshowa 62 1987\\ngeisei 22 2010\\n1868\\n1917\\n1988\\n1 1\\nuniversalcentury 123 2168\\n2010\\n0 0\", \...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Kuro and Walking Route\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nKuro is living in a country called Uberland, consisting of $n$ towns, numbered from $1$ to $n$, and $n - 1$ bidirectional roads connecting these towns. It is possible to reach each to...
code
{ "ground_truth": "{\"inputs\": [\"3 1 3\\n1 2\\n2 3\", \"3 1 3\\n1 2\\n1 3\", \"61 26 12\\n33 38\\n32 8\\n27 59\\n1 21\\n61 57\\n61 22\\n35 18\\n61 14\\n39 56\\n50 10\\n1 42\\n21 43\\n61 41\\n31 30\\n35 9\\n23 28\\n39 34\\n39 4\\n39 25\\n27 60\\n45 51\\n1 11\\n35 26\\n29 15\\n23 44\\n31 2\\n35 27\\n39 20\\n1 24\\n1 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.\n\nConstraints\n\n* 2\\leq K\\leq 100\n* K is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nK\n...
code
{ "ground_truth": "{\"inputs\": [\"6\", \"50\", \"11\", \"3\", \"2\", \"59\", \"14\", \"0\", \"104\", \"7\", \"4\", \"51\", \"5\", \"10\", \"89\", \"-3\", \"17\", \"118\", \"20\", \"84\", \"-9\", \"35\", \"13\", \"-6\", \"8\", \"26\", \"27\", \"-12\", \"36\", \"42\", \"-11\", \"67\", \"-29\", \"105\", \"-16\", \"96\"...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: LCM Challenge\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it.\n\nBut I also don't want to use many numbers...
code
{ "ground_truth": "{\"inputs\": [\"9\", \"7\", \"1\", \"5\", \"6\", \"33\", \"21\", \"2\", \"41\", \"29\", \"117\", \"149\", \"733\", \"925\", \"509\", \"829\", \"117\", \"605\", \"245\", \"925\", \"213\", \"53\", \"341\", \"21\", \"605\", \"149\", \"733\", \"117\", \"53\", \"245\", \"829\", \"924\", \"508\", \"700\"...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "See Russian Translation\n\nW.T.H.S.E.C\n\nConfused? Well it stands for Welcome To HackerEarth September Easy Challenge :). It's quite amazing when long words like this get reduced to such a short string. They sound pretty cool and often make the chat interesting. They are almost used everywhere th...
code
{ "ground_truth": "{\"inputs\": [\"5\\nhey\\ngirls\\ni\\nam\\nsingle\\n11\\nhey all boys and girls welcome to hackerearth easy september challenge\\n\\nSAMPLE\", \"6\\ncagquf\\nto\\nc\\np\\nzmip\\nkexdlsqa\\n15\\nkdtu cagquf se akrhnsxv kexdlsqa eeht ukiphhmlp kexdlsqa ftntpjvtt cagquf owpkjjuk zqq ucyruqjy p yf\", \...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Petya had a tree consisting of n vertices numbered with integers from 1 to n. Accidentally he lost his tree. \n\nPetya remembers information about k vertices: distances from each of them to each of the n tree vertices.\n\nYour task is to restore any tree that satisfies the information that Petya r...
code
{ "ground_truth": "{\"inputs\": [\"5 2\\n0 1 2 3 2\\n2 1 0 1 2\\n\", \"3 1\\n1 2 1\\n\", \"10 5\\n1 2 2 2 2 0 2 2 3 2\\n1 2 2 0 2 2 2 2 3 2\\n2 3 3 3 3 3 1 3 0 3\\n0 1 1 1 1 1 1 1 2 1\\n1 2 2 2 2 2 2 0 3 2\\n\", \"40 4\\n5 3 3 8 3 3 5 0 9 11 3 7 10 10 9 4 8 11 5 2 7 4 6 6 8 4 6 6 8 9 10 7 10 8 1 4 2 4 1 3\\n5 5 11 6 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You just bought an “artistic” aquarium tank that has an interesting shape, and you poured $L$ litres of water into the tank. How high is the water in the tank?\n\nWhen you look at this tank from one side, it has the shape of a convex polygon. This polygon has exactly two vertices on the table ($y$...
code
{ "ground_truth": "{\"inputs\": [\"4\\n30 50\\n20 0\\n100 0\\n100 40\\n20 40\\n\", \"9\\n30 70\\n110 70\\n100 80\\n80 80\\n-10 60\\n-40 30\\n-40 25\\n20 0\\n100 0\\n120 10\\n\"], \"outputs\": [\"20.83\\n\", \"19.74\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Your goal is to return multiplication table for ```number``` that is always an integer from 1 to 10.\n\nFor example, a multiplication table (string) for ```number == 5``` looks like below:\n\n```\n1 * 5 = 5\n2 * 5 = 10\n3 * 5 = 15\n4 * 5 = 20\n5 * 5 = 25\n6 * 5 = 30\n7 * 5 = 35\n8 * 5 = 40\n9 * 5 ...
code
{ "ground_truth": "{\"fn_name\": \"multi_table\", \"inputs\": [[5], [1]], \"outputs\": [[\"1 * 5 = 5\\n2 * 5 = 10\\n3 * 5 = 15\\n4 * 5 = 20\\n5 * 5 = 25\\n6 * 5 = 30\\n7 * 5 = 35\\n8 * 5 = 40\\n9 * 5 = 45\\n10 * 5 = 50\"], [\"1 * 1 = 1\\n2 * 1 = 2\\n3 * 1 = 3\\n4 * 1 = 4\\n5 * 1 = 5\\n6 * 1 = 6\\n7 * 1 = 7\\n8 * 1 = ...
{ "index": 0, "split": "dummy" }