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\nNiwel is a little golden bear. A... | [{"type": "stdin_stdout", "input": "7 15 10\n1 3 776124\n6 7 769968\n2 1 797048\n4 3 53774\n2 7 305724\n4 1 963904\n4 6 877656\n4 5 971901\n1 4 803781\n3 1 457050\n3 7 915891\n1 7 8626\n5 7 961155\n3 4 891456\n5 4 756977\n", "output": "1552248.0000000000\n"}, {"type": "stdin_stdout", "input": "10 16 63\n1 2 1\n2 10 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\nWherever the destination is, who... | [{"type": "stdin_stdout", "input": "20 50000 50000\n2 45955 55488\n1 19804 29337\n2 3767 90811\n2 24025 33558\n1 46985 56518\n2 21094 30627\n2 5787 15320\n1 4262 91306\n2 37231 46764\n1 18125 27658\n1 36532 12317\n1 31330 40863\n1 18992 28525\n1 29387 38920\n1 44654 54187\n2 45485 55018\n2 36850 46383\n1 44649 54182\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\nFor the multiset of positive int... | [{"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n540 648 810 648 720 540 594 864 972 648\n", "output": "54\n"}, {"type": "stdin_stdout", "input": "3\n166299 110866 86856\n", "output": "332598\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\nThere are many anime that are ab... | [{"type": "stdin_stdout", "input": "28567 13\n28079 24675 1\n18409 26720 1\n980 10815 1\n20794 16571 1\n7376 19861 1\n11146 706 1\n4255 16391 1\n27376 18263 1\n10019 28444 1\n6574 28053 1\n5036 16610 1\n3543 7122 1\n512 9554 1\n", "output": "928433852\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 0\n2 3 1\n3 4 0\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\nIahub helps his grandfather at t... | [{"type": "stdin_stdout", "input": "100\n1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0\n", "output": "1446"}, {"type": "stdin_stdout", "input": "50\n1 1 0 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\nAlice received a set of Toy Trai... | [{"type": "stdin_stdout", "input": "100 50\n29 35\n10 75\n29 34\n10 87\n29 13\n29 38\n41 21\n10 6\n29 94\n10 47\n31 27\n41 24\n41 8\n10 93\n41 52\n41 36\n31 32\n85 81\n31 32\n41 79\n41 99\n85 88\n41 25\n31 68\n41 93\n10 87\n85 97\n41 85\n10 64\n10 68\n85 22\n10 45\n85 15\n10 16\n10 21\n41 66\n29 68\n41 96\n29 34\n10 22... | 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\nKyoya Ootori has a bag with n co... | [{"type": "stdin_stdout", "input": "47\n20\n21\n16\n18\n24\n20\n25\n13\n20\n22\n26\n24\n17\n18\n21\n22\n21\n23\n17\n15\n24\n19\n18\n21\n20\n19\n26\n25\n20\n17\n17\n17\n26\n32\n20\n21\n25\n28\n24\n21\n21\n17\n28\n20\n20\n31\n19\n", "output": "295545118\n"}, {"type": "stdin_stdout", "input": "25\n35\n43\n38\n33\n47\n44\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$ startups. Startups... | [{"type": "stdin_stdout", "input": "50\n36 36 45 44 -1 -1 13 -1 36 -1 44 36 -1 -1 -1 35 -1 36 36 35 -1 -1 -1 14 36 36 22 36 13 -1 35 -1 35 36 -1 -1 13 13 45 36 14 -1 36 -1 -1 -1 22 36 -1 13\n", "output": "949472419\n"}, {"type": "stdin_stdout", "input": "40\n3 3 -1 -1 4 4 -1 -1 -1 -1 -1 10 10 10 10 10 10 4 20 -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\nNauuo is a girl who loves drawin... | [{"type": "stdin_stdout", "input": "10\n5 4\n5 2\n3 7\n9 3\n3 2\n3 1\n3 8\n9 10\n1 6\n", "output": "19200"}, {"type": "stdin_stdout", "input": "9\n5 6\n1 3\n2 3\n7 6\n4 1\n3 6\n8 1\n1 9\n", "output": "7776"}, {"type": "stdin_stdout", "input": "8\n4 5\n1 2\n6 3\n2 3\n2 8\n4 7\n2 4\n", "output": "2304"}, {"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\nMitya has a rooted tree with $n$... | [{"type": "stdin_stdout", "input": "25\n1 2 1 4 4 4 1 2 8 5 1 8 1 6 9 6 10 10 7 10 8 17 14 6\n846 -1 941 -1 1126 1803 988 -1 1352 1235 -1 -1 864 -1 -1 -1 -1 -1 -1 -1 -1 1508 1802 1713 -1\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 1 2 3 4 5 1\n3 -1 -1 -1 -1 3 3 3 3 -1\n", "output": "3\n"}, {"typ... | 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 the spirit of the holidays, S... | [{"type": "stdin_stdout", "input": "200\nNESENEESEESWWWNWWSWSWNWNNWNNESWSWNNWNWNENESENNESSWSESWWSSSEEEESSENNNESSWWSSSSESWSWWNNEESSWWNNWSWSSWWNWNNEENNENWWNESSSENWNESWNESWNESEESSWNESSSSSESESSWNNENENESSWWNNWWSWWNESEENWWWWNWWNWWNENESESSWWSWWSES\nNWNESESSENNNESWNWWSWWWNWSESSSWWNWWNNWSENWSWNENNNWWSWWSWNNNESWWWSSESSWWWSSENWSE... | 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 an array $a$ of le... | [{"type": "stdin_stdout", "input": "16\n998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244362 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 ... | 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\nWhile discussing a proper proble... | [{"type": "stdin_stdout", "input": "100\n57 5 28 44 99 10 66 93 76 32 67 92 67 81 33 3 6 6 67 10 41 72 5 71 27 22 21 54 21 59 36 62 43 39 28 49 55 65 21 73 87 40 0 62 67 59 40 18 56 71 15 97 73 73 2 61 54 44 6 52 25 34 13 20 18 13 25 51 19 66 63 87 50 63 82 60 11 11 54 58 88 20 33 40 85 68 13 74 37 51 63 32 45 20 30 28... | 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\nEvlampiy was gifted a rooted tre... | [{"type": "stdin_stdout", "input": "5\n0 1\n1 3\n2 1\n3 0\n2 0\n", "output": "YES\n2 5 3 1 4 \n"}, {"type": "stdin_stdout", "input": "3\n2 0\n0 2\n2 0\n", "output": "YES\n1 3 2 \n"}, {"type": "stdin_stdout", "input": "3\n0 0\n1 0\n1 0\n", "output": "YES\n1 2 3 \n"}, {"type": "stdin_stdout", "input": "3\n0 1\n3 0\n1 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\nRecently Polycarpus has learned ... | [{"type": "stdin_stdout", "input": "7\n-1 1000000000 999999488 999999488 1000000000 1000000000 999999488\n1000000000 -1 999999488 999999488 1000000000 1000000000 999999488\n999999488 999999488 -1 999999999 999999488 999999488 999999999\n999999488 999999488 999999999 -1 999999488 999999488 999999999\n1000000000 10000000... | 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\nArkady plays Gardenscapes a lot.... | [{"type": "stdin_stdout", "input": "52 38 22\n9 25 D\n28 29 C\n29 25 D\n4 28 D\n23 29 D\n24 25 D\n17 12 C\n11 19 C\n13 14 C\n12 15 D\n7 25 C\n2 25 C\n6 17 C\n2 20 C\n15 23 D\n8 21 C\n13 15 D\n29 15 C\n25 20 D\n22 20 C\n2 13 D\n13 22 D\n27 20 C\n1 21 D\n22 17 C\n14 21 D\n4 25 D\n5 23 C\n9 21 C\n2 20 C\n14 18 C\n29 24 C\... | 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\nUjan has a lot of numbers in his... | [{"type": "stdin_stdout", "input": "5\n10 -251 650 475 -114 364 -75754 -982 -532 -151 -484\n10 -623 -132 -317561 -438 20 -275 -323 -530089 -311 -587\n10 450900 -519 903 -401 -789 -606529 277 -267 -682 -161\n10 -246 873 -641 838 719 234 789 -74 -287288 -772972\n10 186 741 -927 -866 -855 578 -1057019 202 162962 -458\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\nHamed has recently found a strin... | [{"type": "stdin_stdout", "input": "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nvvvvvvvv\n", "output": "2728075\n"}, {"type": "stdin_stdout", "input": "vnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssn\nnssnssns\n", "output": "943392\n"}, {"type": "stdin_stdout", "input": "kpjmawawawawawawawawawawawawawawawawa... | 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\nHave you ever used the chat appl... | [{"type": "stdin_stdout", "input": "100 61 71\n11 18 0 47 33 75 91 13 8 21 73 64 50 97 62 50 2 36 68 32 64 74 32 77 81 41 23 44 40 36 45 33 21 68 57 79 75 23 67 37 99 27 30 56 75 62 75 63 46 19 79 42 11 66 21 25 2 12 89 48 75 7 57 85 80 14 82 29 66 47 29 10 1 84 79 39 33 81 73 51 80 67 52 25 38 68 57 53 38 83 83 3 86 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\nZiota found a video game called ... | [{"type": "stdin_stdout", "input": "100 5 5 9 3\n3 4 2 3 4 3 8 5 2 1 1 4 1 1 10 10 7 5 2 9 4 2 10 10 8 2 4 9 6 2 6 7 7 5 7 7 1 8 10 9 9 3 10 3 10 1 1 8 3 6 4 5 5 4 9 5 9 4 8 2 10 8 9 1 5 9 7 2 1 7 9 3 2 9 1 5 4 2 3 10 6 7 8 2 10 1 6 2 1 6 10 9 1 2 2 7 2 8 4 4\n", "output": "1597"}, {"type": "stdin_stdout", "input": "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\nYou are given several queries. E... | [{"type": "stdin_stdout", "input": "11\n1 1000000000000000000 10000000\n2 999 9\n2 999 333111\n0 9 7\n17 128 2\n13 311992186885373952 18\n1971402979058461 750473176484995605 75\n14 19 23\n3 21914624432020321 23\n3 21914624432020321 46\n3 21914624432020321 47\n", "output": "Finite\nInfinite\nFinite\nFinite\nFinite\nFini... | 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 set of size $m$ ... | [{"type": "stdin_stdout", "input": "6 35\n5 7 10 11 13 14 17 18 25 27 28 29 30 31 33 35 36 37 39 40 41 43 46 47 50 52 55 56 57 58 59 60 61 62 63\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "6 30\n3 8 13 16 18 19 21 22 24 25 26 28 29 31 33 42 44 46 49 50 51 53 54 57 58 59 60 61 62 63\n", "output": "10\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\nIn this problem, we will deal wi... | [{"type": "stdin_stdout", "input": "50\n01110100101100100100011001100001110010010000000101\n50\n27 18 7\n22 35 2\n50 35 1\n41 16 1\n27 5 5\n11 6 33\n7 19 2\n9 12 33\n14 37 4\n1 22 8\n22 3 5\n50 42 1\n50 38 1\n29 20 2\n20 34 17\n20 4 29\n16 21 3\n11 43 3\n15 45 1\n12 28 3\n31 34 13\n43 1 8\n3 41 1\n18 3 13\n29 44 6\n47 ... | 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 an array $a$ of $n... | [{"type": "stdin_stdout", "input": "7 20\n21 15 12 11 20 19 12\n", "output": "6"}, {"type": "stdin_stdout", "input": "1 1\n100000\n", "output": "99999"}, {"type": "stdin_stdout", "input": "5 1\n2 2 4 6 1\n", "output": "2"}, {"type": "stdin_stdout", "input": "3 10\n5 5 10\n", "output": "5"}, {"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\nIn order to fly to the Moon Mist... | [{"type": "stdin_stdout", "input": "11\n", "output": "30\n4 2 3 1 4\n4 1 4 11 5\n4 3 4 2 5\n4 2 5 1 6\n4 4 5 3 6\n4 3 6 2 7\n4 5 6 4 7\n4 4 7 3 8\n4 6 7 5 8\n4 5 8 4 9\n4 7 8 6 9\n4 6 9 5 10\n4 8 9 7 10\n4 7 10 6 11\n4 9 10 8 11\n4 8 11 7 1\n4 10 11 9 1\n4 9 1 8 2\n4 11 1 10 2\n4 10 2 9 3\n3 2 7 8\n3 1 7 6\n3 3 8 9\n3 ... | 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\nJon Snow is on the lookout for s... | [{"type": "stdin_stdout", "input": "7 10\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000\n", "output": "9\n10\n11\n12\n13\n14\n14\n15\n16\n17\n"}, {"type": "stdin_stdout", "input": "8 10\n50\n150\n250\n350\n450\n550\n650\n750\n850\n950\n", "output": "10\n12\n13\n14\n15\n16\n17\n18\n19\n19\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\nSummer is coming! It's time for ... | [{"type": "stdin_stdout", "input": "4 5\n87882 40786 3691 85313 46694\n28884 16067 3242 97367 78518\n4250 35501 9780 14435 19004\n64673 65438 56977 64495 27280\n", "output": "747898"}, {"type": "stdin_stdout", "input": "3 3\n100000 100000 100000\n1 100000 100000\n1 1 100000\n", "output": "500003"}, {"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\nOne of Timofey's birthday presen... | [{"type": "stdin_stdout", "input": "25\n0 0 7 7\n0 18 7 29\n7 36 12 41\n7 18 12 29\n15 29 26 36\n7 7 12 18\n12 36 15 41\n15 7 26 18\n12 0 15 7\n12 7 15 18\n7 29 12 36\n12 29 15 36\n15 18 26 29\n26 18 27 29\n12 18 15 29\n26 29 27 36\n0 7 7 18\n26 0 27 7\n7 0 12 7\n15 36 26 41\n26 7 27 18\n26 36 27 41\n15 0 26 7\n0 36 7 ... | 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 set Y of n disti... | [{"type": "stdin_stdout", "input": "100\n713 716 230 416 3 2 597 216 779 839 13 156 723 793 168 368 232 316 98 257 170 27 746 9 616 147 792 890 796 362 852 117 993 556 885 73 131 475 121 753 508 158 473 931 527 282 541 325 606 321 159 17 682 290 586 685 529 11 645 224 821 53 152 966 269 754 672 523 386 347 719 525 92 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\nConsider a sequence [a_1, a_2, .... | [{"type": "stdin_stdout", "input": "7\n", "output": "YES\n1\n2\n5\n6\n3\n4\n7\n"}, {"type": "stdin_stdout", "input": "5\n", "output": "YES\n1\n2\n4\n3\n5\n"}, {"type": "stdin_stdout", "input": "4\n", "output": "YES\n1\n3\n2\n4"}, {"type": "stdin_stdout", "input": "3\n", "output": "YES\n1\n2\n3\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\nPolycarp took $n$ videos, the du... | [{"type": "stdin_stdout", "input": "6 3\n3 3 1 4 1 6\n", "output": "Yes\n2 3 1 "}, {"type": "stdin_stdout", "input": "3 3\n1 1 1\n", "output": "Yes\n1 1 1 "}, {"type": "stdin_stdout", "input": "3 1\n1 10 100\n", "output": "Yes\n3 "}, {"type": "stdin_stdout", "input": "2 1\n1 3\n", "output": "Yes\n2 "}, {"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\nJust to remind, girls in Arpa's ... | [{"type": "stdin_stdout", "input": "10 5 100\n48 73 30 46 95 19 98 73 94 24\n501216 675859 843572 565104 879875 828759 80776 766980 213551 492652\n1 2\n6 5\n7 6\n10 3\n8 1\n", "output": "2237435\n"}, {"type": "stdin_stdout", "input": "10 5 100\n68 55 15 94 53 100 52 68 24 3\n286803 660813 226501 624597 215418 290774 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\nConsider a tree $T$ (that is, a ... | [{"type": "stdin_stdout", "input": "30\n15 21\n21 3\n22 4\n5 18\n26 25\n12 24\n11 2\n27 13\n11 14\n7 29\n10 26\n16 17\n16 27\n16 1\n3 22\n5 19\n2 23\n4 10\n8 4\n1 20\n30 22\n9 3\n28 15\n23 4\n4 1\n2 7\n5 27\n6 26\n6 24\n", "output": "0.0047521072\n0.0089582002\n0.0091024503\n0.0005692947\n0.0158713738\n0.0231639046\n0.... | 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\nKoa the Koala has a binary strin... | [{"type": "stdin_stdout", "input": "0100111100100101001101111001011101011001111100110111101110001001010111100010011100011011101111010111111010010101000001110110111110010001100010101110111111000011101110000000001101010011000111111100000000000000001010011111010111\n", "output": "975171002\n"}, {"type": "stdin_stdout", "i... | 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\nEverybody seems to think that th... | [{"type": "stdin_stdout", "input": "36 81\n4 5 7 8 13 14 16 17 22 23 25 26 31 32 34 35 40 41 43 44 49 50 52 53 58 59 61 62 67 68 70 71 76 77 79 80\n", "output": "9\n3 12 21 30 39 48 57 66 75\n"}, {"type": "stdin_stdout", "input": "14 34\n1 2 4 7 10 12 13 18 19 21 24 27 29 30\n", "output": "2\n14 31\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\nGiant chess is quite common in G... | [{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100000 100000 4\n50001 50001\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\nRick and Morty are playing their... | [{"type": "stdin_stdout", "input": "23\n1 20\n3 9 2 12\n", "output": "Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose\nWin Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win\n"}, {"type": "stdin_stdout", "input": "20\n1 1\n1 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 function $f : R \\rightarrow R... | [{"type": "stdin_stdout", "input": "3 6\n48261735 26888803 75904937\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "21372932\n119405200\n49016134\n21372932\n49016134\n119405200\n"}, {"type": "stdin_stdout", "input": "3 6\n100000000 99999999 0\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "1\n199999999\n99999999\n1\n99999999... | 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 prime number $p$... | [{"type": "stdin_stdout", "input": "7 7 3\n4 0 5 3 1 2 6\n", "output": "0"}, {"type": "stdin_stdout", "input": "6 7 2\n1 2 3 4 5 6\n", "output": "3"}, {"type": "stdin_stdout", "input": "5 5 3\n3 0 4 1 2\n", "output": "1"}, {"type": "stdin_stdout", "input": "3 3 0\n0 1 2\n", "output": "1"}, {"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\nThere are some rabbits in Singap... | [{"type": "stdin_stdout", "input": "54 42164\n810471 434523 262846 930807 148016 633714 247313 376546 142288 30094 599543 829013 182512 647950 512266 827248 452285 531124 257259 453752 114536 833190 737596 267349 598567 781294 390500 318098 354290 725051 978831 905185 849542 761886 55532 608148 631077 557070 355245 929... | 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 assume that v(n) is the ... | [{"type": "stdin_stdout", "input": "6\n885\n419\n821\n635\n63\n480\n", "output": "781453/1566442\n175559/352798\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n"}, {"type": "stdin_stdout", "input": "5\n79\n149\n136\n194\n124\n", "output": "6393/13114\n22199/44998\n135/274\n37631/76042\n14121/28702\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\nAppleman has a very big sheet of... | [{"type": "stdin_stdout", "input": "10 10\n2 5 9\n2 2 9\n2 1 7\n2 3 9\n2 3 4\n2 0 6\n2 3 9\n2 2 8\n2 5 9\n1 9\n", "output": "4\n7\n6\n6\n1\n6\n6\n6\n4\n"}, {"type": "stdin_stdout", "input": "10 9\n2 2 9\n1 1\n2 0 1\n1 8\n2 0 8\n1 2\n2 1 3\n1 4\n2 2 4\n", "output": "7\n2\n10\n4\n5\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\nPolycarpus has a sequence, consi... | [{"type": "stdin_stdout", "input": "10\n375813 659427 484038 348181 432640 368050 271089 721588 345312 630771\n", "output": "29"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 1 2 9 10\n", "output": "11"}, {"type": "stdin_stdout", "input": "10\n6 8 4 5 1 9 10 2 3 7\n", "output": "15"}, {"type": "stdin_stdout", "i... | 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 consider a simplified vers... | [{"type": "stdin_stdout", "input": "15\nADD 14944938\nADD 40032655\nACCEPT 14944938\nACCEPT 40032655\nADD 79373162\nACCEPT 79373162\nADD 55424250\nACCEPT 55424250\nADD 67468892\nACCEPT 67468892\nADD 51815959\nADD 13976252\nADD 2040654\nADD 74300637\nACCEPT 51815959\n", "output": "32\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\nVasily has a deck of cards consi... | [{"type": "stdin_stdout", "input": "100\n9 9 72 55 14 8 55 58 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 34 48 96 79 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 98 ... | 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 Little Elephant loves permut... | [{"type": "stdin_stdout", "input": "125 8\n111 69 3 82 24 38 4 39 42 22 92 6 16 10 8 45 17 91 84 53 5 46 124 47 18 57 43 73 114 102 121 105 118 95 104 98 72 20 56 60 123 80 103 70 65 107 67 112 101 108 99 49 12 94 2 68 119 109 59 40 86 116 88 63 110 14 13 120 41 64 89 71 15 35 81 51 113 90 55 122 1 75 54 33 28 7 125 9 ... | 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 robber has attempted to rob a ... | [{"type": "stdin_stdout", "input": "5 3 8\n12\n8 3 4 5 7 6 8 3 5 4 7 6\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "5 3 7\n8\n4 7 5 5 3 6 2 8\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 5 7\n5\n1 5 7 92 3\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 3 10\n5\n3 3 3 3 3\n", "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\nThere is an automatic door at th... | [{"type": "stdin_stdout", "input": "97 60 1 1\n5 6 6 7 9 10 10 11 11 11 12 13 13 13 13 14 14 15 16 18 20 23 23 24 25 26 29 31 32 35 38 41 43 43 46 47 48 48 49 52 53 54 55 56 58 59 68 70 72 74 78 81 81 82 91 92 96 96 97 98\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "100 30 36 47\n44 155 275 390 464 532 118... | 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 plans to conduct a load... | [{"type": "stdin_stdout", "input": "100\n9997 9615 4045 2846 7656 2941 2233 9214 837 2369 5832 578 6146 8773 164 7303 3260 8684 2511 6608 9061 9224 7263 7279 1361 1823 8075 5946 2236 6529 6783 7494 510 1217 1135 8745 6517 182 8180 2675 6827 6091 2730 897 1254 471 1990 1806 1706 2571 8355 5542 5536 1527 886 2093 1532 48... | 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\nOleg the client and Igor the ana... | [{"type": "stdin_stdout", "input": "tinkoff\nzscoder\n", "output": "fzfsirk\n"}, {"type": "stdin_stdout", "input": "xxxxxx\nxxxxxx\n", "output": "xxxxxx\n"}, {"type": "stdin_stdout", "input": "reddit\nabcdef\n", "output": "dfdeed\n"}, {"type": "stdin_stdout", "input": "bcdef\nabbbc\n", "output": "bccdb\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\nWe start with a string $s$ consi... | [{"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": "4\n5\n231\n7\n2323\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\nThis is an easier version of the... | [{"type": "stdin_stdout", "input": "100 0\n6 7 100 8 5 61 5 75 59 65 51 47 83 37 34 54 87 46 4 26 21 87 12 97 86 68 60 11 62 76 14 83 29 31 91 62 57 80 47 75 85 97 62 77 91 86 14 25 48 77 83 65 39 61 78 77 45 46 90 74 100 91 86 98 55 5 84 42 91 69 100 4 74 98 60 37 75 44 41 12 15 34 36 1 99 16 7 87 36 26 79 42 41 84 17... | 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\nVova and Marina love offering pu... | [{"type": "stdin_stdout", "input": "14 30\n12 10\n1 7\n12 13\n7 3\n14 10\n3 12\n11 1\n2 12\n2 5\n14 3\n14 1\n14 4\n6 7\n12 6\n9 5\n7 10\n8 5\n6 14\n13 7\n4 12\n9 10\n1 9\n14 5\n1 8\n2 13\n5 11\n8 6\n4 9\n9 13\n2 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "59 24\n40 3\n14 10\n17 5\n40 15\n22 40\n9 40\n46... | 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\nJzzhu has picked n apples from h... | [{"type": "stdin_stdout", "input": "100\n", "output": "44\n33 27\n22 11\n25 5\n64 66\n42 44\n31 62\n58 29\n43 86\n15 21\n6 99\n8 12\n85 65\n7 49\n23 46\n16 14\n20 18\n90 92\n48 50\n40 36\n74 37\n35 55\n10 95\n56 60\n47 94\n45 39\n93 87\n88 84\n72 76\n28 24\n75 81\n78 80\n54 52\n38 19\n3 9\n32 30\n91 77\n70 68\n63 69\n2... | 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 Sonya learned about long i... | [{"type": "stdin_stdout", "input": "10\n+ 870566619432760298\n+ 869797178280285214\n+ 609920823721618090\n+ 221159591436767023\n+ 730599542279836538\n? 101001100111001011\n? 001111010101010011\n? 100010100011101110\n? 100110010110001100\n? 110000011101110011\n", "output": "0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "i... | 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 a consi... | [{"type": "stdin_stdout", "input": "12\n4 4 10 13 28 30 41 43 58 61 70 88\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "7\n2 13 22 32 72 91 96\n", "output": "27\n"}, {"type": "stdin_stdout", "input": "5\n5 11 12 109 110\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "2\n1000000 999999\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\nThere are n beacons located at d... | [{"type": "stdin_stdout", "input": "11\n110 90\n100 70\n90 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\n1 1\n2 1\n3 1\n4 1\n5 1\n6 6\n7 7\n", "output": "4\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\nJohn Smith knows that his son, T... | [{"type": "stdin_stdout", "input": "18\n68 32 84 6\n44 53 11 21\n61 34 77 82\n19 36 47 58\n47 73 31 96\n17 50 82 16\n57 90 64 8\n14 37 45 69\n48 1 18 58\n42 34 96 14\n56 82 33 77\n40 66 30 53\n33 31 44 95\n0 90 24 8\n7 85 39 1\n76 77 93 35\n98 9 62 13\n24 84 60 51\n", "output": "8\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\nBarney lives in country USC (Uni... | [{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.0 28.5 27.0 38.0 38.5 39.5 44.5 40.0 40.5 ... | 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 an array of intege... | [{"type": "stdin_stdout", "input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 7 8 9 10\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "7\n10 1 1 1 5 5 3\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n3 5... | 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 string S of leng... | [{"type": "stdin_stdout", "input": "100 26\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\n", "output": "237400\n"}, {"type": "stdin_stdout", "input": "15 3\nabababababababa\n", "output": "345\n"}, {"type": "stdin_stdout", "input": "10 9\nabacadefgh\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\nThere are some ambiguities when ... | [{"type": "stdin_stdout", "input": "100\nuh\nu\nou\nhk\nokh\nuou\nk\no\nuhh\nk\noku\nk\nou\nhuh\nkoo\nuo\nkk\nkok\nhhu\nuu\noou\nk\nk\noh\nhk\nk\nu\no\nuo\no\no\no\nhoh\nkuo\nhuh\nkhu\nuu\nk\noku\nk\nh\nuu\nuo\nhuo\noo\nhu\nukk\nok\no\noh\nuo\nkko\nok\nouh\nkoh\nhhu\nku\nko\nhho\nkho\nkho\nkhk\nho\nhk\nuko\nukh\nh\nkh\... | 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\nWriting light novels is the most... | [{"type": "stdin_stdout", "input": "20 7\n9 7\n3 7\n15 9\n1 3\n11 9\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 2\n10 9\n6 13\n5 8\n14 1\n16 13\n", "output": "38"}, {"type": "stdin_stdout", "input": "8 5\n7 5\n1 7\n6 1\n3 7\n8 3\n2 1\n4 5\n", "output": "9"}, {"type": "stdin_stdout", "input": "7 4\n1 2\n1 3\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\nYou are given a sequence of n in... | [{"type": "stdin_stdout", "input": "20\n-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0\n", "output": "113.875000000000000\n"}, {"type": "stdin_stdout", "input": "10\n-405 -230 252 -393 -390 -259 97 163 81 -129\n", "output": "702.333333333333370\n"}, {"type": "stdin_stdout", "input": "3\n10000 -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\nAn array of integers $p_{1},p_{2... | [{"type": "stdin_stdout", "input": "100\n0 0 57 121 57 0 19 251 19 301 19 160 57 578 664 57 19 50 0 621 91 5 263 34 5 96 713 649 22 22 22 5 108 198 1412 1147 84 1326 1777 0 1780 132 2000 479 1314 525 68 690 1689 1431 1288 54 1514 1593 1037 1655 807 465 1674 1747 1982 423 837 139 1249 1997 1635 1309 661 334 3307 2691 21... | 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\nBob has a permutation of integer... | [{"type": "stdin_stdout", "input": "13\n0 5 5 2 5 4 5 5 3 5 5 5 1\n5 0 6 2 6 4 6 6 3 6 6 6 1\n5 6 0 2 10 4 7 10 3 8 10 9 1\n2 2 2 0 2 2 2 2 2 2 2 2 1\n5 6 10 2 0 4 7 12 3 8 11 9 1\n4 4 4 2 4 0 4 4 3 4 4 4 1\n5 6 7 2 7 4 0 7 3 7 7 7 1\n5 6 10 2 12 4 7 0 3 8 11 9 1\n3 3 3 2 3 3 3 3 0 3 3 3 1\n5 6 8 2 8 4 7 8 3 0 8 8 1\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\nRecently, Dima met with Sasha in... | [{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 5... | 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 is a system administr... | [{"type": "stdin_stdout", "input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output": "DEAD\nDEAD\n"}, {"type": "stdin_stdout", "input": "13\n1 8 2\n1 4 6\n1 5 5\n1 5 5\n2 10 0\n2 9 1\n1 3 7\n2 6 4\n2 6 4\n2 5 5\n1 7 3\n2 3 7\n2 9 1\n", "output": "LIVE\... | 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 legendary Farmer John is thr... | [{"type": "stdin_stdout", "input": "10 15\n1 2\n2 3\n3 4\n4 5\n5 1\n1 6\n2 7\n3 8\n4 9\n5 10\n6 8\n7 9\n8 10\n9 6\n10 7\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "100000 12\n8 7\n1 9\n5 4\n11 12\n7 8\n3 4\n3 5\n12 15\n15 13\n13 14\n7 8\n11 14\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 5\n2... | 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 a = \\{... | [{"type": "stdin_stdout", "input": "15\n1 1 0 0 0 0 0 0 1 0 1 1 1 0 0\n9\n4 10\n13 14\n1 7\n4 14\n9 11\n2 6\n7 8\n3 12\n7 13\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n0 0 0 1 0 0 1 1 1 0\n7\n1 4\n2 5\n1 3\n6 7\n9 9\n1 5\n7 9\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\n0 1 0 1 1 1 0 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\nDima is a beginner programmer. D... | [{"type": "stdin_stdout", "input": "12 12\n9\n11\n5\n3\n7\n2\n8\n6\n4\n10\n12\n1\n", "output": "5\n6\n3\n2\n4\n7\n12\n8\n10\n9\n11\n1\n"}, {"type": "stdin_stdout", "input": "13 4\n10\n5\n4\n8\n", "output": "13\n3\n8\n9\n"}, {"type": "stdin_stdout", "input": "4 3\n2\n3\n4\n", "output": "3\n2\n4\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\nCengiz recently learned Fibonacc... | [{"type": "stdin_stdout", "input": "10\n669924290 408119795 804030560\n663737793 250734602 29671646\n431160679 146708815 289491233\n189259304 606497663 379372476\n707829111 49504411 81710658\n54555019 65618101 626948607\n578351356 288589794 974275296\n400531973 205638174 323247740\n219131617 178762989 799964854\n825160... | 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 country has n cities and n -... | [{"type": "stdin_stdout", "input": "31\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "73741817 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870... | 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\nJzzhu is the president of countr... | [{"type": "stdin_stdout", "input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 3 999999999\n2 499999999\n2 500000000\n2 499999999\n3 999999999\n3 1000000000\n3 1000000000\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "5 5 3\n1 2 999999999\n2 3 1000000000\n3 4 529529529\n5 1 524524524\n5 3 1000000000\n5 524444444\... | 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\nSereja loves all sorts of algori... | [{"type": "stdin_stdout", "input": "yxzyzxzzxyyzzxxxzyyzzyzxxzxyzyyzxyzxyxxyzxyxzyzxyzxyyxzzzyzxyyxyzxxy\n10\n17 67\n6 35\n12 45\n56 56\n14 30\n25 54\n1 1\n46 54\n3 33\n19 40\n", "output": "NO\nNO\nNO\nYES\nYES\nNO\nYES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "zxyzxyzyyzxzzxyzxyzx\n15\n7 10\n17 17\n6 7\n8 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 country with $n$ citi... | [{"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 2 4 7 10 3 7 9 9 \n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 7 8 9 10\n10\n2 1\n2 2\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n", "output": "10 10 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\nDuring the archaeological resear... | [{"type": "stdin_stdout", "input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "2 10\nuh\n+ 1 h\n+ 2 u\n+ 3 h\n- 1\n- 2\n+ 2 h\n+ 3 u\n- 2\n+ 1 u\n- 3\n", "output": "YES\nYE... | 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\nSerge came to the school dining ... | [{"type": "stdin_stdout", "input": "5 1\n8 4 8 7 3\n9\n5\n2 1 3\n1 5 1\n2 1 8\n2 1 7\n2 1 3\n", "output": "8\n8\n8\n8\n8\n"}, {"type": "stdin_stdout", "input": "3 5\n3 2 8\n1 2 8 1 1\n4\n1 3 3\n1 2 2\n2 2 10\n1 1 5\n", "output": "3\n3\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 6\n1 8 2 4\n3 3 6 1 5 2\n3\n1 1 1\n2 ... | 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\nSereja loves number sequences ve... | [{"type": "stdin_stdout", "input": "7\n1 53989\n1 47249\n1 71935\n2 1 3\n1 84520\n1 84185\n2 6 1\n14\n1 2 3 4 5 6 7 8 9 10 11 12 13 14\n", "output": "53989 47249 71935 53989 53989 53989 84520 84185 53989 47249 71935 53989 53989 53989\n"}, {"type": "stdin_stdout", "input": "10\n1 57757\n1 45234\n1 80807\n1 38496\n1 2746... | 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 mobile application store has... | [{"type": "stdin_stdout", "input": "1\n100 26\ns................PPPP.CCCCC..UUUUUU.........YYYQQQQQQQ...GGGGG............MMM.....JJJJ..............\n.OOOOOO....EEE....................................................SSSSSS........LLLLLL......NNNIIII.\n......FFFFFF...VVVV..ZZZBBB...KKKKK..WWWWWWWXXX..RRRRRRR......AAAAADD... | 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've got a list of program war... | [{"type": "stdin_stdout", "input": "60 3\n2012-03-16 16:15:25: Disk size is\n2012-03-16 16:15:25: Network failute\n2012-03-16 16:16:29: Cant write varlog\n2012-03-16 16:16:42: Unable to start process\n2012-03-16 16:16:43: Disk size is too small\n2012-03-16 16:16:53: Timeout detected\n", "output": "2012-03-16 16:16:43\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\nRudolf is on his way to the cast... | [{"type": "stdin_stdout", "input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"type": "stdin_stdout", "input": "10\n0110101101\n1010000101\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "6\n011000\n010011\n", "output": "6\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\nFor strings s and t, we will say... | [{"type": "stdin_stdout", "input": "3 3\n0\n10\n110\n", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "2 2\n00\n01\n", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "2 3\n101\n11\n", "output": "Bob\n"}, {"type": "stdin_stdout", "input": "2 2\n00\n11\n", "output": "Bob\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\nZookeeper is buying a carton of ... | [{"type": "stdin_stdout", "input": "100\n0110110011011111001110000110010010000111111001100001011101101000001011001101100111011111100111101110\n", "output": "23254\n"}, {"type": "stdin_stdout", "input": "12\n011100011100\n", "output": "156\n"}, {"type": "stdin_stdout", "input": "7\n1101001\n", "output": "30\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\nA bracket sequence is a string c... | [{"type": "stdin_stdout", "input": "40 30\n((((((((()()()))))))))((())((()())))(())\n", "output": "((((((((()()()))))))))(())()()\n"}, {"type": "stdin_stdout", "input": "20 10\n((()))()((()()(())))\n", "output": "((()))()()\n"}, {"type": "stdin_stdout", "input": "8 8\n(()(()))\n", "output": "(()(()))\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\nThere are $n$ persons who initia... | [{"type": "stdin_stdout", "input": "16 20 2\n10 3\n5 3\n10 5\n12 7\n7 6\n9 12\n9 6\n1 10\n11 16\n11 1\n16 2\n10 2\n14 4\n15 14\n4 13\n13 15\n1 8\n7 15\n1 7\n8 15\n", "output": "0\n0\n3\n3\n3\n3\n7\n7\n7\n7\n7\n11\n11\n11\n11\n15\n15\n15\n15\n16\n"}, {"type": "stdin_stdout", "input": "5 8 2\n2 1\n4 2\n5 4\n5 2\n4 3\n5 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\nLittle Nastya has a hobby, she l... | [{"type": "stdin_stdout", "input": "aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\naaaaaaaaaaaaaa\n61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 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 new pack of n t-shirts came to... | [{"type": "stdin_stdout", "input": "20\n414468312 20329584 106106409 584924603 666547477 670032002 726095027 276840253 368277336 940941705 531635095 213813062 440421387 959075599 240727854 495316522 838268432 786936631 586382273 806443734\n3 1 2 3 3 2 2 1 3 2 3 2 3 3 3 2 1 3 1 2\n3 1 2 2 2 2 3 1 2 3 2 1 1 2 3 1 2 3 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\nYou are an all-powerful being an... | [{"type": "stdin_stdout", "input": "4\n7 8\nAAPAAAAA\nPPPPAAAA\nPPPPAAAA\nAPAAPPPP\nAPAPPAPP\nAAAAPPAP\nAAAAPPAA\n6 5\nAAAAA\nAAAAA\nAAPAA\nAAPAP\nAAAPP\nAAAPP\n4 4\nPPPP\nPPPP\nPPPP\nPPPP\n3 4\nPPPP\nPAAP\nPPPP\n", "output": "2\n1\nMORTAL\n4\n"}, {"type": "stdin_stdout", "input": "1\n4 4\nAAAA\nAAAA\nAAAA\nAAAA\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\nZS the Coder is playing a game. ... | [{"type": "stdin_stdout", "input": "7\n", "output": "2\n17\n46\n97\n176\n289\n442\n"}, {"type": "stdin_stdout", "input": "4\n", "output": "2\n17\n46\n97\n"}, {"type": "stdin_stdout", "input": "3\n", "output": "2\n17\n46\n"}, {"type": "stdin_stdout", "input": "2\n", "output": "2\n17\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\nThe Bubble Cup hypothesis stood ... | [{"type": "stdin_stdout", "input": "8\n1 1 7 6 1 5 8 7\n", "output": "1\n1\n6\n6\n1\n4\n9\n6\n"}, {"type": "stdin_stdout", "input": "7\n9 6 3 1 3 1 7\n", "output": "9\n6\n2\n1\n2\n1\n6\n"}, {"type": "stdin_stdout", "input": "6\n8 7 8 6 8 9\n", "output": "9\n6\n9\n6\n9\n9\n"}, {"type": "stdin_stdout", "input": "5\n4 1 8... | 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\nMeanwhile, the kingdom of K is g... | [{"type": "stdin_stdout", "input": "30\n1 2\n1 3\n1 4\n2 5\n2 6\n2 7\n4 8\n4 9\n6 10\n6 11\n11 30\n11 23\n30 24\n30 25\n25 26\n25 27\n27 29\n27 28\n23 20\n23 22\n20 21\n20 19\n3 12\n3 13\n13 14\n13 15\n15 16\n15 17\n15 18\n2\n6 17 25 20 5 9 13\n10 2 4 3 14 16 18 22 29 30 19\n", "output": "3\n6\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\nSergey Semyonovich is a mayor of... | [{"type": "stdin_stdout", "input": "10\n2 3\n3 9\n6 3\n9 8\n9 10\n4 8\n3 1\n3 5\n7 1\n", "output": "67\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n1 3\n1 4\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n2 3\n3 4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3\n2 1\n3 2\n", "output": "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\nLet's denote as $\\text{popcount... | [{"type": "stdin_stdout", "input": "18\n1 10\n1 100\n1 1000\n1 10000\n1 100000\n1 1000000\n1 10000000\n1 100000000\n1 1000000000\n1 10000000000\n1 100000000000\n1 1000000000000\n1 10000000000000\n1 100000000000000\n1 1000000000000000\n1 10000000000000000\n1 100000000000000000\n1 1000000000000000000\n", "output": "7\n63... | 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\nAs we all know, Max is the best ... | [{"type": "stdin_stdout", "input": "8 20\n2 4 a\n1 8 a\n1 2 v\n8 4 h\n1 7 w\n5 4 h\n2 8 h\n7 4 i\n4 3 w\n6 8 l\n1 4 v\n1 3 g\n5 3 b\n1 6 a\n7 3 w\n6 4 f\n6 7 g\n7 8 n\n5 8 g\n2 6 j\n", "output": "BAAAAAAA\nBBAAAABA\nBBBBBBBB\nBAABAABA\nBAAABABA\nBAAAABAA\nBAAAAABA\nBAAABABB\n"}, {"type": "stdin_stdout", "input": "5 8\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 2N balls in the xy-pla... | [{"type": "stdin_stdout", "input": "8\n6 2\n5 1\n6 8\n7 8\n6 5\n5 7\n4 3\n1 4\n7 6\n8 3\n2 8\n3 6\n3 2\n8 5\n1 5\n5 8\n", "output": "82060779\n"}, {"type": "stdin_stdout", "input": "4\n3 2\n1 2\n4 1\n4 2\n2 2\n4 4\n2 1\n1 3\n", "output": "7392\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 2\n3 3\n4 4\n1 2\n2 1\n3 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\nThere are N robots and M exits o... | [{"type": "stdin_stdout", "input": "10 10\n4 13 15 18 19 20 21 22 25 27\n1 5 11 12 14 16 23 26 29 30\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "4 5\n2 5 7 11\n1 3 6 9 13\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3 4\n2 5 10\n1 3 7 13\n", "output": "8\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\nAtCoDeer the deer found N rectan... | [{"type": "stdin_stdout", "input": "5\n999999999 1000000000\n1 2\n314 315\n500000 500001\n999999999 1000000000\n", "output": "1999999680\n"}, {"type": "stdin_stdout", "input": "5\n123456 789012\n123 456\n12 345678901\n123456 789012\n1 23\n", "output": "246433\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n5 7\n1 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\nIn number world, two different n... | [{"type": "stdin_stdout", "input": "100\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 954 832 442 424 619 906 154 293 395 439 735 738 915 453 748 786 550 871 932 693 326 53 904 732 835 354 364 691 669 157 719 282 875 573 672 695 790 58 872 732 751 557 779 329 39 213 844 289 137 50 951 284 671 474 ... | 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\nVasya is an active Internet user... | [{"type": "stdin_stdout", "input": "httpftphttptphttphrururuhpftphtpftphtpftphtptpft\n", "output": "http://ftphttptphttph.ru/ruruhpftphtpftphtpftphtptpft\n"}, {"type": "stdin_stdout", "input": "httpuurrruurruuruuruuurrrurururuurruuuuuuruurr\n", "output": "http://uurr.ru/urruuruuruuurrrurururuurruuuuuuruurr\n"}, {"type"... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.