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\nToday, as a friendship gift, Bak...
[{"type": "stdin_stdout", "input": "5\n1073741823 1073741823 181085488 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n1073741823 29972487 1073741823 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n219338430 29972487 1073741823 10737418...
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\nTwo moving objects A and B are m...
[{"input": "-24\n0\n10", "output": "[\"24.00\"]", "fn_name": "meeting_time"}, {"input": "0\n-18\n14", "output": "[\"18.00\"]", "fn_name": "meeting_time"}, {"input": "32\n-14\n14", "output": "[\"9.74\"]", "fn_name": "meeting_time"}, {"input": "12\n15\n5", "output": "[\"60.00\"]", "fn_name": "meeting_time"}, {"input": "1...
code_functional
[ { "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 string s, consisting ...
[{"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabdacdbcacdbcacabaaba\n", "output": "zzzyyxxwddddccbba\n"}, {"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabcacdbcacdbdacabaaba\n", "output": "zzzyyxxwddddcbba\n"}, {"type": "stdin_stdout", "input": "thankstosamarasauteddybearsforthiscontest\n", "output": "yt...
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 given a circle $c$ and a lin...
[{"type": "stdin_stdout", "input": "2 0 3\n2\n-1 -1 11 0\n1 -1 12 3", "output": "-0.83330025 -0.98610835 4.95743818 -0.50354682\n-0.55841103 -1.56669492 4.96717016 0.44260733\n"}, {"type": "stdin_stdout", "input": "2 -1 3\n2\n0 -1 14 0\n1 0 10 11", "output": "-0.99915098 -1.07136793 4.97884641 -0.64436811\n-0.76686667 ...
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 a German University in Cairo ...
[{"type": "stdin_stdout", "input": "65 173 136\n26 18 8 11 1 22 44 6 15 22 13 49 30 36 37 41 25 27 9 36 36 1 45 20 7 47 28 30 30 21 33 32 9 11 16 5 19 12 44 40 25 40 32 36 15 34 4 43 28 19 29 33 7 11 18 13 40 18 10 26 1 48 20 38 1 20 34 8 46 8 32 35 16 49 26 36 11 16 4 29 35 44 14 21 22 42 10 1 3 12 35 30 14 45 2 24 32...
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 clique problem is one of the...
[{"type": "stdin_stdout", "input": "12\n66 4\n12 7\n60 1\n24 4\n48 4\n-1 4\n36 4\n30 4\n6 4\n54 4\n42 2\n18 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "12\n67 4\n12 7\n60 1\n24 4\n48 4\n-1 4\n36 4\n30 4\n6 4\n54 4\n42 2\n18 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "12\n67 8\n12 7\n60 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\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 6 483\n5 8 733\n13 19 556\n10 17 911\n2 7 599\n13 17 390\n10 20 965\n9 11 449\n3 15 310\n3 6 557\n14 18 225\n1 18 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\n# Definition (Primorial Of a Num...
[{"input": "9", "output": "[223092870]", "fn_name": "num_primorial"}, {"input": "8", "output": "[9699690]", "fn_name": "num_primorial"}, {"input": "5", "output": "[2310]", "fn_name": "num_primorial"}, {"input": "4", "output": "[210]", "fn_name": "num_primorial"}, {"input": "3", "output": "[30]", "fn_name": "num_primori...
code_functional
[ { "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 enthusiastic about the p...
[{"type": "stdin_stdout", "input": "5\nelppa 2 2 -1 1 1 0 1 13 1\nan`ban 1 0 3 9 2 2 4 1 0\ncatror 0 2 2 2 1 4 1 18 2\ncqniau 1 3 0 2 -1 3 1 -1 1\nfghplant 0 4 0 3 2 3 0 110 1\n4\nenoki 1 3 2 -1 6 3 1 10 1\ntpmato 1 0 0 10 0 3 -1 1 1\nqotato -1 0 8 4 1 -1 4 7 1\nonion 3 4 0 3 3 7 0 10 1\n3\na 15 1 1 1 1 1 1 14 5\nc 16 ...
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 call some positive integer...
[{"type": "stdin_stdout", "input": "4\n1 1000\n1024 1024\n65536 65536\n999999 1000001\n", "output": " 1000\n 1\n 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\nSeryozha conducts a course dedic...
[{"type": "stdin_stdout", "input": "3000 3000 4 10\n623629309 917769297 890844966 987654319\n", "output": "215591588260257\n"}, {"type": "stdin_stdout", "input": "3000 3000 10 4\n122375063 551934841 132649021 999999937\n", "output": "218197599525055\n"}, {"type": "stdin_stdout", "input": "3000 3000 1000 1000\n794639486...
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\nNatasha is planning an expeditio...
[{"type": "stdin_stdout", "input": "4 100\n84 99 66 69 86 94 89 96 98 93 93 82 87 93 91 100 69 99 93 81 99 84 75 100 86 88 98 100 84 96 44 70 94 91 85 78 86 79 45 88 91 78 98 94 81 87 93 72 96 88 96 97 96 62 86 72 94 84 80 98 88 90 93 73 73 98 78 50 91 96 97 82 85 90 87 41 97 82 97 77 100 100 92 83 98 81 70 81 74 78 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\nYou need to execute several task...
[{"type": "stdin_stdout", "input": "50\n83 43 73 75 11 53 6 43 67 38 83 12 70 27 60 13 9 79 61 30 29 71 10 11 95 87 26 26 19 99 13 47 66 93 91 47 90 75 68 3 22 29 59 12 44 41 64 3 99 100\n31 36 69 25 18 33 15 70 12 91 41 44 1 96 80 74 12 80 16 82 88 25 87 17 53 63 3 42 81 6 50 78 34 68 65 78 94 14 53 14 41 97 63 44 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\nTwo participants are each given ...
[{"type": "stdin_stdout", "input": "12 12\n6 7 5 4 7 8 2 9 12 5 3 5 1 6 7 3 7 9 5 7 1 8 6 8\n6 4 2 1 7 8 1 6 8 5 9 8 1 5 7 2 5 9 6 3 9 2 9 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12 12\n1 6 2 6 8 3 6 4 4 8 7 2 7 5 9 4 2 4 9 5 8 5 3 2\n2 8 6 9 2 6 7 4 6 5 6 3 5 8 7 8 7 1 1 9 9 7 7 3\n", "output": "-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\nConsider the number triangle bel...
[{"input": "20", "output": "[6564120420]", "fn_name": "solve"}, {"input": "8", "output": "[1430]", "fn_name": "solve"}, {"input": "6", "output": "[132]", "fn_name": "solve"}, {"input": "7", "output": "[429]", "fn_name": "solve"}, {"input": "4", "output": "[14]", "fn_name": "solve"}, {"input": "5", "output": "[42]", "fn...
code_functional
[ { "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 AKS algorithm for testing wh...
[{"input": "11213", "output": "[true]", "fn_name": "aks_test"}, {"input": "8192", "output": "[false]", "fn_name": "aks_test"}, {"input": "8191", "output": "[true]", "fn_name": "aks_test"}, {"input": "10", "output": "[false]", "fn_name": "aks_test"}, {"input": "33", "output": "[false]", "fn_name": "aks_test"}, {"input":...
code_functional
[ { "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 cities in Berland. E...
[{"type": "stdin_stdout", "input": "100 62 42\n45 66 13 18 93 47 83 19 41 66 5 70 16 29 54 28 65 91 92 24 90 54 7 40 77 53 68 58 70 65 68 30 94 80 16 18 69 21 94 1 99 61 97 2 69 15 79 38 61 46 88 32 57 84 35 18 17 77 38 91 84 2 53 54 68 19 13 78 62 16 63 17 76 49 28 45 94 13 35 69 37 56 12 41 95 70 57 24 45 84 87 65 14...
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\nEvery year a race takes place on...
[{"type": "stdin_stdout", "input": "76\n342 684 1027 1369 1711 2054 2396 2738 3081 3423 3765 4108 4450 4792 5135 5477 5819 6162 6504 6846 7189 7531 7873 8216 8558 8900 9243 9585 9927 10270 10612 10954 11297 11639 11981 12324 12666 13009 13351 13693 14036 14378 14720 15063 15405 15747 16090 16432 16774 17117 17459 17801...
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 has an integ...
[{"type": "stdin_stdout", "input": "11100010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110...
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\nEven if the world is full of cou...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000100000000\n", "output": "0\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "1 2\n1 -1\n14 -2", "output": "10000006\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 0\n8 -1", "output": "10000000\n"}, {"type": "stdin_stdout", "input": "2 2\n0 0\n14 -1", "output": "9999993\n"}, {"type": "stdin_stdout", "input": "1 2\n-1 2\n3 4", "output": "10000005\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\nHaving bought his own apartment,...
[{"type": "stdin_stdout", "input": "20\n110 466 472\n112 153 152\n424 492 490\n348 366 113\n208 337 415\n491 448 139\n287 457 403\n444 382 160\n325 486 284\n447 454 136\n216 412 418\n217 208 228\n109 436 291\n293 382 421\n483 339 174\n213 327 183\n278 268 147\n181 424 457\n388 289 430\n174 269 305\n20\n221 4 334\n257 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\nTo decide which is the strongest...
[{"type": "stdin_stdout", "input": "100 100\nPSRRPRRSPSPSSSPSSSPSSSSSPSRSPRRPSRSSPSPPRRSRRRRPSSRRRRPSPSPSSRPRPPRSSRSSPSRPRSRPPSRPRPRPSPSPRRSRSPSP\n", "output": "R\n"}, {"type": "stdin_stdout", "input": "100 100\nRRPSSPPPPSRSRPSSPRSPPSPRSRRPSSPRRPSPPSPSPPRSSRPRPRRSSPSRSSRPSRSRRPRPPPSSSRRRPPRRRSPRRSPSSRRRRRPPPRPP\n", "ou...
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\nArthur owns a ski resort on a mo...
[{"type": "stdin_stdout", "input": "2\n4 6\n1 2\n1 3\n2 3\n2 4\n3 4\n3 4\n7 6\n1 2\n1 3\n2 4\n2 5\n3 6\n3 7\n", "output": "2\n3 4 \n4\n4 5 6 7 \n"}, {"type": "stdin_stdout", "input": "2\n4 6\n1 2\n1 3\n2 3\n2 4\n3 4\n3 4\n7 6\n1 2\n1 3\n2 4\n2 5\n3 6\n3 7\n", "output": "2\n3 4 \n4\n4 5 6 7 \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\nYour city has n junctions. There...
[{"type": "stdin_stdout", "input": "100\n174 174 49 152 10 185 101 157 28 177 105 83 155 178 119 123 197 197 56 174 39 53 85 94 72 166 71 43 177 123 186 11 64 82 145 81 11 29 100 10 106 45 138 79 131 90 80 104 149 116 129 30 96 192 11 182 92 157 95 136 152 38 68 34 42 95 164 134 117 75 186 185 28 146 86 24 147 12 166 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\nRead the coordinates of four dif...
[{"type": "stdin_stdout", "input": "3.338679167476614 4.153021285774258 3.5962681645685493 3.0562783924178016 0.7824583380395241 0.6535611152381731 1.4307644766957708 0.2352661769827814\n2.6749426974072605 2.336361124342693 3.280415305064114 1.6735605571901062 -0.04476814775527138 2.2725919391555047 3.1294550602222495 ...
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 know combinations: for examp...
[{"input": "155117520\n30", "output": "[15]", "fn_name": "checkchoose"}, {"input": "155117530\n30", "output": "[-1]", "fn_name": "checkchoose"}, {"input": "3268760\n25", "output": "[10]", "fn_name": "checkchoose"}, {"input": "184756\n20", "output": "[10]", "fn_name": "checkchoose"}, {"input": "184756\n10", "output": "[...
code_functional
[ { "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 the followi...
[{"type": "stdin_stdout", "input": "5\n1\n7\n9\n6\n4\n10\n10\n7\n13\n18\n1\n11\n12\n17\n5\n19\n0", "output": "0\n1\n2\n0\n"}, {"type": "stdin_stdout", "input": "5\n1\n7\n9\n6\n4\n10\n10\n7\n13\n18\n1\n20\n12\n17\n5\n19\n0", "output": "0\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "5\n1\n2\n9\n6\n10\n10\n16\n7\n14\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\nHave you ever played Hanabi? If ...
[{"type": "stdin_stdout", "input": "100\nW4 Y1 W5 R4 W3 Y1 R4 W2 G3 G1 B5 Y5 Y2 Y3 G4 B5 W1 G5 Y5 Y3 G2 Y5 Y5 G5 R2 B3 B1 W5 Y1 W5 B4 W4 R4 B1 R1 W3 R5 R4 G2 W3 W3 R2 W5 Y2 B2 R3 R3 Y1 G5 G2 Y1 R4 Y5 W5 G5 B3 W2 R1 B2 W2 W2 Y5 W3 G1 B1 G2 Y3 W3 G1 W5 W1 G5 G2 Y1 W5 B5 W4 Y5 G2 R3 B4 R5 B1 R1 B4 Y4 Y4 Y3 R5 Y3 B3 W5 R5 ...
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\nWelcome to PC Koshien, players. ...
[{"type": "stdin_stdout", "input": "0000 1000 1000", "output": "2000\n"}, {"type": "stdin_stdout", "input": "0000 0000 1000", "output": "1000\n"}, {"type": "stdin_stdout", "input": "0001 0000 1000", "output": "1001\n"}, {"type": "stdin_stdout", "input": "0101 0000 1000", "output": "1101\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\nPhone number in Berland is a seq...
[{"type": "stdin_stdout", "input": "100\n4004223124942730640235383244438257614581534320356060987241659784249551110165034719443327659510644224\n", "output": "40-04-22-31-24-94-27-30-64-02-35-38-32-44-43-82-57-61-45-81-53-43-20-35-60-60-98-72-41-65-97-84-24-95-51-11-01-65-03-47-19-44-33-27-65-95-10-64-42-24\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\nYou are given N points on a plan...
[{"type": "stdin_stdout", "input": "30\n-7 -23\n-2 5\n13 8\n12 17\n15 -18\n20 6\n21 8\n-13 12\n-4 -20\n-11 -16\n-6 16\n1 -1\n5 -12\n13 -17\n11 10\n8 -9\n-13 3\n19 -13\n-19 -8\n-14 10\n10 3\n-16 -8\n-17 16\n-14 -15\n5 1\n-13 -14\n13 17\n-12 -8\n2 1\n18 5\n", "output": "279169\n"}, {"type": "stdin_stdout", "input": "30\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\nImplement `String#to_cents`, whi...
[{"input": "\"$12345678.90\"", "output": "[1234567890]", "fn_name": "to_cents"}, {"input": "\"$9.69$4.3.7\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"$1.23\\n\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"\\n$1.23\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"$99.99\"", "o...
code_functional
[ { "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 call a sequence $b_1, b_2,...
[{"type": "stdin_stdout", "input": "3\n8\n1 2 7 3 2 1 2 3\n2\n2 1\n7\n4 1 5 2 6 3 7\n", "output": "\n6\n2\n7\n"}, {"type": "stdin_stdout", "input": "3\n8\n1 2 7 3 2 1 2 3\n2\n2 1\n7\n4 1 5 2 6 3 7\n", "output": "6\n2\n7\n"}, {"type": "stdin_stdout", "input": "3\n8\n1 2 7 3 2 1 2 5\n2\n2 1\n7\n4 1 5 2 6 3 7\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\nMany years ago Berland was a sma...
[{"type": "stdin_stdout", "input": "4\n4 3\n6 1 2 1\n4 10\n11 9 11 18\n2 5\n4 3\n3 7\n9 4 11\n", "output": "3\n4\n0\n3\n"}, {"type": "stdin_stdout", "input": "4\n4 3\n10 1 2 1\n4 10\n11 7 11 9\n2 5\n4 3\n3 7\n9 2 9\n", "output": "4\n3\n0\n2\n"}, {"type": "stdin_stdout", "input": "4\n4 3\n10 1 3 1\n4 10\n11 7 11 9\n2 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\nA subsequence of length |x| of s...
[{"type": "stdin_stdout", "input": "ctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqegvwtbxlvvjhebshqaicsovtkcdovytimjggglyxlvglgunbohnkxargymbqvzgsnvjzgxivdgnaesgxqcruaopjuqsyyorrobnelehjnxcetveehlbmeskptivsuhuqupbieumycwczxyqjtwfofehfkpqmjngygwxkaviuyouiippgvlxjgtkxmhcwtzacbllsybgiujyryngapfwjkkyapfgxtcdpc\nctkhagrifaztmnxhm...
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 integers N and K. ...
[{"type": "stdin_stdout", "input": "200000 1\n", "output": "8000000000000000\n"}, {"type": "stdin_stdout", "input": "200000 2\n", "output": "2000000000000000\n"}, {"type": "stdin_stdout", "input": "200000 3\n", "output": "296287407496296\n"}, {"type": "stdin_stdout", "input": "100004 8\n", "output": "3906718787501\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\nCheck if given numbers are prime...
[{"input": "2", "output": "[\"Probable Prime\"]", "fn_name": "prime_or_composite"}, {"input": "3", "output": "[\"Probable Prime\"]", "fn_name": "prime_or_composite"}, {"input": "5", "output": "[\"Probable Prime\"]", "fn_name": "prime_or_composite"}, {"input": "12", "output": "[\"Composite\"]", "fn_name": "prime_or_comp...
code_functional
[ { "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 number a, which he ...
[{"type": "stdin_stdout", "input": "1 536870912\n", "output": "YES\n30\n1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 \n"}, {"type": "stdin_stdout", "input": "1 536870912\n", "output": "YES...
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<image>\n\nInput\n\nThe input co...
[{"type": "stdin_stdout", "input": "10 165056\n", "output": "391 431\n"}, {"type": "stdin_stdout", "input": "10 595169\n", "output": "619 770\n"}, {"type": "stdin_stdout", "input": "10 156555\n", "output": "468 325\n"}, {"type": "stdin_stdout", "input": "10 140634\n", "output": "323 383"}, {"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\nThe Little Elephant loves Ukrain...
[{"type": "stdin_stdout", "input": "100\n922 938 103 689 526 118 314 496 373 47 224 544 495 656 804 754 269 356 354 536 817 597 787 178 516 659 790 993 786 169 866 779 997 350 674 310 219 546 564 893 402 449 751 628 329 686 392 951 716 439 332 563 215 146 746 311 866 773 548 1100 731 183 890 802 488 944 473 25 662 559 ...
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 consist...
[{"type": "stdin_stdout", "input": "ABBACCBACCBCAABCB", "output": "2\n"}, {"type": "stdin_stdout", "input": "ACBAACBCCABCCBBBA", "output": "1\n"}, {"type": "stdin_stdout", "input": "ABCAACBCAABCCBBBC", "output": "3\n"}, {"type": "stdin_stdout", "input": "ACCAAABCAABCCBBBC", "output": "8\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\nPolycarpus is the director of a ...
[{"type": "stdin_stdout", "input": "123\n0 6361 8903 10428 0 258 0 10422 0 0 2642 1958 0 0 0 0 0 8249 1958 0 0 2642 0 0 0 11566 4709 1847 3998 0 1331 0 0 10289 2739 6135 3450 0 0 10994 6069 4337 5854 1331 5854 0 630 630 11244 5928 2706 0 683 214 0 9080 0 0 0 10422 683 11566 10994 0 0 3450 11244 11542 3998 1847 2708 987...
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 doing some spring cleaning...
[{"type": "stdin_stdout", "input": "3\n1 8\n378 590\n0 1001000\n", "output": "26\n3586\n3444149719\n"}, {"type": "stdin_stdout", "input": "3\n0 4\n378 590\n1 1000000\n", "output": "17\n3586\n3439863766\n"}, {"type": "stdin_stdout", "input": "3\n1 4\n323 590\n1 1000000\n", "output": "8\n4758\n3439863766\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\nLately, Mr. Chanek frequently pl...
[{"type": "stdin_stdout", "input": "2\n18\n122\n", "output": "14\n114\n"}, {"type": "stdin_stdout", "input": "2\n20\n122\n", "output": "15\n114\n"}, {"type": "stdin_stdout", "input": "2\n12\n122\n", "output": "9\n114\n"}, {"type": "stdin_stdout", "input": "2\n10\n122\n", "output": "8\n114\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\nThe annual college sports-ball t...
[{"type": "stdin_stdout", "input": "3\n0 0 100 0 100 0 0 0\n100 0 100 0 0 0 100 100\n0 0 0 100 100 0 0 0\n100 100 0 0 0 0 100 100\n0 100 0 100 0 0 100 0\n100 100 100 100 100 0 0 0\n100 0 100 0 0 100 0 0\n100 0 100 0 100 100 100 0\n", "output": "12.00000000000000"}, {"type": "stdin_stdout", "input": "3\n0 53 31 33 2 34 ...
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\nNezzar has a binary string s of ...
[{"type": "stdin_stdout", "input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\n0110001110\n1 10\n5 9\n7 10\n1 7\n3 5\n6 10\n5 2\n10000\n11000\n2 5\n1 3\n", "output": "\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\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\nFor a positive integer n, let us...
[{"type": "stdin_stdout", "input": "100000000\n", "output": "914705724\n"}, {"type": "stdin_stdout", "input": "91304885\n", "output": "555850206\n"}, {"type": "stdin_stdout", "input": "89317875\n", "output": "494668252\n"}, {"type": "stdin_stdout", "input": "78876118\n", "output": "915018436\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\nYou are given a chessboard consi...
[{"type": "stdin_stdout", "input": "5 3 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n1\n2\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n2\n3\n3\n2\n"}, {"type": "stdin_stdout", "input": "5 5 5\n4 4\n3 5\n2 3\n3 3\n3 5\n", "output": "0\n2\n2\n3\n2\n"}, {"type": "stdin_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\nKris works in a large company \"...
[{"type": "stdin_stdout", "input": "17 1 1\n2 1 1000000000\n", "output": "1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n"}, {"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\nYeah, we failed to make up a New...
[{"type": "stdin_stdout", "input": "5\n3 1\n15 21\n4 13\n13 2\n8 1\n", "output": "1 2 3\n1 2 3 4 5 6 7 8 9 10 15 13 14 11 12\n-1\n1 2 3 4 5 6 7 8 9 10 11 13 12\n1 2 3 4 5 6 7 8\n"}, {"type": "stdin_stdout", "input": "5\n3 2\n10 21\n4 13\n13 2\n8 1\n", "output": "1 3 2\n1 2 3 4 5 10 8 9 6 7\n-1\n1 2 3 4 5 6 7 8 9 10 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\nThere are n games in a football ...
[{"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 6 0 0\n3 3 3 2\n", "output": "yes\nyes\nyes\nyes\nno\n"}, {"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 3 3 -1\n3 3 3 2\n", "output": "yes\nyes\nyes\nno\nno\n"}, {"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 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\nAmugae has a hotel consisting of...
[{"type": "stdin_stdout", "input": "100\nLLLLLLLLLL0L2L48LL6L7L7L0L3L0L63LL3L4L9L2L7L6L3L8L2L5L9L0L3L3L9L3L3L3L5L2L2L2L1L8L5L7L9L2L05L0LL6L2L\n", "output": "1111111111\n"}, {"type": "stdin_stdout", "input": "100\nRRLLLLLLRR1R7R3L2R0L52RR2R4L1L7L6R4R0R4L5L4L5R2R8L7R0R6R4R8L6L8L4R5R7R3L9R7L64RR8L0R6R4R9L0R9R7R7R0L\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\nFor given n points in metric spa...
[{"type": "stdin_stdout", "input": "3\n1.2898350068806816 1.1467446289152408\n2.4176469021911005 0.7451543895838713\n1.341841261706021 1.7448621958767283", "output": "0.600374279\n"}, {"type": "stdin_stdout", "input": "3\n1.2898350068806816 1.8470651543589152\n3.7080917383371705 0.7451543895838713\n1.341841261706021 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\n### Task\n King Arthur and his k...
[{"input": "[-1, -1, -1]", "output": "[false]", "fn_name": "invite_more_women"}, {"input": "[1, -1, 1]", "output": "[true]", "fn_name": "invite_more_women"}, {"input": "[1, 1, 1]", "output": "[true]", "fn_name": "invite_more_women"}, {"input": "[1, -1]", "output": "[false]", "fn_name": "invite_more_women"}, {"input": "...
code_functional
[ { "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 Menger Sponge is a three-dim...
[{"input": "6", "output": "[64000000]", "fn_name": "calc_ms"}, {"input": "5", "output": "[3200000]", "fn_name": "calc_ms"}, {"input": "4", "output": "[160000]", "fn_name": "calc_ms"}, {"input": "3", "output": "[8000]", "fn_name": "calc_ms"}, {"input": "2", "output": "[400]", "fn_name": "calc_ms"}, {"input": "1", "outpu...
code_functional
[ { "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 Squidward, Spongebob and...
[{"type": "stdin_stdout", "input": "101\n1 50 170 269 214 153 132 234 181 188 180 225 226 200 197 122 181 168 160 220 223 160 235 94 257 145 199 235 102 146 119 60 109 134 209 260 210 191 180 271 236 195 155 169 166 143 106 102 208 137 278 269 156 251 198 165 111 198 151 213 256 121 276 163 179 285 104 99 139 122 188 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\nThis is a story of a world somew...
[{"type": "stdin_stdout", "input": "3 3\n3 4 1 1\n2 1 5\n2 3 3\n3 6\n3 2 5 1\n2 1 5\n2 3 3\n0 0", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input": "3 6\n3 8 1 1\n2 2 6\n2 2 3\n3 3\n3 2 5 1\n2 1 11\n2 3 3\n0 0", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "3 2\n3 11 1 1\n2 2 8\n2 2 3\n3 5\n3 4 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\nBecause of budget cuts one IT co...
[{"type": "stdin_stdout", "input": "444\n", "output": "2159776046970635520\n"}, {"type": "stdin_stdout", "input": "498\n", "output": "5392730685240975000"}, {"type": "stdin_stdout", "input": "500\n", "output": "5567867859752100000"}, {"type": "stdin_stdout", "input": "500\n", "output": "5567867859752100000"}, {"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\nRoma is playing a new expansion ...
[{"type": "stdin_stdout", "input": "10 10 10\n51 87\n68 743\n82 1284\n73 936\n55 242\n89 1554\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 386\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 84 386\n97 4 386\n45 56 386\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 guessed some integer number $...
[{"type": "stdin_stdout", "input": "25\n2\n999389 999917\n2\n999307 999613\n2\n999529 999611\n2\n999221 999853\n2\n999683 999433\n2\n999907 999749\n2\n999653 999499\n2\n999769 999931\n2\n999809 999287\n2\n999233 999239\n2\n999553 999599\n2\n999371 999763\n2\n999491 999623\n2\n999961 999773\n2\n999671 999269\n2\n999883 ...
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\nAccording to the regulations of ...
[{"type": "stdin_stdout", "input": "100 100\n51 93 101 960 2 477 213 129 663 925 254 78 1486 274 160 481 132 156 589 372 3 57 210 298 1771 7 359 468 254 406 202 929 221 366 552 97 555 29 634 118 539 140 992 854 7 163 134 103 940 30 409 1003 564 43 555 79 107 40 23 103 643 171 310 382 770 288 18 189 570 177 29 54 855 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\n# Task\n In the Land Of Chess, b...
[{"input": "\"d7\"\n\"f5\"", "output": "[[\"c8\", \"h3\"]]", "fn_name": "bishop_diagonal"}, {"input": "\"d8\"\n\"b5\"", "output": "[[\"b5\", \"d8\"]]", "fn_name": "bishop_diagonal"}, {"input": "\"a1\"\n\"h8\"", "output": "[[\"a1\", \"h8\"]]", "fn_name": "bishop_diagonal"}, {"input": "\"g3\"\n\"e1\"", "output": "[[\"e1\...
code_functional
[ { "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\nAlyona's mother wants to present...
[{"type": "stdin_stdout", "input": "15 10\n1 9\n4 8\n4 8\n5 9\n1 9\n3 5\n1 6\n1 9\n2 6\n6 9\n", "output": "3\n0 1 2 0 1 2 0 1 2 0 1 2 0 1 2\n"}, {"type": "stdin_stdout", "input": "15 10\n1 9\n4 8\n4 8\n5 9\n1 9\n3 5\n1 6\n1 9\n4 6\n6 9\n", "output": "3\n0 1 2 0 1 2 0 1 2 0 1 2 0 1 2\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 postcards and pho...
[{"type": "stdin_stdout", "input": "CPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCP\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "PPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPPPPPCCCPPPPCCCCCPCC\n", "output": "23\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\n[INSPION FullBand Master - INSPI...
[{"type": "stdin_stdout", "input": "50\n21 10\n30 22\n3 37\n37 32\n4 27\n18 10\n2 30\n29 19\n6 37\n12 39\n47 25\n41 49\n45 9\n25 48\n16 14\n10 7\n33 28\n3 31\n34 16\n35 37\n27 40\n45 16\n29 44\n16 15\n26 3\n1 12\n2 13\n15 21\n43 14\n9 33\n44 15\n46 1\n38 5\n15 5\n1 32\n42 35\n20 27\n23 12\n1 16\n15 17\n36 50\n13 8\n49 ...
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 33\n21 15 12 11 20 19 12\n", "output": "57\n"}, {"type": "stdin_stdout", "input": "7 20\n2 15 12 11 20 19 12\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "7 20\n1 15 12 11 29 20 12\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "7 20\n1 13 12 11 29 20 12\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\nFor a given weighted graph $G = ...
[{"type": "stdin_stdout", "input": "5\n0 3 2 4 3 1 1 2\n1 2 3 3 3 4\n2 3 0 3 3 2 4 1\n3 4 0 1 0 -1 1 0 3 3\n4 2 0 1 3 3", "output": "0 0\n1 1\n2 4\n3 1\n4 5\n"}, {"type": "stdin_stdout", "input": "5\n0 3 2 4 3 1 1 2\n1 2 1 4 3 4\n2 3 0 10 3 0 4 1\n3 4 0 1 0 1 1 1 1 3\n4 2 2 1 3 3", "output": "0 0\n1 2\n2 4\n3 1\n4 5\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\nDima is a beginner programmer. D...
[{"type": "stdin_stdout", "input": "15 12\n2\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "12\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\n"}, {"type": "stdin_stdout", "input": "15 12\n9\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "5\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\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\nGiven is a three-digit integer N...
[{"type": "stdin_stdout", "input": "117\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "974\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "477\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "758\n", "output": "Yes\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\nYou are given two binary strings...
[{"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010101\n11110000\n", "output": "1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010100\n11110000\n", "output": "1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n10101010101...
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": "6\n885\n419\n821\n635\n63\n480\n", "output": "781453/1566442\n175559/352798\n674039/1351366\n403199/808942\n395...
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 little time left before...
[{"type": "stdin_stdout", "input": "47 43\nerase 1\nalloc 95\nalloc 53\nerase 2\ndefragment\nalloc 100\nerase 4\nerase 2\nerase -849472053\ndefragment\nerase -638355221\nalloc 90\nerase 3\nerase 2\ndefragment\nalloc 17\nerase 5\ndefragment\nerase 6\ndefragment\nerase 3\ndefragment\ndefragment\nalloc 99\nalloc 69\nalloc...
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 palindrome is a word, phrase, ...
[{"input": "141221001", "output": "[[22, 141, 1001, 1221]]", "fn_name": "palindrome"}, {"input": "34322122", "output": "[[22, 212, 343, 22122]]", "fn_name": "palindrome"}, {"input": "13598", "output": "[\"No palindromes found\"]", "fn_name": "palindrome"}, {"input": "10015885", "output": "[[88, 1001, 5885]]", "fn_name"...
code_functional
[ { "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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "3\n2\n1 1\n2\n1 1\n3\n1 2 -1", "output": "2\n2\n2\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 1\n2\n1 2\n3\n1 2 -1", "output": "2\n1\n2\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n2\n1 1\n3\n1 2 -1", "output": "1\n2\n2\n"}, {"type": "stdin_stdout", "input": "3\n2\n2 2\n2\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\nThanos sort is a supervillain so...
[{"type": "stdin_stdout", "input": "16\n12 17 18 51 49 54 107 59 68 74 88 91 98 100 66 49\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "16\n12 17 18 51 52 54 56 59 68 74 88 91 98 100 66 49\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "16\n12 17 18 51 52 54 56 59 68 74 88 91 98 100 66 49\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\nWrite a program that takes in a ...
[{"type": "stdin_stdout", "input": "3 \nB\nb\nB", "output": "BattleShip\nBattleShip\nBattleShip\n"}, {"type": "stdin_stdout", "input": "3 \nD\nb\nB", "output": "Destroyer\nBattleShip\nBattleShip\n"}, {"type": "stdin_stdout", "input": "3 \nB\nb\nD", "output": "BattleShip\nBattleShip\nDestroyer\n"}, {"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\nYou are given a text of single-s...
[{"type": "stdin_stdout", "input": "200\nLBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "200\nAAAAAAAAAAAAAA...
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# Task\n Changu and Mangu are gr...
[{"input": "134", "output": "[false]", "fn_name": "survivor"}, {"input": "15", "output": "[false]", "fn_name": "survivor"}, {"input": "289", "output": "[true]", "fn_name": "survivor"}, {"input": "5", "output": "[false]", "fn_name": "survivor"}, {"input": "8", "output": "[false]", "fn_name": "survivor"}, {"input": "9", ...
code_functional
[ { "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 loves Inna very much. He de...
[{"type": "stdin_stdout", "input": "11 11 9 11\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 2 2 1\n1 1 1 1 1 1 1 1 3 1 1\n1 1 1 1 1 1 1 3 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 2 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n3 3 3 3 3 3 3 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\n# Your Task\nYou have a cuboid w...
[{"input": "3\n7\n11", "output": "[11088]", "fn_name": "subcuboids"}, {"input": "4\n5\n6", "output": "[3150]", "fn_name": "subcuboids"}, {"input": "2\n3\n3", "output": "[108]", "fn_name": "subcuboids"}, {"input": "2\n2\n2", "output": "[27]", "fn_name": "subcuboids"}, {"input": "1\n1\n1", "output": "[1]", "fn_name": "su...
code_functional
[ { "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 decided to play with a...
[{"type": "stdin_stdout", "input": "999999999999990\n", "output": "181818181818180\n"}, {"type": "stdin_stdout", "input": "999999999999991\n", "output": "181818181818181\n"}, {"type": "stdin_stdout", "input": "999999999999996\n", "output": "181818181818181\n"}, {"type": "stdin_stdout", "input": "999999999999997\n", "ou...
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 a 3 \\times 3 grid. A nu...
[{"type": "stdin_stdout", "input": "19 -1 0\n2 3 6\n4 -4 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 3\n2 2 3\n2 -4 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 0\n2 2 3\n2 -4 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 0\n2 2 3\n4 -4 2", "output": "No\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\n> In information theory and comp...
[{"input": "\"qlzcfayxiz\"\n\"vezkvgejzb\"", "output": "[9]", "fn_name": "levenshtein"}, {"input": "\"nayvyedosf\"\n\"sjxen\"", "output": "[9]", "fn_name": "levenshtein"}, {"input": "\"kitten\"\n\"sitting\"", "output": "[3]", "fn_name": "levenshtein"}, {"input": "\"sjxen\"\n\"sjxen\"", "output": "[0]", "fn_name": "leve...
code_functional
[ { "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 was a powerful school wher...
[{"type": "stdin_stdout", "input": "3\n156 120\n100 50\n80 100", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n156 120\n100 50\n80 000", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n156 159\n100 50\n80 000", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n156 22\n100 50\n152 000", "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\nSnuke, who loves animals, built ...
[{"type": "stdin_stdout", "input": "10\noxooxoxoox\n", "output": "SSWWSSSWWS\n"}, {"type": "stdin_stdout", "input": "10\nxooxoxooxo", "output": "SWWSSSWWSS\n"}, {"type": "stdin_stdout", "input": "10\nxxooxoxooo", "output": "SWSWWWSSSS\n"}, {"type": "stdin_stdout", "input": "10\noxooooxxox", "output": "SSWWSWWWWS\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\n*** Nova polynomial from roots**...
[{"input": "[-1, 1, 2, -2]", "output": "[[4, 0, -5, 0, 1]]", "fn_name": "poly_from_roots"}, {"input": "[1, 1, 1, 1]", "output": "[[1, -4, 6, -4, 1]]", "fn_name": "poly_from_roots"}, {"input": "[0, 0, 0, 0]", "output": "[[0, 0, 0, 0, 1]]", "fn_name": "poly_from_roots"}, {"input": "[4]", "output": "[[-4, 1]]", "fn_name":...
code_functional
[ { "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\nTo make a paper airplane, one ha...
[{"type": "stdin_stdout", "input": "10000 10000 1 1\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "10000 10000 1 1\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "10000 10000 3 2\n", "output": "16670000\n"}, {"type": "stdin_stdout", "input": "10000 10000 3 2\n", "output": "16670000\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\n<!--\n\nProblem B\n\n-->\n\nOn-S...
[{"type": "stdin_stdout", "input": "3 9\nABCDEFGHI\nJKLMNOPQR\nSTUVWXYZ_\nICPC\n5 11\n___________\n____A______\n________M__\n___________\n_C_________\nACM\n4 21\n1_2_3_4_5_6_7_8_9_0_-\nQqWwEeRrTtYyUuIiOoPp@\nAaSsDdFfGgHhJjKkLl;^:\nZzXxCcVvBbNnMm,_._/__\nICPC2019,AsiaYokohamaRegional,QualificationRound\n0 0", "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\n# Task\nGiven a number `n`, retu...
[{"input": "87754", "output": "[\"3^10+3^9+3^8+3^7+3^5+3^3+3^1+3^0\"]", "fn_name": "sum_of_threes"}, {"input": "5559060566575209", "output": "[\"3^33+3^9+3^1\"]", "fn_name": "sum_of_threes"}, {"input": "8312964441463288", "output": "[\"Impossible\"]", "fn_name": "sum_of_threes"}, {"input": "1418194818", "output": "[\"I...
code_functional
[ { "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 house with $n$ flats ...
[{"type": "stdin_stdout", "input": "100\n0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 -1 1 0\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "100\n0 0 1 0 1 0 1 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\nAlexander is learning how to con...
[{"type": "stdin_stdout", "input": "2\n110111100000101101101011001110100111011001000000000000000000\n", "output": "1000000000000000000"}, {"type": "stdin_stdout", "input": "2\n110111100000101101101011001110100111011001000000000000000000\n", "output": "1000000000000000000"}, {"type": "stdin_stdout", "input": "2\n1110110...
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 penguin Polo loves his ho...
[{"type": "stdin_stdout", "input": "1000 8\n", "output": "339760446\n"}, {"type": "stdin_stdout", "input": "1000 6\n", "output": "834332109\n"}, {"type": "stdin_stdout", "input": "1000 1\n", "output": "760074701\n"}, {"type": "stdin_stdout", "input": "1000 5\n", "output": "583047503\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\nSome dwarves that are finishing ...
[{"type": "stdin_stdout", "input": "aaaabcccca\naaaadccccb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "aaaabcccca\naaaadccdcb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "accccbaaaa\naaaadccdcb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "rtfabanpc\natfabrnpc\n", "output": "YES\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 Russia, there is an army-purp...
[{"input": "\"MDZHBMDZHB 855 56 KLASA 81 00 02 91\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MD2HB 60 1S0 AKKRETSIA 58 89 54 54\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MDZHB 12 733 EDIN ENIE 67 79 66 32\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MDZHB 12 733 6...
code_functional
[ { "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": "100\n891 894 462 899 163 868 418 903 31 333 670 32 705 561 505 920 414 81 723 603 513 25 896 879 703 415 799 271 440 8 596 207 296 116 458 646 781 842 963 174 157 747 207 996 361 371 721 447 566 438 566 449 522 176 79 740 757 156 436 296 23 704 542 572 455 886 962 194 219 301 437 315...
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 Susie listens to fairy ta...
[{"type": "stdin_stdout", "input": "67\n1 1\n3 8\n4 10\n7 8\n9 2\n10 1\n11 5\n12 8\n13 4\n16 6\n18 3\n19 3\n22 5\n24 6\n27 5\n28 3\n29 3\n30 5\n32 5\n33 10\n34 7\n35 8\n36 5\n41 3\n42 2\n43 5\n46 4\n48 4\n49 9\n52 4\n53 9\n55 1\n56 4\n59 7\n68 7\n69 4\n71 9\n72 10\n74 5\n76 4\n77 9\n80 7\n81 9\n82 5\n83 5\n84 9\n85 7\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\nKaavi, the mysterious fortune te...
[{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294\n"}, {"type": "stdin_stdout", "input": "ba...
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 dices each one having...
[{"input": "3\n100\n100", "output": "[4851]", "fn_name": "outcome"}, {"input": "6\n10\n27", "output": "[39662]", "fn_name": "outcome"}, {"input": "5\n10\n27", "output": "[6000]", "fn_name": "outcome"}, {"input": "4\n10\n27", "output": "[480]", "fn_name": "outcome"}, {"input": "10\n5\n13", "output": "[220]", "fn_name": ...
code_functional