data_source stringclasses 3
values | prompt listlengths 1 1 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 1\\n-5 5 0 20\\n10\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n-2000 -2000\\n3998000 4000000\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n614 -1943\\n3874445\\n\", \"output\": \"2\\n\"}, {\... | {
"index": 5394,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nIn this Kata, you will be given a string and your task is to determine if that string can be a palindrome if we rotate one or more characters to the left.\n\n```Haskell\nsolve(\"4455\") = true, because after 1 rotation, we get \"5445\" which is a palind... | code | {
"ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[\"aaab\"], [\"abcabc\"], [\"4455\"], [\"zazcbaabc\"], [\"223456776543\"], [\"432612345665\"], [\"qponmlkjihgfeeiefghijklmnopqrsttsr\"]], \"outputs\": [[false], [false], [true], [true], [true], [false], [false]]}",
"style": "rule"
} | {
"index": 2206,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the speed skating badge test, grades are awarded when the time specified for two distances is exceeded. For example, to reach Class A, 500 M requires less than 40.0 seconds and 1000 M requires less than 1 minute and 23... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"40.0 70.15273874709118\\n72.5 140.51\", \"output\": \"B\\nNA\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"43.236780306897465 72.47791800727414\\n76.48007184592961 143.3245253779178\", \"output\": \"C\\nNA\\n\"}, {\"type\": \"stdin_stdout\", \"input\": ... | {
"index": 13746,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nComplete the function that takes an array of words.\n\nYou must concatenate the `n`th letter from each word to construct a new word which should be returned as a string, where `n` is the position of the word in the list.\... | code | {
"ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"nth_char\", \"input\": [[\"yoda\", \"best\", \"has\"]], \"output\": [\"yes\"]}, {\"type\": \"function_call\", \"fn_name\": \"nth_char\", \"input\": [[]], \"output\": [\"\"]}, {\"type\": \"function_call\", \"fn_name\": \"nth_char\", \"input\": [[\"X-ray\... | {
"index": 11680,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nRoman and Denis are on the trip to the programming competition. Since the trip was long, they soon got bored, and hence decided to came up with something. Roman invented a pizza's recipe, while Denis invented a string mul... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\na\\nb\\na\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\nbnn\\na\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\nw\\ng\\nc\\nj\\ny\\nf\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"in... | {
"index": 1441,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYaroslav is playing a game called \"Time\". The game has a timer showing the lifespan he's got left. As soon as the timer shows 0, Yaroslav's character dies and the game ends. Also, the game has n clock stations, station ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 1000\\n1000\\n0 0\\n0 1\\n0 3\\n\", \"output\": \"2000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 1000\\n1000\\n1 0\\n1 1\\n1 2\\n\", \"output\": \"1000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1421\\n896 448 727\\n-19 -40\\n-87 40\\n69... | {
"index": 24,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThe New Vasjuki village is stretched along the motorway and that's why every house on it is characterized by its shift relative to some fixed point — the xi coordinate. The village consists of n houses, the i-th house is ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n10003 10004 10001 10002 1\\n\", \"output\": \"0.500000\\n1.500000 10001.500000 10003.500000 \"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 2 3 4\\n\", \"output\": \"0.500000\\n1.500000 3.500000 3.500000\\n\"}, {\"type\": \"stdin_stdout\", \"input... | {
"index": 9215,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nAlice gave Bob two integers $a$ and $b$ ($a > 0$ and $b \\ge 0$). Being a curious boy, Bob wrote down an array of non-negative integers with $\\operatorname{MEX}$ value of all elements equal to $a$ and $\\operatorname{XOR}$ value of all elements equal t... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1 1\\n2 1\\n2 0\\n1 10000\\n2 10000\\n\", \"1\\n187994 180766\\n\", \"1\\n187994 180766\\n\", \"1\\n187994 204747\\n\", \"1\\n246904 204747\\n\", \"1\\n85497 204747\\n\", \"1\\n131971 84448\\n\", \"1\\n234010 8121\\n\", \"1\\n276349 15514\\n\", \"1\\n66857 12385\\n\", \"1\\n8012... | {
"index": 1494,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a permutation p of n integers 1, 2, ..., n (a permutation is an array where each element from 1 to n occurs exactly once).\n\nLet's call some subsegment p[l, r] of this permutation special if p_l + p_r = max... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 2\\n\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n3 4 1 5 2\\n\", \"output\": \"2\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n2 3 1\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n3 2 1\\n\",... | {
"index": 7970,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nFind a cycle in a directed graph G(V, E).\n\nConstraints\n\n* 1 ≤ |V| ≤ 100\n* 0 ≤ |E| ≤ 1,000\n* si ≠ ti\n\nInput\n\nA directed graph G is given in the following format:\n\n\n|V| |E|\ns0 t0\ns1 t1\n:\ns|E|-1 t|E|-1\n\n\n|V| is the number of nodes and |... | code | {
"ground_truth": "{\"inputs\": [\"5 3\\n0 1\\n0 2\\n1 2\", \"8 3\\n0 1\\n0 2\\n1 2\", \"8 3\\n0 2\\n0 2\\n1 2\", \"5 3\\n0 2\\n0 2\\n1 2\", \"11 3\\n0 1\\n0 2\\n1 2\", \"8 2\\n0 1\\n0 2\\n1 2\", \"8 3\\n1 2\\n0 2\\n1 2\", \"8 2\\n0 1\\n0 2\\n1 4\", \"8 2\\n0 1\\n0 2\\n2 4\", \"8 2\\n0 2\\n0 2\\n2 4\", \"8 1\\n0 2\\n... | {
"index": 869,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nAlexandra has a paper strip with n numbers on it. Let's call them a_{i} from left to right.\n\nNow Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:\n\n\n\n Each piece should contain at least l numbers.... | code | {
"ground_truth": "{\"inputs\": [\"7 2 2\\n1 3 1 2 4 1 2\\n\", \"7 2 2\\n1 100 1 100 1 100 1\\n\", \"1 0 1\\n0\\n\", \"6 565 2\\n31 76 162 -182 -251 214\\n\", \"1 0 1\\n0\\n\", \"1 0 1\\n-1000000000\\n\", \"1 100 2\\n42\\n\", \"2 1000000000 1\\n-1000000000 1000000000\\n\", \"2 1000000000 2\\n-1000000000 1000000000\\n... | {
"index": 4919,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nWrite 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\nInpu... | code | {
"ground_truth": "{\"inputs\": [\"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\\n8 8 8\", \"3\\n4 3 5\\n-2 3 6... | {
"index": 126,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nBeing a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determined to rearrange them. But there are ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7 7\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 3\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"999999999997 499999999998\\n\", \"output\": \"999999999995\\n\"}, {\"type\": \"stdin_stdout\", \"input\":... | {
"index": 7171,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nWrite a program which reads the two dices constructed in the same way as Dice I, and determines whether these two dices are identical. You can roll a dice in the same way as Dice I, and if all integers observed from the six directions are the same as th... | code | {
"ground_truth": "{\"inputs\": [\"1 2 3 2 5 6\\n6 5 4 3 2 1\", \"1 2 3 2 5 6\\n6 1 4 3 2 1\", \"1 2 3 2 5 6\\n6 0 4 3 2 1\", \"1 2 3 2 5 6\\n6 0 4 3 4 1\", \"1 2 3 2 7 6\\n6 0 4 3 4 1\", \"1 2 3 2 7 3\\n6 0 4 3 4 1\", \"1 2 2 2 7 6\\n6 0 4 3 4 1\", \"1 2 2 2 7 9\\n6 0 4 3 4 1\", \"1 2 2 2 7 9\\n6 0 4 5 4 1\", \"1 0 ... | {
"index": 6616,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThe year of 2012 is coming...\n\nAccording to an ancient choradrican legend in this very year, in 2012, Diablo and his brothers Mephisto and Baal will escape from hell, and innumerable hordes of demons will enslave the hu... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\nAnka likes Troll\\nTroll likes Chapay\\nTroll likes Hexadecimal\\nHexadecimal likes Cleo\\nSnowy likes Hexadecimal\\nChapay likes Troll\\n740076959 230477703 987799796\\n\", \"output\": \"98788895 5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"12\\... | {
"index": 10056,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nKatie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems.\n\nToday is Shiro's birthday. She really loves pizza so she wants... | code | {
"ground_truth": "{\"inputs\": [\"3\\n\", \"4\\n\", \"10\\n\", \"10000000000\\n\", \"1234567891\\n\", \"7509213957\\n\", \"99999999999999999\\n\", \"21\\n\", \"712394453192\\n\", \"172212168\\n\", \"822981260158260519\\n\", \"28316250877914571\\n\", \"779547116602436424\\n\", \"578223540024979436\\n\", \"33540891786... | {
"index": 1303,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\n-----Problem Statement-----\nChef studies combinatorics. He tries to group objects by their rang (a positive integer associated with each object). He also gives the formula for calculating the number of different objects with rang N as following:\n\nthe... | code | {
"ground_truth": "{\"inputs\": [[\"4\", \"1 0 0 0\", \"1\", \"1 0 0 0\", \"3\", \"0 1 0 0\", \"2\", \"2 3 1 4\", \"10\"], \"4\\n1 0 0 0\\n1\\n1 0 0 0\\n3\\n0 1 0 0\\n2\\n2 3 1 4\\n12\", \"4\\n1 0 0 0\\n1\\n1 0 0 0\\n3\\n0 1 0 0\\n2\\n3 3 1 4\\n10\", \"4\\n2 0 0 0\\n1\\n1 0 0 0\\n3\\n0 1 0 0\\n2\\n2 3 1 4\\n12\", \"4... | {
"index": 2120,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro and Hanako have numbers of cards in their hands. Each of the cards has a score on it. Taro and Hanako wish to make the total scores of their cards equal by exchanging one card in one's hand with one card in the other... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 2\\n1\\n5\\n3\\n7\\n6 5\\n3\\n9\\n5\\n2\\n3\\n3\\n12\\n2\\n7\\n3\\n5\\n4 5\\n10\\n0\\n3\\n8\\n1\\n9\\n6\\n0\\n6\\n7 4\\n1\\n1\\n2\\n1\\n2\\n1\\n4\\n2\\n3\\n4\\n3\\n2 3\\n1\\n1\\n2\\n2\\n2\\n0 0\", \"output\": \"1 3\\n3 5\\n-1\\n2 2\\n-1\"}, {\"type\": \"... | {
"index": 4086,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nPetya's friends made him a birthday present — a bracket sequence. Petya was quite disappointed with his gift, because he dreamed of correct bracket sequence, yet he told his friends nothing about his dreams and decided to fix present himself. \n\nTo mak... | code | {
"ground_truth": "{\"inputs\": [\"2\\n)(\\n\", \"3\\n(()\\n\", \"2\\n()\\n\", \"10\\n)))))(((((\\n\", \"1\\n)\\n\", \"1\\n(\\n\", \"98\\n()()(((((((())))(((()))))(())(())()()(())())))))((()()()))()(((()))()()())((())(((()(((())))()))))\\n\", \"100\\n(()()((((())()()(()()())())))((((())(((()))()()()((()))(())))((()()... | {
"index": 7228,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users with rating 1900 or higher. Those with rating 1899 or lower be... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n-7 1\\n5 2\\n8 2\\n\", \"output\": \"1907\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n57 1\\n22 2\\n\", \"output\": \"Impossible\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n-5 1\\n\", \"output\": \"Infinity\\n\"}, {\"type\": \"stdin_s... | {
"index": 844,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nA girl named Sonya is studying in the scientific lyceum of the Kingdom of Kremland. The teacher of computer science (Sonya's favorite subject!) invented a task for her.\n\nGiven an array $a$ of length $n$, consisting only... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 2\\n0 1 0\\n\", \"output\": \"333333336\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1\\n1 1 1 0 0\\n\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 4\\n1 0 0 1 1 0\\n\", \"output\": \"968493834\"}, {\"type\": \"stdin_stdout\", \"i... | {
"index": 360,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nBob has a server farm crunching numbers. He has `nodes` servers in his farm. His company has a lot of work to do. \n\nThe work comes as a number `workload` which indicates how many jobs there are. Bob wants his servers to get an equal number of jobs eac... | code | {
"ground_truth": "{\"fn_name\": \"distribute\", \"inputs\": [[2, 4], [3, 3], [3, 9], [2, 5], [4, 10], [4, 5], [1, 1], [2, 1], [5, 4], [5, 1]], \"outputs\": [[[[0, 1], [2, 3]]], [[[0], [1], [2]]], [[[0, 1, 2], [3, 4, 5], [6, 7, 8]]], [[[0, 1, 2], [3, 4]]], [[[0, 1, 2], [3, 4, 5], [6, 7], [8, 9]]], [[[0, 1], [2], [3],... | {
"index": 2556,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists.\n\n* Let s' be the concatenation ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"contest\\nsentence\", \"output\": \"33\"}, {\"type\": \"stdin_stdout\", \"input\": \"contest\\nson\", \"output\": \"10\"}, {\"type\": \"stdin_stdout\", \"input\": \"contest\\nprogramming\", \"output\": \"-1\"}, {\"type\": \"stdin_stdout\", \"input\": \"ton... | {
"index": 7187,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nGrigoriy, like the hero of one famous comedy film, found a job as a night security guard at the museum. At first night he received embosser and was to take stock of the whole exposition.\n\nEmbosser is a special devise that allows to \"print\" the text ... | code | {
"ground_truth": "{\"inputs\": [\"zeus\\n\", \"map\\n\", \"ares\\n\", \"l\\n\", \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv\\n\", \"gngvi\\n\", \"aaaaa\\n\", \"a\\n\", \"z\\n\", \"vyadeehhikklnoqrs\\n\", \"jjiihhhhgggfedcccbazyxx\\n\", \"fyyptqqxuciqvwdewypp... | {
"index": 2320,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThe new £5 notes have been recently released in the UK and they've certainly became a sensation! Even those of us who haven't been carrying any cash around for a while, having given in to the convenience of cards, suddenl... | code | {
"ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"get_new_notes\", \"input\": [2000, [500, 160, 400]], \"output\": [188]}, {\"type\": \"function_call\", \"fn_name\": \"get_new_notes\", \"input\": [1260, [500, 50, 100]], \"output\": [122]}, {\"type\": \"function_call\", \"fn_name\": \"get_new_notes\", \... | {
"index": 12615,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nNatasha's favourite numbers are $n$ and $1$, and Sasha's favourite numbers are $m$ and $-1$. One day Natasha and Sasha met and wrote down every possible array of length $n+m$ such that some $n$ of its elements are equal to $1$ and another $m$ elements a... | code | {
"ground_truth": "{\"inputs\": [\"0 2\\n\", \"2 0\\n\", \"2 2\\n\", \"2000 2000\\n\", \"0 0\\n\", \"11 2\\n\", \"1 4\\n\", \"5 13\\n\", \"60 59\\n\", \"27 16\\n\", \"1134 1092\\n\", \"756 1061\\n\", \"953 1797\\n\", \"76 850\\n\", \"24 1508\\n\", \"1087 1050\\n\", \"149 821\\n\", \"983 666\\n\", \"45 1323\\n\", \"19... | {
"index": 6627,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nIs the number even?\n\nIf the numbers is even return `true`. If it's odd, return `false`. \n\n\nOh yeah... the following symbols/commands have been disabled!\n\n use of ```%```\n use of ```.even?``` in Ruby\n use of ```mo... | code | {
"ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"is_even\", \"input\": [2], \"output\": [true]}, {\"type\": \"function_call\", \"fn_name\": \"is_even\", \"input\": [3], \"output\": [false]}, {\"type\": \"function_call\", \"fn_name\": \"is_even\", \"input\": [14], \"output\": [true]}, {\"type\": \"func... | {
"index": 11287,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's denote that some array $b$ is bad if it contains a subarray $b_l, b_{l+1}, \\dots, b_{r}$ of odd length more than $1$ ($l < r$ and $r - l + 1$ is odd) such that $\\forall i \\in \\{0, 1, \\dots, r - l\\}$ $b_{l + i}... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 3\\n-1 -1\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 2\\n1 -1 -1 1 2\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 3\\n1 -1 -1 1 2\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\... | {
"index": 1412,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nThe fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path and encode it. In this problem, we don’t discuss about details of the algorithm, but you are asked to make simple pro- gram. You are given sing... | code | {
"ground_truth": "{\"inputs\": [\"3\\n7\\n0\", \"3\\n3\\n0\", \"3\\n0\\n0\", \"3\\n1\\n0\", \"3\\n2\\n0\", \"3\\n-1\\n0\", \"3\\n5\\n0\", \"3\\n8\\n0\", \"3\\n6\\n0\", \"3\\n9\\n0\", \"3\\n0\\n-1\", \"3\\n0\\n1\", \"3\\n0\\n-2\", \"3\\n0\\n2\", \"3\\n0\\n-4\", \"3\\n0\\n-5\", \"3\\n0\\n3\", \"3\\n0\\n-3\", \"3\\n0\\... | {
"index": 3320,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nRecently Chef bought a bunch of robot-waiters. And now he needs to know how much to pay for the electricity that robots use for their work. All waiters serve ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n3 3\\n3 4\", \"output\": \"6\\n7\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n3 3\\n3 0\", \"output\": \"6\\n7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n5 3\\n3 0\", \"output\": \"10\\n7\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"... | {
"index": 15191,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nBizon the Champion isn't just attentive, he also is very hardworking.\n\nBizon the Champion decided to paint his old fence his favorite color, orange. The fence is represented as n vertical planks, put in a row. Adjacent planks have no gap between them.... | code | {
"ground_truth": "{\"inputs\": [\"5\\n2 2 1 2 1\\n\", \"2\\n2 2\\n\", \"1\\n5\\n\", \"5\\n2 2 1 2 2\\n\", \"5\\n2 2 1 5 1\\n\", \"1\\n1\\n\", \"1\\n1000000000\\n\", \"2\\n999635584 999595693\\n\", \"10\\n3 3 6 4 2 3 2 2 3 3\\n\", \"14\\n1 1 3 1 1 4 4 4 4 4 4 4 4 4\\n\", \"6\\n100 100 100 100 100 1\\n\", \"7\\n5 5 1 ... | {
"index": 7282,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nToday is August 24, one of the five Product Days in a year.\n\nA date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day a... | code | {
"ground_truth": "{\"inputs\": [\"15 38\", \"0 1\", \"16 38\", \"16 57\", \"16 94\", \"12 94\", \"12 28\", \"19 28\", \"6 27\", \"12 25\", \"9 48\", \"12 39\", \"26 38\", \"24 94\", \"6 42\", \"30 32\", \"14 68\", \"5 37\", \"31 48\", \"22 79\", \"21 38\", \"21 94\", \"24 51\", \"18 58\", \"21 63\", \"12 51\", \"0 0... | {
"index": 3414,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a fence consisting of n vertical boards. The width of each board is 1. The height of the i-th board is a_i. You think that the fence is great if there is no pair of adjacent boards having the same height. More fo... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n3\\n2 4\\n2 1\\n3 5\\n3\\n2 3\\n2 10\\n2 6\\n4\\n1 7\\n3 3\\n2 6\\n1000000000 2\\n\", \"output\": \"2\\n9\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n3\\n2 4\\n2 1\\n3 5\\n3\\n2 3\\n2 2\\n2 6\\n4\\n1 7\\n3 3\\n2 6\\n1000000000 2\\n\", \"ou... | {
"index": 5162,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nLook for the Winner!\n\nThe citizens of TKB City are famous for their deep love in elections and vote counting. Today they hold an election for the next chairperson of the electoral commission. Now the voting has just been closed and the counting is goi... | code | {
"ground_truth": "{\"inputs\": [\"1\\nA\\n4\\nA A B B\\n5\\nL M N L N\\n6\\nK K K K K K\\n6\\nX X X Y Z X\\n10\\nA A A B A C A C C B\\n10\\nV U U U U V V W W W\\n0\", \"1\\nA\\n4\\nA A B B\\n5\\nL M N L N\\n6\\nK K K K K K\\n6\\nX X X Y Z X\\n10\\nA A A B A C A C C B\\n10\\nV U U U U V V W V W\\n0\", \"1\\nA\\n4\\nA... | {
"index": 5409,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya bought the collected works of a well-known Berland poet Petya in n volumes. The volumes are numbered from 1 to n. He thinks that it does not do to arrange the book simply according to their order. Vasya wants to min... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"2 3 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n\", \"output\": \"2 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"98\\n\", \"output\": \"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 ... | {
"index": 6185,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nRupsa recently started to intern under Chef. He gave her N type of ingredients of varying quantity A_{1}, A_{2}, ..., A_{N} respectively to store it. But as she is lazy to arrange them she ... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2\\n2 2\\n1\\n6\", \"2\\n2\\n2 1\\n1\\n6\", \"2\\n2\\n2 2\\n1\\n8\", \"2\\n2\\n4 2\\n1\\n6\", \"2\\n1\\n2 1\\n1\\n1\", \"2\\n3\\n3 2\\n1\\n8\", \"2\\n3\\n4 2\\n0\\n1\", \"2\\n3\\n4 7\\n0\\n6\", \"2\\n3\\n5 2\\n0\\n2\", \"2\\n4\\n4 9\\n0\\n6\", \"2\\n6\\n4 11\\n0\\n6\", \"2\\n0\\... | {
"index": 5911,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nYou're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).\n\nInput\n\nThe first input line contains the st... | code | {
"ground_truth": "{\"inputs\": [\"ipsrjylhpkjvlzncfixipstwcicxqygqcfrawpzzvckoveyqhathglblhpkjvlzncfixipfajaqobtzvthmhgbuawoxoknirclxg\\n\", \"ttketfkefktfztezzkzfkkeetkkfktftzktezekkeezkeeetteeteefetefkzzzetekfftkeffzkktffzkzzeftfeezfefzffeef\\n\", \"ovovhoovvhohhhvhhvhhvhovoohovhhoooooovohvooooohvvoooohvvovhhvhovh... | {
"index": 2191,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nTokyo has a very complex railway system. For example, there exists a partial map of lines and stations as shown in Figure D-1.\n\n<image>\n\nFigure D-1: A sample railway network\n\n\nSuppose you are going to station D fro... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 4 2 1 4\\n1 2 2 1\\n2 3 2 1\\n3 4 5 1\\n2 4 4 2\\n3 1\\n3 6\\n10 5 3\\n\\n10\\n2 0 1 1 2\\n1\\n\\n1\\n4 5 2 4 1\\n4 3 10 1\\n3 2 2 1\\n3 2 1 2\\n3 2 5 2\\n2 1 10 1\\n3 3\\n20 30\\n3 2 1\\n5 10\\n3 2 1\\n5 5 2 1 5\\n1 2 10 2\\n1 3 20 2\\n2 4 20 1\\n3 4 10... | {
"index": 8816,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nOne day the Codeforces round author sat exams. He had n exams and he needed to get an integer from 2 to 5 for each exam. He will have to re-sit each failed exam, i.e. the exam that gets mark 2. \n\nThe author would need to spend too much time and effort... | code | {
"ground_truth": "{\"inputs\": [\"44 173\\n\", \"13 32\\n\", \"50 234\\n\", \"25 106\\n\", \"16 70\\n\", \"13 57\\n\", \"45 104\\n\", \"50 250\\n\", \"36 99\\n\", \"1 2\\n\", \"50 100\\n\", \"20 69\\n\", \"47 128\\n\", \"7 20\\n\", \"29 116\\n\", \"17 73\\n\", \"1 5\\n\", \"5 15\\n\", \"36 155\\n\", \"21 73\\n\", \"... | {
"index": 2358,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nDescription\n\nF, who likes to dance, decided to practice a hardcore dance called JUMP STYLE at a certain dance hall.\n\nThe floor is tiled in an N × N grid. To support the dance practice, each tile has the coordinates of the tile to jump to the next st... | code | {
"ground_truth": "{\"inputs\": [\"1\\n0 0\\n2\\n1 1 0 1\\n1 0 0 0\\n2\\n1 1 0 1\\n1 1 1 0\\n3\\n0 1 2 2 2 0\\n0 2 1 2 2 1\\n0 0 0 1 1 1\\n4\\n3 2 2 0 3 2 2 1\\n1 1 0 3 1 1 3 1\\n0 3 2 3 3 0 2 3\\n1 1 1 1 3 2 1 3\\n0\", \"1\\n0 0\\n2\\n1 1 0 1\\n1 0 0 0\\n2\\n1 1 0 1\\n1 1 1 0\\n3\\n0 1 2 2 2 0\\n0 2 1 2 2 1\\n0 0 0 ... | {
"index": 2736,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n square cells (that is, on a 1 × n table).\n\nAt the beginning of the game Alice puts k ships on the fie... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"11 3 3\\n5\\n4 8 6 1 11\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1 3\\n2\\n1 5\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1 3\\n1\\n3\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \... | {
"index": 1303,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nGiga Tower is the tallest and deepest building in Cyberland. There are 17 777 777 777 floors, numbered from - 8 888 888 888 to 8 888 888 888. In particular, there is floor 0 between floor - 1 and floor 1. Every day, tho... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"179\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"-1\\n\", \"output\": \"9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"18\\n\", \"output\": \"10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"-410058385\\n\", \"output\": \"1... | {
"index": 795,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nVlad has $n$ friends, for each of whom he wants to buy one gift for the New Year.\n\nThere are $m$ shops in the city, in each of which he can buy a gift for any of his friends. If the $j$-th friend ($1 \\le j \\le n$) receives a gift bought in the shop ... | code | {
"ground_truth": "{\"inputs\": [\"5\\n\\n2 2\\n1 2\\n3 4\\n\\n4 3\\n1 3 1\\n3 1 1\\n1 2 2\\n1 1 3\\n\\n2 3\\n5 3 4\\n2 5 1\\n\\n4 2\\n7 9\\n8 1\\n9 6\\n10 8\\n\\n2 4\\n6 5 2 1\\n7 9 7 2\\n\", \"5\\n\\n2 2\\n1 2\\n3 4\\n\\n4 3\\n1 3 1\\n3 1 1\\n1 2 2\\n1 1 3\\n\\n2 3\\n5 3 4\\n2 5 1\\n\\n4 2\\n7 9\\n8 1\\n9 6\\n10 8\... | {
"index": 6174,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nC: Skewering\n\nproblem\n\nOne day, when Homura was playing with blocks, Tempura came. Homura decided to play with blocks with Tempura.\n\nThere is a rectangular parallelepiped of A \\ times B \\ times C, which is made by... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 1 10\", \"output\": \"Tem\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1 1\", \"output\": \"Hom\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1 2\", \"output\": \"Tem\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 1 2\", \"output\": \"Tem\... | {
"index": 9725,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 1 45\\n\", \"output\": \"0.828427125\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 4 30\\n\", \"output\": \"19.668384925\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 100 0\\n\", \"output\": \"10000.000000000\\n\"}, {\"type\": \"stdin_stdout\... | {
"index": 12441,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nBtoh yuo adn yuor roomatme lhoate wianshg disehs, btu stlil sdmoeboy msut peorrfm tihs cohre dialy. Oen dya yuo decdie to idourtcne smoe syestm. Yuor rmmotaoe sstgegus teh fooniwllg dael. Yuo argee on tow arayrs of ientgr... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n2\\n0\\n\", \"output\": \"0.500000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n2 3\\n1 0\\n\", \"output\": \"0.666667\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n2 4 4\\n0 1 3\\n\", \"output\": \"1.000000\\n\"}, {\"type\": \"stdin_std... | {
"index": 774,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.\n\nMishka is really interested in calculus, though it is so hard to stay awake for all the ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 3\\n1 3 5 2 5 4\\n1 1 0 1 0 0\\n\", \"output\": \"16\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 2\\n4 5 6 8\\n1 0 1 0\\n\", \"output\": \"18\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 8\\n3 3 7 7 1 9 10 7 1\\n1 1 1 1 1 1 1 1 1\\n\", \"out... | {
"index": 6471,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nThe stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents last time, she ... | code | {
"ground_truth": "{\"inputs\": [\"10 5\\nsomer\\nandom\\nnoise\\nmayth\\neforc\\nebewi\\nthyou\\nhctwo\\nagain\\nnoise\\nsomermayth\\nandomeforc\\nnoiseebewi\\nagainthyou\\nnoisehctwo\\n\", \"1 1\\ng\\ng\\n\", \"1 1\\ng\\ng\\n\", \"10 5\\nsomer\\nandom\\nnoise\\nmayth\\neforc\\nebewi\\nthyou\\nhctwo\\nagain\\nooise\... | {
"index": 4996,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nFor a given polygon g, computes the area of the polygon.\n\ng is represented by a sequence of points p1, p2,..., pn where line segments connecting pi and pi+1 (1 ≤ i ≤ n-1) are sides of g. The line segment connecting pn and p1 is also a side of the poly... | code | {
"ground_truth": "{\"inputs\": [\"4\\n0 0\\n1 1\\n1 2\\n-1 2\", \"4\\n0 0\\n1 1\\n1 2\\n-1 4\", \"3\\n1 0\\n2 4\\n-1 1\", \"4\\n0 0\\n1 1\\n2 2\\n-1 4\", \"3\\n2 0\\n2 2\\n-1 1\", \"3\\n3 0\\n2 2\\n-1 0\", \"4\\n0 -1\\n0 1\\n1 2\\n-1 1\", \"3\\n3 0\\n2 2\\n-2 -1\", \"3\\n3 0\\n2 2\\n-2 -2\", \"4\\n0 -1\\n0 1\\n0 3\\... | {
"index": 3821,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nAppleman has a tree with n vertices. Some of the vertices (at least one) are colored black and other vertices are colored white.\n\nConsider a set consisting of k (0 ≤ k < n) edges of Appleman's tree. If Appleman deletes these edges from the tree, then ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n0 0\\n0 1 1\\n\", \"6\\n0 1 1 0 4\\n1 1 0 0 1 0\\n\", \"10\\n0 1 2 1 4 4 4 0 8\\n0 0 0 1 0 1 1 0 0 1\\n\", \"5\\n0 1 1 3\\n0 0 0 1 1\\n\", \"10\\n0 1 1 2 4 3 3 3 2\\n1 0 1 1 1 0 0 1 1 0\\n\", \"100\\n0 0 2 2 0 3 5 0 6 2 0 4 0 2 3 7 8 3 15 19 13 8 18 19 3 14 23 9 6 3 6 17 26 24 2... | {
"index": 6526,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nDZY has a sequence a, consisting of n integers.\n\nWe'll call a sequence a_{i}, a_{i} + 1, ..., a_{j} (1 ≤ i ≤ j ≤ n) a subsegment of the sequence a. The value (j - i + 1) denotes the length of the subsegment.\n\nYour task is to find the longest subsegm... | code | {
"ground_truth": "{\"inputs\": [\"6\\n7 2 3 1 5 6\\n\", \"10\\n424238336 649760493 681692778 714636916 719885387 804289384 846930887 957747794 596516650 189641422\\n\", \"50\\n804289384 846930887 681692778 714636916 957747794 424238336 719885387 649760493 596516650 189641422 25202363 350490028 783368691 102520060 44... | {
"index": 843,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Beroil corporation structure is hierarchical, that is it can be represented as a tree. Let's examine the presentation of this structure as follows:\n\n * employee ::= name. | name:employee1,employee2, ... ,employeek.... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"VEEMU:VEEMU:GTE:GTE:KZZEDTUECE:VEEMU:GTE:CGOZKO:CGOZKO:GTE:ZZNAY.,GTE:MHMBC:GTE:VEEMU:CGOZKO:VEEMU:VEEMU.,CGOZKO:ZZNAY..................\\n\", \"output\": \"36\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"V:V:V.,V.,V.,V.,V.,V.,V.,V.,V.,V.,V.,V.,V.,V.,V... | {
"index": 13471,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\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 has to solve it, otherwise Iahub won't give her the food. \n\nI... | code | {
"ground_truth": "{\"inputs\": [\"18\\n6 1 1 3 1 1 1 1 1 1 4 1 8 1 1 18 1 5\\n\", \"19\\n9 7 1 8 1 1 1 13 1 1 3 3 19 1 1 1 1 1 1\\n\", \"23\\n1 1 1 1 3 7 3 1 1 1 3 7 1 3 1 15 1 3 7 3 23 1 1\\n\", \"24\\n8 5 3 1 1 5 10 1 1 1 1 5 1 2 7 3 4 1 1 24 1 1 2 8\\n\", \"12\\n12 7 4 3 3 1 1 1 1 1 1 1\\n\", \"20\\n20 9 4 4 3 3 ... | {
"index": 5302,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nXenia the vigorous detective faced n (n ≥ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right. \n\nSpy s has an important note. He has to pass the note to spy f. Xenia interrogates the spies in several st... | code | {
"ground_truth": "{\"inputs\": [\"3 5 1 3\\n1 1 2\\n2 2 3\\n3 3 3\\n4 1 1\\n10 1 3\\n\", \"2 3 2 1\\n1 1 2\\n2 1 2\\n4 1 2\\n\", \"5 11 1 5\\n1 1 5\\n2 2 2\\n3 1 1\\n4 3 3\\n5 3 3\\n6 1 1\\n7 4 4\\n8 4 5\\n10 1 3\\n11 5 5\\n13 1 5\\n\", \"4 6 4 2\\n2 2 2\\n3 3 3\\n4 1 1\\n10 1 4\\n11 2 3\\n12 2 4\\n\", \"7 5 7 6\\n1... | {
"index": 2661,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nMishka is trying really hard to avoid being kicked out of the university. In particular, he was doing absolutely nothing for the whole semester, miraculously passed some exams so that just one is left.\n\nThere were $n$ c... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n5 6\\n\", \"output\": \"0 1 5 5 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n2 1 2\\n\", \"output\": \"0 0 1 1 1 2 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n7\\n\", \"output\": \"0 7 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": ... | {
"index": 1797,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nYou are given a number $n$ and an array $b_1, b_2, \\ldots, b_{n+2}$, obtained according to the following algorithm:\n\nsome array $a_1, a_2, \\ldots, a_n$ was guessed;\n\narray $a$ was written to array $b$, i.e. $b_i = a_i$ ($1 \\le i \\le n$);\n\nThe ... | code | {
"ground_truth": "{\"inputs\": [\"4\\n3\\n2 3 7 12 2\\n4\\n9 1 7 1 6 5\\n5\\n18 2 2 3 2 9 2\\n3\\n2 6 9 2 1\\n\", \"1\\n10\\n500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 705032704 705032704\\n\", \"1\\n12\\n500000000 500000000 500000000 500000000 147483648 50000... | {
"index": 6644,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nAncient Egyptians are known to have used a large set of symbols $\\sum$ to write on the walls of the temples. Fafa and Fifa went to one of the temples and found two non-empty words S_1 and S_2 of equal lengths on the wall of temple written one below the... | code | {
"ground_truth": "{\"inputs\": [\"1 2\\n0\\n1\\n\", \"1 2\\n1\\n0\\n\", \"7 26\\n0 15 12 9 13 0 14\\n11 1 0 13 15 12 0\\n\", \"6 26\\n14 5 19 18 9 14\\n0 0 0 0 0 0\\n\", \"4 26\\n0 0 0 0\\n13 15 18 1\\n\", \"5 100\\n0 0 0 0 0\\n0 0 0 0 0\\n\", \"7 30\\n11 1 0 13 15 12 0\\n0 15 12 9 13 0 14\\n\", \"4 50\\n19 1 19 1\\... | {
"index": 418,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you very well know, the whole Universe traditionally uses three-dimensional Cartesian system of coordinates. In this system each point corresponds to three real coordinates (x, y, z). In this coordinate system, the dis... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1000\\n1 0 1\\n\", \"output\": \"500.0000000000 0.0000000000 500.0000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1000 1000 1000\\n\", \"output\": \"0.3333333333 0.3333333333 0.3333333333\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n... | {
"index": 15127,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and poss... | code | {
"ground_truth": "{\"inputs\": [\"67 1\\n0\", \"34 1\\n0\", \"3 1\\n0\", \"6 1\\n0\", \"10 1\\n0\", \"5 1\\n0\", \"39 1\\n0\", \"10 1\\n1\", \"4 1\\n1\", \"56 1\\n0\", \"12 1\\n0\", \"8 1\\n0\", \"2 1\\n0\", \"0 1\\n-1\", \"1001 8\\n1 3 4 5 6 7 8 9\", \"9999 1\\n-1\", \"115 1\\n0\", \"10 1\\n-1\", \"7 1\\n1\", \"101... | {
"index": 2481,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a given integer $n$. Find the number of ways to fill all $3 \\times n$ tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. $\\square$ This pictur... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"4\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"17\\n\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"36\\n\", \"output\": \"262144\"}, {\"type\": ... | {
"index": 1191,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nA string is called bracket sequence if it does not contain any characters other than \"(\" and \")\". A bracket sequence is called regular if it it is possible to obtain correct arithmetic expression by inserting characte... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1\\n4\\n3\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0\\n0\\n0\\n0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n2\\n3\\n4\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1... | {
"index": 11596,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nBob programmed a robot to navigate through a 2d maze.\n\nThe maze has some obstacles. Empty cells are denoted by the character '.', where obstacles are denoted by '#'.\n\nThere is a single robot in the maze. Its start position is denoted with the charac... | code | {
"ground_truth": "{\"inputs\": [\"5 6\\n.....#\\nS....#\\n.#....\\n.#....\\n...E..\\n333300012\\n\", \"6 6\\n......\\n......\\n..SE..\\n......\\n......\\n......\\n01232123212302123021\\n\", \"5 3\\n...\\n.S.\\n###\\n.E.\\n...\\n3\\n\", \"10 10\\n.#......#.\\n#.........\\n#.........\\n....#.#..E\\n.......#..\\n....##... | {
"index": 5662,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nGenos needs your help. He was asked to solve the following programming problem by Saitama:\n\nThe length of some string s is denoted |s|. The Hamming distance between two strings s and t of equal length is defined as <ima... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"01\\n00111\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0011\\n0110\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1001101001101110101101000\\n01111000010011111111110010001101000100011110101111\\n\", \"outp... | {
"index": 4012,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\n1 3 3\n2\n1 2\n1 3\n\n\nOutput\n\n5\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.",
"role": "user"
}
] | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 1\\n2\\n1 2\\n1 3\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 0\\n2\\n1 2\\n1 3\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 3 3\\n2\\n1 2\\n2 3\", \"output\": \"5\\n\"}, {\"type\": \"std... | {
"index": 10857,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nIn an attempt to escape the Mischievous Mess Makers' antics, Farmer John has abandoned his farm and is traveling to the other side of Bovinia. During the journey, he and his k cows have decided to stay at the luxurious Gr... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7 2\\n0100100\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1\\n01010\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n000\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 1\\n... | {
"index": 14118,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Monk learned about priority queues recently and asked his teacher for an interesting problem. So his teacher came up with a simple problem. He now has an integer array A. For each index i, he wants to find the product... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 4 5\\n\\nSAMPLE\", \"output\": \"-1\\n-1\\n6\\n24\\n60\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n2 8 5 1 10 5 9 9 3 5\", \"output\": \"-1\\n-1\\n80\\n80\\n400\\n400\\n720\\n810\\n810\\n810\\n\"}, {\"type\": \"stdin_stdout\", \"input\"... | {
"index": 6916,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from to... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\nEEE\\nE..\\nE.E\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n.E.\\nE.E\\n.E.\\n\", \"output\": \"1 1\\n2 2\\n3 1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\nEE.EE\\nE.EE.\\nE...E\\n.EE.E\\nEE.EE\\n\", \"output\":... | {
"index": 6459,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have integer n. Calculate how many ways are there to fully cover belt-like area of 4n-2 triangles with diamond shapes. \n\nDiamond shape consists of two triangles. You can move, rotate or flip the shape, but you canno... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n2\\n1\\n\", \"output\": \"2\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1000000000\\n\", \"output\": \"1000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n0000000000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"i... | {
"index": 7370,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nA remote island chain contains n islands, labeled 1 through n. Bidirectional bridges connect the islands to form a simple cycle — a bridge connects islands 1 and 2, islands 2 and 3, and so on, and additionally a bridge co... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1 0 2\\n2 0 1\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n1 0\\n0 1\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 2 3 0\\n0 3 2 1\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\... | {
"index": 16250,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are planning to buy an apartment in a $n$-floor building. The floors are numbered from $1$ to $n$ from the bottom to the top. At first for each floor you want to know the minimum total time to reach it from the first ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 2\\n7 6 18 6 16 18 1 17 17\\n6 9 3 10 9 1 10 1 5\\n\", \"output\": \"0 7 13 18 24 35 36 37 40 45 \\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 1\\n3 2 3 1 3 3 1 4 1\\n1 2 3 4 4 1 2 1 3\\n\", \"output\": \"0 2 4 7 8 11 13 14 16 17 \\n\"}, {\"type\... | {
"index": 14011,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nMagnus decided to play a classic chess game. Though what he saw in his locker shocked him! His favourite chessboard got broken into 4 pieces, each of size n by n, n is always odd. And what's even worse, some squares were ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n0\\n\\n0\\n\\n1\\n\\n0\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n101\\n010\\n101\\n\\n101\\n000\\n101\\n\\n010\\n101\\n011\\n\\n010\\n101\\n010\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n... | {
"index": 1819,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"39999 4774\\n\", \"output\": \"40774\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"40007 74\\n\", \"output\": \"50074\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"31975 74\\n\", \"output\": \"32074\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"69... | {
"index": 16164,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nMisha was interested in water delivery from childhood. That's why his mother sent him to the annual Innovative Olympiad in Irrigation (IOI). Pupils from all Berland compete there demonstrating their skills in watering. It... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 5 4\\n4 4 5 1\\n15\\n9\\n13\\n6\\n\", \"output\": \"5\\n3\\n3\\n3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 4 10\\n3 1 1 1 2 2\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n\", \"output\": \"4\\n3\\n4\\n2\\n3\\n4\\n1\\n2\\n3\\n4\\n\"}, {\"typ... | {
"index": 4811,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob are controlling a robot. They each have one switch that controls the robot.\n\nAlice started holding down her button A second after the start-up of the robot, and released her button B second after the start... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"0 75 25 100\\n\", \"output\": \"50\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"0 33 66 99\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 90 20 80\\n\", \"output\": \"60\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"77 88 ... | {
"index": 11793,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nSaMer has written the greatest test case of all time for one of his problems. For a given array of integers, the problem asks to find the minimum number of groups the array can be divided into, such that the product of an... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n5 5\\n\", \"output\": \"3 0 \"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n0\\n\", \"output\": \"1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n5 -4 2 1 8\\n\", \"output\": \"5 5 3 2 0 \"}, {\"type\": \"stdin_stdout\", \"input\": \"30\\n1 2 0... | {
"index": 3498,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nIgor is in the museum and he wants to see as many pictures as possible.\n\nMuseum can be represented as a rectangular field of n × m cells. Each cell is either empty or impassable. Empty cells are marked with '.', impassa... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 6 3\\n******\\n*..*.*\\n******\\n*....*\\n******\\n2 2\\n2 5\\n4 3\\n\", \"output\": \"6\\n4\\n10\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 4 1\\n****\\n*..*\\n*.**\\n****\\n3 2\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\"... | {
"index": 1881,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a permutation p_1, p_2, …, p_n of integers from 1 to n and an integer k, such that 1 ≤ k ≤ n. A permutation means that every number from 1 to n is contained in p exactly once.\n\nLet's consider all partition... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 5\\n2 1 5 3 4\\n\", \"output\": \"15 1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n2 1 3\\n\", \"output\": \"5 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 3\\n2 7 3 1 5 4 6\\n\", \"output\": \"18 6\\n\"}, {\"type\": \"stdin_stdout\", ... | {
"index": 6615,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nMobile phones are equipped with a function that displays input candidates in order to efficiently input texts such as emails. This records frequently used words and presents words that have the entered letters as initial letters as input candidates. For... | code | {
"ground_truth": "{\"inputs\": [\"1\\nben likes bananas the best among many fruits because bananas are sweet and cheap\\nb\\n1\\nwinners get to visit aizu and the university of aizu and make many friends as well\\na\\n3\\nask alex about\\nthe answer for the\\nassignment on android apps\\na\\n2\\nprogramming is both\... | {
"index": 7131,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are two sisters Alice and Betty. You have $n$ candies. You want to distribute these $n$ candies between two sisters in such a way that: Alice will get $a$ ($a > 0$) candies; Betty will get $b$ ($b > 0$) candies; ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n7\\n1\\n2\\n3\\n2000000000\\n763243547\\n\", \"output\": \"3\\n0\\n0\\n1\\n999999999\\n381621773\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n1\\n2\\n\", \"output\": \"0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n108139\\n\", \"ou... | {
"index": 2469,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nG --Derangement / Derangement\n\nStory\n\nPerson D is doing research on permutations. At one point, D found a permutation class called \"Derangement\". \"It's cool to have a perfect permutation !!! And it starts with D !!... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 2 3 5 4\", \"output\": \"7\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n2 1 3 5 4\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n2 1 0 5 4\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n4 1 0 5 4... | {
"index": 4366,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nThere are $n$ cities in Berland and some pairs of them are connected by two-way roads. It is guaranteed that you can pass from any city to any other, moving along the roads. Cities are numerated from $1$ to $n$.\n\nTwo fairs are currently taking place i... | code | {
"ground_truth": "{\"inputs\": [\"3\\n7 7 3 5\\n1 2\\n2 3\\n3 4\\n4 5\\n5 6\\n6 7\\n7 5\\n4 5 2 3\\n1 2\\n2 3\\n3 4\\n4 1\\n4 2\\n4 3 2 1\\n1 2\\n2 3\\n4 1\\n\", \"3\\n7 7 3 5\\n1 2\\n2 3\\n3 4\\n4 5\\n5 6\\n6 7\\n7 5\\n4 5 2 3\\n1 2\\n2 3\\n4 4\\n4 1\\n4 2\\n4 3 2 1\\n1 2\\n2 3\\n4 1\\n\", \"3\\n7 7 3 5\\n1 2\\n2 3... | {
"index": 2392,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nPaladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements numbered from 1 to n. Moving through the swamp is very difficult, so people tramped exactly n - 1 paths. Each o... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 2 3\\n1 2\\n1 5\\n2 3\\n3 4\\n4 5\\n5 6\\n\", \"output\": \"3\"}, {\"type\": \"stdin_stdout\", \"input\": \"50 2 5\\n9 14\\n46 34\\n40 35\\n44 30\\n32 16\\n1 38\\n48 2\\n17 14\\n50 25\\n6 1\\n45 19\\n21 15\\n22 11\\n15 33\\n8 28\\n2 32\\n10 22\\n37 3\\n4... | {
"index": 4712,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are k sensors located in the rectangular room of size n × m meters. The i-th sensor is located at point (x_{i}, y_{i}). All sensors are located at distinct points strictly inside the rectangle. \n\nOpposite corners ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 3 4\\n1 1\\n1 2\\n2 1\\n2 2\\n\", \"output\": \"1\\n-1\\n-1\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 4 6\\n1 1\\n2 1\\n1 2\\n2 2\\n1 3\\n2 3\\n\", \"output\": \"1\\n-1\\n-1\\n2\\n5\\n-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 4 5... | {
"index": 15511,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nOf course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains a_{i} animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Nat... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 3\\n10 20 30 40\\n1 3\\n2 3\\n4 3\\n\", \"output\": \"16.666667\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3\\n10 20 30\\n1 2\\n2 3\\n3 1\\n\", \"output\": \"13.333333\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 8\\n40 20 10 30 20 50 40\\n... | {
"index": 11834,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nOleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Recently, they started a new company, but they are having trouble finding a name for the company.\n\nTo settle this ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"xxxxxx\\nxxxxxx\\n\", \"output\": \"xxxxxx\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"tinkoff\\nzscoder\\n\", \"output\": \"fzfsirk\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"ioi\\nimo\\n\", \"output\": \"ioi\\n\"}, {\"type\": \"stdin_stdout\",... | {
"index": 3157,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have $2n$ integers $1, 2, \\dots, 2n$. You have to redistribute these $2n$ elements into $n$ pairs. After that, you choose $x$ pairs and take minimum elements from them, and from the other $n - x$ pairs, you take maxi... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n1\\n1\\n5\\n1 4 5 9 10\\n2\\n3 4\\n\", \"output\": \"1\\n3\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1\\n1\\n5\\n1 4 5 9 10\\n2\\n1 4\\n\", \"output\": \"1\\n3\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1\\n1\\n5\\n1 4 5 9 ... | {
"index": 14739,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nIt is the hard version of the problem. The difference is that in this version, there are nodes with already chosen colors.\n\nTheofanis is starving, and he wants to eat his favorite food, sheftalia. However, he should first finish his homework. Can you ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n2\\n5 orange\\n2 white\\n\", \"2\\n2\\n1 white\\n2 white\\n\", \"10\\n3\\n1 blue\\n4 red\\n5 orange\\n\", \"1\\n1\\n1 white\\n\", \"3\\n1\\n7 yellow\\n\", \"1\\n1\\n1 yellow\\n\", \"2\\n2\\n1 green\\n3 red\\n\", \"5\\n9\\n31 yellow\\n30 green\\n26 yellow\\n13 red\\n2 red\\n22 wh... | {
"index": 4741,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nA subsequence of length |x| of string s = s1s2... s|s| (where |s| is the length of string s) is a string x = sk1sk2... sk|x| (1 ≤ k1 < k2 < ... < k|x| ≤ |s|).\n\nYou've got two strings — s and t. Let's consider all subseq... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"abc\\nba\\n\", \"output\": \"No\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"abacaba\\naba\\n\", \"output\": \"No\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"abab\\nab\\n\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"abcdad... | {
"index": 3483,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nIn graph theory, a graph is a collection of nodes with connections between them.\nAny node can be connected to any other node exactly once, and can be connected to no nodes, to some nodes, or to every other node.\nNodes cannot be connected to themselves... | code | {
"ground_truth": "{\"fn_name\": \"isTree\", \"inputs\": [[[[], []]], [[[1], [0]]], [[[1, 2], [0, 2], [0, 1]]], [[[1, 2, 3], [0, 2], [1, 2], [0]]], [[[1, 2, 3], [0], [0], [0, 4], [3]]], [[[1, 2, 3], [0], [0], [0, 4], [3], []]], [[[1], [0, 2], [1, 3, 5], [2, 4], [3, 5], [4, 2]]], [[[1], [0, 2, 3, 4], [1], [1], [1]]], ... | {
"index": 6496,
"reference": null,
"split": "train"
} |
taco | [
{
"content": "Solve the following problem using Python.\n\nSantosh has a farm at Byteland. He has a very big family to look after. His life takes a sudden turn and he runs into a financial crisis. After giving all the money he has in his hand, he decides to sell his plots. The speciality of his land is that it... | code | {
"ground_truth": "{\"inputs\": [[\"2\", \"10 15\", \"4 6\"], \"2\\n10 15\\n4 1\", \"2\\n10 28\\n4 1\", \"2\\n15 28\\n4 1\", \"2\\n8 28\\n4 1\", \"2\\n8 12\\n8 1\", \"2\\n8 12\\n3 1\", \"2\\n8 12\\n2 1\", \"2\\n9 12\\n2 1\", \"2\\n9 12\\n2 2\", \"2\\n9 4\\n2 2\", \"2\\n9 4\\n2 3\", \"2\\n5 4\\n2 3\", \"2\\n8 4\\n2 3\... | {
"index": 6052,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as pi. We'll call number n the size or... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 1\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 4\\n\", \"output\": \"328\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 0\\n\", \"output\": \"1\\n\... | {
"index": 9554,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3000\", \"output\": \"0\"}, {\"type\": \"stdin_stdout\", \"input\": \"1900\", \"output\": \"100\"}, {\"type\": \"stdin_stdout\", \"input\": \"5614\", \"output\": \"386\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2651\", \"output\": \"349\\n\"}, {\"typ... | {
"index": 4352,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nImp is in a magic forest, where xorangles grow (wut?)\n\n [Image] \n\nA xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equa... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n\", \"output\": \"0\\n\"}, {\"ty... | {
"index": 651,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose any two neighboring squares ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n00100\\n\", \"output\": \"2\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n111010\\n\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n10001\\n\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n1100010\\n\", \"o... | {
"index": 7387,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nRead the coordinates of four different points on the plane, $ A (x_A, y_A) $, $ B (x_B, y_B) $, $ C (x_C, y_C) $, $ D (x_D, y_D) $, and straight line $ Create a program that outputs YES if AB $ and $ CD $ are orthogonal, ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1.0 1.0 2.0 2.0 0.0 0.0 1.0 -1.0\\n0.0 0.0 2.0 0.0 -1.0 2.0 2.0 2.0\\n10.0 6.0 3.4 5.2 6.8 9.5 4.3 2.1\\n2.5 3.5 2.5 5.324353001023156 -3.3 -2.3 6.8 -2.3\", \"output\": \"YES\\nNO\\nNO\\nYES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1.0 1.0 2.0 2.0 ... | {
"index": 12229,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string s, determine if it contains any palindrome of length exactly 100 as a subsequence. If it has any, print any one of them. If it doesn't have any, print a palindrome that is a subsequence of s and is as long ... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"rquwmzexectvnbanemsmdufrg\\n\", \"output\": \"rumenanemur\"}, {\"type\": \"stdin_stdout\", \"input\": \"bbbabcbbb\\n\", \"output\": \"bbbcbbb\"}, {\"type\": \"stdin_stdout\", \"input\": \"gamjuklsvzwddaocadujdmvlenyyvlflipneqofeyipmtunbdmbdyhkovnpdetueeiun... | {
"index": 3080,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nKolya is developing an economy simulator game. His most favourite part of the development process is in-game testing. Once he was entertained by the testing so much, that he found out his game-coin score become equal to 0... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1359257\\n\", \"output\": \"YES\"}, {\"type\": \"stdin_stdout\", \"input\": \"17851817\\n\", \"output\": \"NO\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000000000\\n\", \"output\": \"YES\"}, {\"type\": \"stdin_stdout\", \"input\": \"17851818\\n\", \"ou... | {
"index": 10350,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus is sure that his life fits the description: \"first there is a white stripe, then a black one, then a white one again\". So, Polycarpus is sure that this rule is going to fulfill during the next n days. Polycar... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 2 1\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 2 2\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3 1\\n\", \"output\": \... | {
"index": 2871,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\n## Your Story\n\"A *piano* in the home meant something.\" - *Fried Green Tomatoes at the Whistle Stop Cafe*\n\nYou've just realized a childhood dream by getting a beautiful and beautiful-sounding upright piano from a frie... | code | {
"ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"black_or_white_key\", \"input\": [1], \"output\": [\"white\"]}, {\"type\": \"function_call\", \"fn_name\": \"black_or_white_key\", \"input\": [5], \"output\": [\"black\"]}, {\"type\": \"function_call\", \"fn_name\": \"black_or_white_key\", \"input\": [1... | {
"index": 10874,
"reference": null,
"split": "train"
} |
primeintellect | [
{
"content": "Solve the following coding problem using the programming language python:\n\n\"You must lift the dam. With a lever. I will give it to you.\n\nYou must block the canal. With a rock. I will not give the rock to you.\" \n\nDanik urgently needs rock and lever! Obviously, the easiest way to get these t... | code | {
"ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n5\\n1 4 3 7 10\\n3\\n1 1 1\\n4\\n6 2 5 3\\n2\\n2 4\\n1\\n1\\n\", \"output\": \"1\\n3\\n2\\n0\\n0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1\\n1000000000\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1\\n10000000... | {
"index": 12072,
"reference": null,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.