messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSelection of Participants of an ... | [{"type": "stdin_stdout", "input": "5\n10 0 1 10 14\n5\n1 5 25 9 11\n7\n10 20 83 43 143 31 62\n0", "output": "0\n2\n10\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 44 29 70\n0", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 1 10\n5\n1 5 8 13 11\n7\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTaro has decided to move. Taro h... | [{"type": "stdin_stdout", "input": "8\n7 2 1 3 8 5 4 6", "output": "20\n"}, {"type": "stdin_stdout", "input": "8\n5 2 1 3 8 6 4 7", "output": "18\n"}, {"type": "stdin_stdout", "input": "8\n6 4 1 1 8 5 4 7", "output": "20\n"}, {"type": "stdin_stdout", "input": "8\n6 2 1 3 8 5 4 7", "output": "19"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCurry making\n\nAs the ACM-ICPC ... | [{"type": "stdin_stdout", "input": "10 5 3 4\n1 6 2 3\n150 13 7 62\n10 1 3 5\n20 100 3 20\n2 14 13 1\n0 0 0 0", "output": "2\n4\n0\n0\n14\n180\n"}, {"type": "stdin_stdout", "input": "10 5 3 4\n1 5 2 3\n150 13 12 62\n10 1 11 5\n20 100 3 20\n3 14 3 1\n0 0 0 0", "output": "2\n3\n1\n1\n14\n39\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRevised\n\nThe current era, Heis... | [{"type": "stdin_stdout", "input": "HEISEI 1 0 0\nHEISEI 31 4 2\nIETEIH 31 5 3\nIFISEH 142 12 42\nHEISEI 15 8 30\nIEJSEH 103 2 42\nHEISEI 3 3 14\nHEISEI 28 2 23\n#", "output": "HEISEI 1 0 0\nHEISEI 31 4 2\n? 1 5 3\n? 112 12 42\nHEISEI 15 8 30\n? 73 2 42\nHEISEI 3 3 14\nHEISEI 28 2 23\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nGiven the strings $ s... | [{"type": "stdin_stdout", "input": "abaabbabaab`abbabbabaabbab\nab", "output": "2\n"}, {"type": "stdin_stdout", "input": "abaabbbbaab`abbabbabaabaab\nab", "output": "2\n"}, {"type": "stdin_stdout", "input": "abaabbbbaab`abbabbabaabaab\n`b", "output": "1\n"}, {"type": "stdin_stdout", "input": "abaabbbbaaa`abbabbabbabaab... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which converts u... | [{"type": "stdin_stdout", "input": "f@IR, LATER, OCCASIONALLY CLOUDY.", "output": "F@ir, later, occasionally cloudy.\n"}, {"type": "stdin_stdout", "input": "f@IR, LATER, YLLANOISACCO CLOUDY.", "output": "F@ir, later, yllanoisacco cloudy.\n"}, {"type": "stdin_stdout", "input": "f@IR, LATER, OLLANOISACCY CLOUDY.", "outpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChef has a box full of infinite ... | [{"type": "stdin_stdout", "input": "1\n4\n1 -1 2 2", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4\n1 1 -1 4", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4\n1 2 2 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4\n0 2 2 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe sequence of integers a_1, a_... | [{"type": "stdin_stdout", "input": "4\n-2 0 4 -1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-2 0 1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n-2 1 5 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n-1 0 4 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n-2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a card game called \"Du... | [{"type": "stdin_stdout", "input": "H\nQH 9S\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "S\n8D 6D\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "D\n9S 8S\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nTH 8H\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "H\nAH KH\n",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n houses along the roa... | [{"type": "stdin_stdout", "input": "100 100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 109 47 21 78 20 63 13 49 76 36 41 79 16 87 87 69 3 76 80 60 100 62 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We al... | [{"type": "stdin_stdout", "input": "544958\n", "output": "4477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp has got two strings s a... | [{"type": "stdin_stdout", "input": "101\nbabbbbabbbbaabbbbbbbabbbababababbbbbbbbabaababbababbaaabbababbbbbbbbbaabbbababbbbbabbbbbabbbaabbbaabb\nbbabbbbbbabbbbbbbbbbbabbbbbbbbbbabbabbbbbbbbbbbabbababbbabbabbbbbbbbbbbbbaabbbabbbbabbabbbbababbbbbab\n", "output": "20\n2 7\n12 13\n21 25\n27 29\n31 40\n42 43\n45 50\n54 55\n5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a password which you of... | [{"type": "stdin_stdout", "input": "44 20\nbcdefghijklmnopqrstabcdefghijklmnopqrstatata\n", "output": "61\n"}, {"type": "stdin_stdout", "input": "44 20\ncdefghijklmnopqrstabcdefghijklmnopqrstabtata\n", "output": "62\n"}, {"type": "stdin_stdout", "input": "44 20\natatbatsrqponmlkjihgfedcbatsrqponmlkjihgfedc\n", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two strings s and ... | [{"type": "stdin_stdout", "input": "4\n4\nabcd\nabdc\n5\nababa\nbaaba\n4\nasdf\nasdg\n4\nabcd\nbadc\n", "output": "NO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n4\nabcd\nabdc\n5\nababa\nabaab\n4\nasdf\nasdg\n4\nabcd\nbadc\n", "output": "NO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n4\ndabb\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe start with a string s consist... | [{"type": "stdin_stdout", "input": "9\n1500\n1212\n1500\n1221\n1500\n122\n1500\n12121\n1500\n22\n1500\n1111112111111112\n1500\n1111111111221111111\n1500\n111111122\n1500\n11111121111121111111\n", "output": "1504\n1599\n1502\n1598\n1502\n1510\n1657\n1502\n1763\n"}, {"type": "stdin_stdout", "input": "9\n1500\n1212\n1500\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given some Tetris field ... | [{"type": "stdin_stdout", "input": "4\n3\n1 3 3\n4\n2 2 2 2\n2\n11 15\n1\n111\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 1 3\n4\n1 1 2 1\n2\n11 11\n1\n100\n", "output": "YES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 3 3\n4\n2 2 2 2\n2\n11 12\n1\n111\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAshish and Vivek play a game on ... | [{"type": "stdin_stdout", "input": "4\n2 2\n0 0\n0 0\n2 2\n1 0\n0 0\n2 3\n0 0 0\n1 1 0\n3 3\n1 0 0\n0 0 0\n1 0 0\n", "output": "Vivek\nAshish\nAshish\nAshish\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n1 0\n0 0\n2 2\n0 0\n0 1\n2 3\n1 0 1\n1 1 0\n3 3\n1 0 0\n0 0 0\n1 0 0\n", "output": "Ashish\nAshish\nVivek\nAshish\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of n in... | [{"type": "stdin_stdout", "input": "6\n-18 -12 -9 -10 -6 4\n3\n1 6 -9\n1 3 -10\n6 6 -3\n", "output": "3\n-2\n-2\n-4\n"}, {"type": "stdin_stdout", "input": "6\n-9 -12 -9 -6 -6 4\n3\n1 6 -9\n1 2 -10\n4 6 -3\n", "output": "4\n-1\n-1\n-2\n"}, {"type": "stdin_stdout", "input": "6\n-9 -12 -9 -10 -6 4\n3\n1 6 -9\n1 3 -10\n6 6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou found a useless array a of 2... | [{"type": "stdin_stdout", "input": "6\n4\n5 6 9 13 36 42 47 60\n3\n1 2 3 4 5 6\n3\n1 2 3 3 5 6\n4\n5 22 42 47 49 54 69 123\n2\n1 1 2 2\n3\n1000000 1000000 990000 10000 900000 90000\n", "output": "YES\n69\n60 9\n47 13\n42 5\n36 6\nYES\n10\n6 4\n5 1\n3 2\nYES\n9\n6 3\n5 1\n3 2\nYES\n172\n123 49\n69 54\n47 22\n42 5\nYES\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBy 2312 there were n Large Hadro... | [{"type": "stdin_stdout", "input": "1 100\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY inve... | [{"type": "stdin_stdout", "input": "20 15 17\n4 9 14 11 15 16 15 4 0 10 7 12 10 1 8 6 7 14 1 13\n6 3 14 8 8 11 16 4 5 9 2 13 6 14 15\n", "output": "10 1 3 8 3 15 7 14 1 12 3 10 15 16 16 5 4 15 13 11 "}, {"type": "stdin_stdout", "input": "20 15 17\n4 9 14 11 15 16 15 4 0 10 7 12 10 1 8 6 7 14 1 13\n6 3 14 8 8 11 16 4 6 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day shooshuns found a sequen... | [{"type": "stdin_stdout", "input": "20 20\n20 1 19 2 18 3 17 4 16 5 15 6 14 7 13 8 12 9 11 10\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 1 1 1 1 1 1\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 0 1 1 1 1 1\n", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShaass has n books. He wants to ... | [{"type": "stdin_stdout", "input": "100\n2 2\n1 2\n1 5\n1 5\n1 2\n1 4\n2 3\n1 2\n1 5\n2 1\n2 2\n2 4\n1 2\n2 3\n1 1\n1 1\n2 5\n2 3\n2 2\n1 2\n2 1\n2 2\n1 5\n2 1\n2 4\n1 4\n1 4\n2 2\n1 1\n2 4\n1 4\n2 4\n1 2\n2 3\n2 3\n1 5\n1 5\n2 3\n1 4\n1 5\n2 2\n1 3\n2 2\n2 2\n1 1\n2 1\n2 5\n1 1\n2 3\n2 5\n1 5\n1 3\n1 5\n2 4\n1 5\n2 3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have array a1, a2, ..., an. ... | [{"type": "stdin_stdout", "input": "51\n1 -1 1 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "51\n1 -1 1 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 0 -1 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is playing a game with ... | [{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya wanted to give an A... | [{"type": "stdin_stdout", "input": "11\n", "output": "0"}, {"type": "stdin_stdout", "input": "15\n", "output": "1"}, {"type": "stdin_stdout", "input": "13\n", "output": "1"}, {"type": "stdin_stdout", "input": "14\n", "output": "0"}, {"type": "stdin_stdout", "input": "16\n", "output": "0"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday Vasya visited a widely kno... | [{"type": "stdin_stdout", "input": "September\n0\n", "output": "September\n"}, {"type": "stdin_stdout", "input": "November\n46\n", "output": "September\n"}, {"type": "stdin_stdout", "input": "December\n240\n", "output": "December\n"}, {"type": "stdin_stdout", "input": "December\n81\n", "output": "September\n"}, {"type"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus got an internship in ... | [{"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:34:59\n14:40:06\n14:53:13\n", "output": "6\n1\n2\n3\n3\n3\n3\n4\n5\n6\n6\n"}, {"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:56\n10:46:34\n14:3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy... | [{"type": "stdin_stdout", "input": "100 19\n6 62 72 83 91 94 97\n3 61 84 99\n1 63\n5 46 53 56 69 78\n5 41 43 49 74 89\n5 55 57 79 85 87\n3 47 59 98\n3 64 76 82\n3 48 66 75\n2 60 88\n2 67 77\n4 40 51 73 95\n41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 71 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA long time ago, in a galaxy far... | [{"type": "stdin_stdout", "input": "sosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosos\nsos\n", "output": "20"}, {"type": "stdin_stdout", "input": "sosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosossosos\nsor\n", "output": "0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBearland has n cities, numbered ... | [{"type": "stdin_stdout", "input": "1000 1577\n698 459 326 404\n", "output": "698 326 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSometimes some words like \"loca... | [{"type": "stdin_stdout", "input": "20\nlkpmx\nkovxmxorlgwaomlswjxlpnbvltfv\nhykasjxqyjrmybejnmeumzha\ntuevlumpqbbhbww\nqgqsphvrmupxxc\ntrissbaf\nqfgrlinkzvzqdryckaizutd\nzzqtoaxkvwoscyx\noswytrlnhpjvvnwookx\nlpuzqgec\ngyzqfwxggtvpjhzmzmdw\nrlxjgmvdftvrmvbdwudra\nvsntnjpepnvdaxiporggmglhagv\nxlvcqkqgcrbgtgglj\nlyxwxbis... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYoung Timofey has a birthday tod... | [{"type": "stdin_stdout", "input": "42\n-557774624 828320986 -345782722 -62979938 -681259411 -945983652 -139095040 832293378 -82572118 432027535 88438103 568183540 961782904 73543295 615958219 -5050584 322982437 -146046730 759453379 129267920 -819827396 -348156048 805080102 390723009 -771277251 -79011872 -592313207 528... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMaxim wants to buy an apartment ... | [{"type": "stdin_stdout", "input": "1000000000 333333333\n", "output": "1 666666666\n"}, {"type": "stdin_stdout", "input": "1000000000 333333334\n", "output": "1 666666666\n"}, {"type": "stdin_stdout", "input": "1000000000 596874994\n", "output": "1 403125006\n"}, {"type": "stdin_stdout", "input": "1000000000 114283913... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rooted tree with... | [{"type": "stdin_stdout", "input": "7\n1 1 2 3 1 4\n3 3 1 1 1 2 6\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1 1 2 3 1 5\n3 3 1 1 1 2 6\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1 1 1 3 1 5\n3 3 1 1 1 2 6\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1 1 1 3 1 5\n3 5 1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne very experienced problem wri... | [{"type": "stdin_stdout", "input": "101+200+195+231+107+222+146+254+160+209\n", "output": "-43175\n"}, {"type": "stdin_stdout", "input": "255+255+255+255+255+255+255+255+255+255\n", "output": "-42450\n"}, {"type": "stdin_stdout", "input": "101+200+195+230+117+222+146+254+160+209\n", "output": "-43166\n"}, {"type": "std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasilisa the Wise from a far awa... | [{"type": "stdin_stdout", "input": "ROYGBV\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "RRYOGB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "YROVBG\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "RYGOBG\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "VOBYGO\n", "output": "15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJesse and Walter recently got a ... | [{"type": "stdin_stdout", "input": "200\n01?0001?0??1100000000110???1011010111101010?100?11??010?1???0000000110???1010010??00\n101010000011110111111110000100111101110110010111101110000100010100010110101100111100\n?101??0101?1000??????10011????0?100111?10?01\n11011000000100010011100100100100001110101110\n?1?0????001?11?... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n\"RMS Lusitania\" was one of the... | [{"type": "stdin_stdout", "input": "2\n3 \n2\n2 0 1 \n2 7 5\n4 \n7\n2 3 7 11\n4 16 26 6\n\nSOAPDL", "output": "12\n26\n"}, {"type": "stdin_stdout", "input": "2\n3 \n3\n2 0 5 \n2 4 5\n4 \n7\n2 3 7 11\n4 16 26 5\n\nSNAPEL", "output": "6\n26\n"}, {"type": "stdin_stdout", "input": "2\n3 \n3\n2 0 5 \n2 7 5\n4 \n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMarut loves good strings. Accord... | [{"type": "stdin_stdout", "input": "1\n13054", "output": "Invalid Input\n"}, {"type": "stdin_stdout", "input": "1\n12538", "output": "Invalid Input\n"}, {"type": "stdin_stdout", "input": "1\n17004", "output": "Invalid Input\n"}, {"type": "stdin_stdout", "input": "1\n22207", "output": "Invalid Input\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRahul has set upon the quest for... | [{"type": "stdin_stdout", "input": "81", "output": " /\\\n / \\\n / /\\ \\\n ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBangalore City, where peace prev... | [{"type": "stdin_stdout", "input": "100\n353 503 929 824 501 802 61 72 1170 605 837 182 175 650 241 1129 680 700 733 644 171 196 101 952 773 157 278 538 1 123 78 1091 105 188 327 51 210 388 548 184 652 4 2 549 27 769 113 710 1159 1059 40 183 350 50 514 47 904 759 385 383 971 770 273 817 209 655 268 1500 957 798 1346 27... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have an H \\times W grid, whe... | [{"type": "stdin_stdout", "input": "6 7\n.......\n.......\n.#.....\n..#....\n.#.#...\n.......", "output": "203949910"}, {"type": "stdin_stdout", "input": "6 2\n.......\n.......\n.#.....\n..#....\n.#.#...\n.......", "output": "1394\n"}, {"type": "stdin_stdout", "input": "6 2\n.......\n.......\n.#.....\n..#....\n.#.#/..\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a rooted tree with N ve... | [{"type": "stdin_stdout", "input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n2 10\n1 10", "output": "10 20 10 20 20 10\n"}, {"type": "stdin_stdout", "input": "6 1\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10", "output": "10 10 10 10 10 10\n"}, {"type": "stdin_stdout", "input": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 14\n1 10", "output": "24 24 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN tiles are arranged in a row fr... | [{"type": "stdin_stdout", "input": "10110010", "output": "2\n"}, {"type": "stdin_stdout", "input": "10110110", "output": "3\n"}, {"type": "stdin_stdout", "input": "00110110", "output": "4\n"}, {"type": "stdin_stdout", "input": "10100110", "output": "2\n"}, {"type": "stdin_stdout", "input": "01110110", "output": "3\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day, Niwango-kun, an employe... | [{"type": "stdin_stdout", "input": "8 2\n13 0 11 2 14 4 11 8", "output": "55\n"}, {"type": "stdin_stdout", "input": "8 4\n10 2 18 7 21 1 10 1", "output": "58\n"}, {"type": "stdin_stdout", "input": "8 4\n10 2 28 7 23 0 10 3", "output": "70\n"}, {"type": "stdin_stdout", "input": "8 2\n18 0 28 5 17 1 16 1", "output": "84\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has two boards, each divid... | [{"type": "stdin_stdout", "input": "5\nabcde\nfghij\nklmno\npqrst\nuvvxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nabcde\nfghij\nonmlk\npqrst\nuvwxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nedcba\nfghij\nonmlk\npqrst\nuvwxy", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nedcba... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke can change a string t of l... | [{"type": "stdin_stdout", "input": "whcrjpbyhtxywkrlxnbrbaojmr", "output": "10\n"}, {"type": "stdin_stdout", "input": "smjoabjdoxmrjwypugydyqrchv", "output": "11\n"}, {"type": "stdin_stdout", "input": "xwwwnajdrxmrqwzpugnhlojced", "output": "12\n"}, {"type": "stdin_stdout", "input": "xpwzglbjquntrci{axpdikofyw", "outpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA tetromino is a figure formed b... | [{"type": "stdin_stdout", "input": "10 1 2 0 0 -1 0", "output": "11\n"}, {"type": "stdin_stdout", "input": "1 13 1 0 1 -1 2", "output": "13\n"}, {"type": "stdin_stdout", "input": "10 2 0 0 4 -1 0", "output": "16\n"}, {"type": "stdin_stdout", "input": "1 26 1 0 1 -1 2", "output": "26\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke and Ciel went to a strange... | [{"type": "stdin_stdout", "input": "7 13\n.............\n.###.###.###.\n.#.#.#...#...\n.###.#...#...\n.#.#.#.#.#...\n.#.#.###.###.\n.............", "output": ".............\n.###########.\n.###.###.###.\n.###.###.###.\n.###.###.###.\n.###.###.###.\n.............\n\n.............\n.###.###.###.\n.#.#.#...#...\n.###.#...... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a program that outputs al... | [{"type": "stdin_stdout", "input": "265 2171\n1686 3636\n2001 2275\n0 0", "output": "268\n272\n276\n280\n284\n288\n292\n296\n304\n308\n312\n316\n320\n324\n328\n332\n336\n340\n344\n348\n352\n356\n360\n364\n368\n372\n376\n380\n384\n388\n392\n396\n400\n404\n408\n412\n416\n420\n424\n428\n432\n436\n440\n444\n448\n452\n456\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRelative B man came to A child's... | [{"type": "stdin_stdout", "input": "5\napple\nyellow\ngeorgia\ngnik\nemail\n7\napple\nyellow\ngeorgia\nking\nemail\nwink\nlucky\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "5\napple\nyellow\ngeorgia\ngnik\nemail\n7\napple\nzellow\ngeorgia\nking\nemail\nwink\nlucky\n0", "output": "NG\nNG\n"}, {"type": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are a number of ways to sh... | [{"type": "stdin_stdout", "input": "17 1\n1\n28 4\n1 1 6 4", "output": "16\n19\n"}, {"type": "stdin_stdout", "input": "17 1\n1\n28 4\n1 2 6 4", "output": "16\n12\n"}, {"type": "stdin_stdout", "input": "6 1\n3\n18 4\n2 1 11 11", "output": "2\n13\n"}, {"type": "stdin_stdout", "input": "10 1\n3\n18 4\n2 2 12 4", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne of the oddest traditions of ... | [{"type": "stdin_stdout", "input": "3 3\n1 2\n3 50\n10 29\n146 32\n39 2\n50 50\n0 0", "output": "0\n0\n1\n5\n31\n1\n13\n"}, {"type": "stdin_stdout", "input": "3 2\n1 2\n3 10\n10 29\n142 48\n39 2\n50 50\n0 0", "output": "1\n0\n2\n5\n63\n1\n13\n"}, {"type": "stdin_stdout", "input": "4 3\n3 3\n3 105\n10 29\n31 32\n27 5\n5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKarakuri Doll\n\nKarakuri doll\n... | [{"type": "stdin_stdout", "input": "5 3\n#####\n#K.M#\n#####\n9 5\n#########\n#...#.#.#\n#.###..M#\n#K#######\n#########\n9 5\n#########\n#K......#\n####.####\n####M####\n#########\n9 5\n#########\n#M......#\n####.####\n####K####\n#########\n7 9\n#######\n#####M#\n#####.#\n#.....#\n#.###.#\n#.....#\n#.#####\n#K#####\n#... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA tatami mat, a Japanese traditi... | [{"type": "stdin_stdout", "input": "6 12\n2 18\n0 0", "output": "4\n872\n"}, {"type": "stdin_stdout", "input": "5 18\n18 4\n0 0", "output": "10\n25\n"}, {"type": "stdin_stdout", "input": "14 14\n8 3\n0 0", "output": "2\n10\n"}, {"type": "stdin_stdout", "input": "8 10\n18 4\n0 0", "output": "1\n25\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Kingdom of Neva is home to t... | [{"type": "stdin_stdout", "input": "5 2\n-1 2\n0 13\n-2 3\n-1 1\n1 2\n0 6\n-1 0", "output": "17.128123547485479605256841750815510749816894531250000000000000000000000000000000000000000000000000000\n"}, {"type": "stdin_stdout", "input": "5 2\n-2 2\n0 13\n-2 3\n-1 1\n1 2\n0 6\n-1 0", "output": "17.263102417797167476010145... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPalindrome\n\nProblem Statement\... | [{"type": "stdin_stdout", "input": "4752", "output": "4774\n"}, {"type": "stdin_stdout", "input": "8517", "output": "8558\n"}, {"type": "stdin_stdout", "input": "3483", "output": "3443\n"}, {"type": "stdin_stdout", "input": "1868", "output": "1881\n"}, {"type": "stdin_stdout", "input": "2667", "output": "2662\n"}, {"ty... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis year too, the time has come... | [{"type": "stdin_stdout", "input": "0 2\n-1 -1\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 1\n-1 15\n1", "output": "1\n"}, {"type": "stdin_stdout", "input": "0 1\n-1 13\n0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 1\n-1 11\n0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 1\n-1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nThere are $ N $ propo... | [{"type": "stdin_stdout", "input": "211 0\n4 2\n0 3", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the difference of two sets ... | [{"type": "stdin_stdout", "input": "5\n-1 2 4 13 17\n1\n-2 2", "output": "-1\n2\n4\n13\n17\n"}, {"type": "stdin_stdout", "input": "5\n-1 2 4 13 25\n1\n-2 1", "output": "-1\n2\n4\n13\n25\n"}, {"type": "stdin_stdout", "input": "5\n-2 2 3 9 14\n0\n-1 28", "output": "-2\n2\n3\n9\n14\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA Little Elephant and his friend... | [{"type": "stdin_stdout", "input": "2\n2 1\n2 2\n3 13\n-1 2 2", "output": "No\nYes\n"}, {"type": "stdin_stdout", "input": "2\n2 1\n4 2\n3 13\n-1 2 2", "output": "No\nYes\n"}, {"type": "stdin_stdout", "input": "2\n2 1\n4 2\n3 13\n-1 2 1", "output": "No\nYes\n"}, {"type": "stdin_stdout", "input": "2\n2 0\n4 2\n3 13\n-1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are a given a list of intege... | [{"type": "stdin_stdout", "input": "5 10 1 1\n1000000000 1000000000 1000000000 1 1000000000\n1 1\n1 3\n5 5\n1 1\n2 3\n3 3\n3 4\n1 2\n2 2\n3 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 10 1 1\n1000000000 1000000000 1000000000 1 1000000000\n1 1\n1 3\n5 5\n1 1\n2 3\n3 3\n3 4\n1 2\n2 2\n3 5\n", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "200 103 37\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a weighted tree with n ... | [{"type": "stdin_stdout", "input": "2\n5\n17\n12\n10\n9\n10\n2\n99\n", "output": "3 2 1 3 5 2 4\n2 3 2 3 1 4 5\n2 3 4 5 1 2 3\n-1 17\n5 4 1 3 5 7 9 2 4 6 8\n4 5 2 3 6 7 1 4 5 8 9\n4 5 4 5 6 7 1 2 3 8 9\n2 7 8 9 1 2 3 4 5 6 7\n-1 99\n"}, {"type": "stdin_stdout", "input": "2\n5\n9\n12\n10\n9\n10\n2\n99\n", "output": "3 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn some social network, there ar... | [{"type": "stdin_stdout", "input": "14 5\n3 2 1 7\n0\n2 2 2\n1 1\n2 10 11\n", "output": "3 3 1 1 1 1 3 1 1 2 2 1 1 1\n"}, {"type": "stdin_stdout", "input": "14 5\n3 2 1 7\n0\n2 2 2\n1 1\n2 10 6\n", "output": "3 3 1 1 1 2 3 1 1 2 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "14 5\n3 2 5 10\n0\n2 2 2\n1 0\n2 1 3\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA company of n friends wants to ... | [{"type": "stdin_stdout", "input": "5 5\n8 5 3 8 4 1 9 7 6\n4 6 7 8 2\n4 8 4 1 3\n1 7\n9 9 4 7 6 5 8 3 1 2\n1 5 8 2 4 5 3\n1 9 2 6 9 5 8 4 3 1 7\n1 8 1 6 2 7 9 5 4 3\n1 3 7 9 6\n1 7 6 9 2 1 5 8 7\n", "output": "1 3\n"}, {"type": "stdin_stdout", "input": "5 5\n9 7 3 2 9 4 6 1 5 8\n3 1 9 8\n4 1 3 8 9\n5 7 5 6 9 3\n8 5 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "0111001100111011101000\n", "output": "0011001100001011101000\n"}, {"type": "stdin_stdout", "input": "0111001110111011101000\n", "output": "0011000010001011101000\n"}, {"type": "stdin_stdout", "input": "0111001110101011101000\n", "output": "0011000010101011101000\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a chess board with... | [{"type": "stdin_stdout", "input": "104\n", "output": "WBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWB\nBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBW\nWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBW... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet a be a matrix of size r × c ... | [{"type": "stdin_stdout", "input": "1223 12\n", "output": "2 3 4 5 6 7 8 9 10 11 12 13\n28 42 56 70 84 98 112 126 140 154 168 182\n30 45 60 75 90 105 120 135 150 165 180 195\n32 48 64 80 96 112 128 144 160 176 192 208\n34 51 68 85 102 119 136 153 170 187 204 221\n36 54 72 90 108 126 144 162 180 198 216 234\n38 57 76 95... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis problem is different with h... | [{"type": "stdin_stdout", "input": "100\noooooooooooooooooooooooooooooooooooooooooooooooooovvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwvvvvvvvvvvvvvvvv\n", "output": "? 1 100\n? 1 99\n! 8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"type": "stdin_stdout", "input": "100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter a successful year of milk ... | [{"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 16 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 2 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDrazil likes heap very much. So ... | [{"type": "stdin_stdout", "input": "2\n3 1\n7 6 3 5 4 2 1\n3 1\n23 6 5 4 3 2 1\n", "output": "1\n1 1 1 1 1 1\n1\n1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "2\n3 1\n14 10 3 5 4 2 1\n3 2\n23 12 9 4 3 2 1\n", "output": "1\n1 1 1 1 1 1\n8\n1 1 1 3\n"}, {"type": "stdin_stdout", "input": "2\n3 2\n14 6 3 5 4 2 1\n3 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA penguin Rocher has n sticks. H... | [{"type": "stdin_stdout", "input": "4\n1\n2\n3\n20\n", "output": "1\n1\n2\n10\n"}, {"type": "stdin_stdout", "input": "4\n1\n3\n3\n20\n", "output": "1\n2\n2\n10\n"}, {"type": "stdin_stdout", "input": "4\n3\n2\n12\n15\n", "output": "2\n1\n6\n8\n"}, {"type": "stdin_stdout", "input": "4\n1\n3\n1\n20\n", "output": "1\n2\n1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCarousel Boutique is busy again!... | [{"type": "stdin_stdout", "input": "5 5\nzbacg\nbaaac\naaaaa\ndaaae\nweadd\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "5 5\nzbacf\nbcaaa\naaaaa\neaaad\nveadd\n", "output": "28\n"}, {"type": "stdin_stdout", "input": "5 5\nabzcg\nbaaac\naaaaa\neaabd\nwdaed\n", "output": "27\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou and your friend are playing ... | [{"type": "stdin_stdout", "input": "6\n8\n1 0 1 1 0 1 1 1\n5\n1 1 1 1 0\n7\n1 1 1 1 0 0 1\n6\n1 1 1 1 1 1\n1\n1\n1\n0\n", "output": "2\n2\n2\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "6\n8\n1 0 1 1 0 1 1 1\n5\n1 1 1 1 1\n7\n1 1 1 1 0 0 1\n6\n1 1 1 1 1 1\n1\n1\n1\n0\n", "output": "2\n2\n2\n2\n1\n0\n"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSasha likes investigating differ... | [{"type": "stdin_stdout", "input": "10\n65\n70\n66\n68\n69\n62\n64\n92\n61\n67\n", "output": "9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n1 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have n stacks of blocks. The... | [{"type": "stdin_stdout", "input": "1\n30\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe tycoon of a winery empire in... | [{"type": "stdin_stdout", "input": "10\n9\nDDDDDDKDD\n10\nKKDDDDKKDK\n7\nKKDDKDK\n13\nKKKDDKDDDKKKD\n14\nKDDDDKDDKDKDKK\n9\nKKDDKDDKD\n14\nDKDKKKKKDDDKKK\n10\nKDKKDKKKKD\n11\nDDKDKKDDKKD\n3\nKKK\n", "output": "1 2 3 4 5 6 1 1 1 \n1 2 1 1 1 1 1 2 1 3 \n1 2 1 1 1 2 1 \n1 2 3 1 1 1 1 1 1 2 1 1 1 \n1 1 1 1 1 2 1 2 3 1 1 4 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGoa'uld Apophis captured Jack O'... | [{"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n7 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n5 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFurlo and Rublo play a game. The... | [{"type": "stdin_stdout", "input": "50\n153423475 434636879 773155924 97361082 413127059 154467262 26144388 172617533 117328815 312150912 45081238 438413693 686165576 490651756 383872273 601349776 181594954 624158354 48886108 1456962211 631306840 58389993 403293668 405970047 308352764 293917056 430837844 571889516 6763... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe sequence is called ordered i... | [{"type": "stdin_stdout", "input": "5\n834472 -373089 441294 -633071 -957672\n", "output": "3\n1 2 3\n"}, {"type": "stdin_stdout", "input": "5\n834472 -373089 441294 -633071 -1240121\n", "output": "3\n1 2 3"}, {"type": "stdin_stdout", "input": "5\n834472 -373089 441294 -401384 -1240121\n", "output": "3\n1 2 3"}, {"type... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEugeny loves listening to music.... | [{"type": "stdin_stdout", "input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 8\n9 9\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "output": "4\n4\n5\n6\n6\n8\n9\n9\n10\n10\n"}, {"type": "stdin_stdout", "input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 10\n9 15\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nI have an undirected graph consi... | [{"type": "stdin_stdout", "input": "65 55\n54 57\n33 10\n58 33\n26 38\n22 38\n50 22\n47 32\n32 65\n65 55\n55 42\n6 62\n3 62\n56 3\n56 37\n19 37\n1 61\n21 1\n39 21\n39 40\n20 40\n20 29\n18 53\n16 53\n2 9\n2 24\n25 24\n60 25\n60 43\n13 51\n13 59\n59 23\n7 23\n7 17\n5 17\n5 36\n30 36\n45 28\n28 64\n64 63\n63 8\n35 8\n46 3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera wanted to prepare a Codes... | [{"type": "stdin_stdout", "input": "68 85\n43 55 2 4 72 45 19 56 53 81 18 90 11 87 47 8 94 88 24 4 67 9 21 70 25 66 65 27 46 13 8 51 65 99 37 77 71 59 71 79 22 56 49 43 57 85 95 81 40 28 60 36 72 81 60 40 16 78 61 37 29 26 15 95 70 27 50 97\n6 6 48 72 54 31 1 50 29 64 93 9 29 93 66 63 25 90 52 1 66 13 70 44 24 87 32 90... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInna loves digit 9 very much. Th... | [{"type": "stdin_stdout", "input": "44444444444444544444444445444444444444444444444444554444444444444444444444444444444444444444455444444444444444444444444444444444444444545444444444444444444444444444444444444445444444444444444444444444444444444444544444444444444444444444444444444444444444444544444444444444444444444444... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDZY loves Physics, and he enjoys... | [{"type": "stdin_stdout", "input": "20 20\n265918 744212 196368 74731 293587 679367 460805 632939 453630 565881 835276 606327 181087 721045 219431 849838 370939 582350 335676 32244\n2 16 989\n14 19 628\n1 9 483\n5 8 733\n13 19 556\n10 17 911\n1 7 599\n13 17 390\n10 20 965\n17 11 449\n3 15 310\n3 6 557\n14 18 225\n1 18 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter you had helped Fedor to fi... | [{"type": "stdin_stdout", "input": "2\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABA\n2\nABBABAABBAABABBABAABABBAABBABAAABAABABBAABBABAABABBABAABBAABABA neuzaiheshi\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation of n... | [{"type": "stdin_stdout", "input": "30 153\n18 5 24 7 12 6 25 14 21 20 27 4 30 8 23 19 11 13 17 1 29 28 15 22 16 9 2 10 26 3\n", "output": "217.500536909325035\n"}, {"type": "stdin_stdout", "input": "30 136\n1 29 20 25 15 2 3 16 24 30 17 14 7 10 11 22 6 8 23 18 12 5 19 9 26 21 28 13 27 4\n", "output": "217.499666343987... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLife in Bertown has become hard.... | [{"type": "stdin_stdout", "input": "10 45 4\n8 6\n10 2\n9 5\n1 7\n8 7\n7 10\n2 5\n5 10\n10 1\n1 8\n4 1\n10 9\n6 9\n3 7\n10 4\n5 6\n1 5\n4 7\n7 9\n10 3\n4 3\n6 4\n2 1\n5 3\n10 6\n1 9\n8 2\n3 8\n6 3\n8 5\n3 9\n4 2\n7 5\n2 9\n4 5\n2 7\n2 6\n6 7\n8 4\n8 10\n3 2\n4 9\n9 8\n6 1\n3 1\n", "output": "40219200\n"}, {"type": "std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRikhail Mubinchik believes that ... | [{"type": "stdin_stdout", "input": "10001 239\n", "output": "1168798\n"}, {"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638"}, {"type": "stdin_stdout", "input": "10278 674\n", "output": "204510\n"}, {"type": "stdin_stdout", "input": "15744 9999\n", "output": "1020\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA long time ago (probably even i... | [{"type": "stdin_stdout", "input": "911 728 910 407 833 594\n", "output": "Hermione\n"}, {"type": "stdin_stdout", "input": "632 446 352 317 522 451\n", "output": "Hermione\n"}, {"type": "stdin_stdout", "input": "542 11 820 850 1201 738\n", "output": "Hermione\n"}, {"type": "stdin_stdout", "input": "911 728 910 180 833 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has interviewed Oleg an... | [{"type": "stdin_stdout", "input": "100\nggogogoooggogooggoggogggggogoogoggooooggooggoooggogoooggoggoogggoogoggogggoooggoggoggogggogoogggoooo\n", "output": "gg***oogg***oggoggoggggg******ggooooggooggooogg***ooggoggoogggo***ggogggoooggoggoggoggg***ogggoooo\n"}, {"type": "stdin_stdout", "input": "100\nggogogoooggogooggog... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have n devices that you want... | [{"type": "stdin_stdout", "input": "20 16807\n75250 50074\n43659 8931\n11273 27545\n50879 77924\n37710 64441\n61647 84493\n43043 7988\n22504 82328\n31730 78841\n42613 44304\n33170 17710\n97158 29561\n70934 93100\n80279 51817\n95336 99098\n7827 13513\n29268 23811\n77634 80980\n79150 36580\n58822 11968\n", "output": "0.2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a positive integer n, find... | [{"type": "stdin_stdout", "input": "100000 10\n", "output": "2 2 2 2 2 5 5 5 5 5\n"}, {"type": "stdin_stdout", "input": "2048 11\n", "output": "2 2 2 2 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "1024 10\n", "output": "2 2 2 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "100000 8\n", "output": "2 2 2 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan likes to learn different th... | [{"type": "stdin_stdout", "input": "1000000000000000000 100000000000000000\n", "output": "899999999999999991\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 200000000000000000\n", "output": "799999999999999991\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 101000000000000000\n", "output": "8989... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya is working for the company ... | [{"type": "stdin_stdout", "input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 2 1\n3 1 2\n2 3 3\n1 2 3\n2 2 3\n1 1 3\n2 3 2\n", "output": "1000000000000000000 0\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's suppose you have an array ... | [{"type": "stdin_stdout", "input": "40 39\n25 4 26 34 35 11 22 23 21 2 1 28 20 8 36 5 27 15 39 7 24 14 17 19 33 6 38 16 18 3 32 10 30 13 37 31 29 9 12\n", "output": "-1"}, {"type": "stdin_stdout", "input": "40 38\n32 35 36 4 22 6 15 21 40 13 33 17 5 24 28 9 1 23 25 14 26 3 8 11 37 30 18 16 19 20 27 12 39 2 10 38 29 31\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFirecrackers scare Nian the mons... | [{"type": "stdin_stdout", "input": "3\n-10 4 10\n10 4 10\n0 -7 10\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3\n-3 -2 3\n-4 -12 3\n-6 -4 9\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n-5 -6 5\n-2 -2 10\n-3 4 3\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "3\n1 -7 10\n-7 9 10\n-2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is the middle of 2018 and Mar... | [{"type": "stdin_stdout", "input": "20\n804301132 586588704 822785255 552472140 16115810 148658854 66743034 628305150 677780684 931815125 208050516 401554301 954478790 571480982 387546138 832279893 641889899 80960260 717802881 172455365\n61699500 83254572 29028223 27833657 55743179 118122387 94729965 147554867 62937826... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.