data_source stringclasses 4
values | prompt listlengths 2 2 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
codeforces | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 game... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Everybody knows of [spaghetti sort](https://en.wikipedia.org/wiki/Spaghetti_sort). You decided to implement an analog sorting algorithm yourself, but... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 +... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 i... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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.\nN... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 stri... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 va... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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. S... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 associat... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 consecutiv... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 func... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 co... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 subarr... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ≤... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Title: Queue at the School\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nDuring the break the schoolchildren, ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 abou... | code | {
"ground_truth": "{\"inputs\": [\"bbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbggggggggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbgggggbgbgggbbgbbgbgggbbbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbbgbbgggbgbgggggbbbbgggbgbb... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | code | {
"ground_truth": "{\"inputs\": [\"8 3\"], \"outputs\": [\"5\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 m... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Title: Sum\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nVasya studies positional numeral systems. Unfortunately, ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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. ... | 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 Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 wor... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ro... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 hou... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 character... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 undire... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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* fo... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 p... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ar... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | code | {
"ground_truth": "{\"inputs\": [\"wtwwttwttwwwwwwwwtwtwwwwwtwwtwwtwwwwwtwtwtwtwwtwwwtwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwtwwwwwwwwwwwtwwwwwtwttwwwwtwwwwwwwwwwwwwwwwwtwwwwtwwwwwwwwwwwwwttwtwwwwwtwwtwwwwwwwtwwttttwwwwwwwwwwwwwwwwwwwtwwwttwtwwtwwtwwtwwwwtwwtwtwwtwwwwwwwwwwtwwww\\n\", \"rrrvjurvrrsukrsrvxskrrrrbrapyrmrm... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 tria... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 dom... | code | {
"ground_truth": "{\"fn_name\": \"findMaxForm\", \"inputs\": [[[\"\\\"10\\\"\", \"\\\"0001\\\"\", \"\\\"111001\\\"\", \"\\\"1\\\"\", \"\\\"0\\\"\"], 5, 3]], \"outputs\": [4]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 t... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 (i... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Title: Easy Tape Programming\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThere is a programming language in ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 bu... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 fin... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 arrive... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Problem D: Exportation in Space\n\nIn an era of space travelling, Mr. Jonathan A. Goldmine exports a special material named \"Interstellar Condensed ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 foll... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 f... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 f... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 structu... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ver... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Title: Mischievous Mess Makers\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIt is a balmy spring afternoon, a... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | code | {
"ground_truth": "{\"inputs\": [\"N=3, M=0\", \"N=3, M=6\"], \"outputs\": [\"1\", \"84\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 cons... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "Title: Zbazi in Zeydabad\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nA tourist wants to visit country Zeydab... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 p... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 excha... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 mor... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 topper... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 wi... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 e... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 dist... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ans... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 trian... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 a... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "The European Space Agency has $N$ telescopes observing distant planets. They have classified $M$ different types of events. They noticed that every d... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 t... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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\nEv... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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:\nLin... | code | {
"ground_truth": "{\"inputs\": [\"LinkedList:4->5->6\", \"LinkedList:1->2->3\"], \"outputs\": [\"457\", \"124\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"content": "# Description:\n\n Count the number of exclamation marks and question marks, return the product.\n\n# Examples\n\n```\nProduct(\"\") == 0\nproduct(\"... | code | {
"ground_truth": "{\"fn_name\": \"product\", \"inputs\": [[\"\"], [\"!\"], [\"!!??!!\"]], \"outputs\": [[0], [0], [8]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 hu... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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,... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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``... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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,... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 in... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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.... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 lo... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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 ... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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... | 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": "Write Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "system"
},
{
"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) ... | 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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.