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\nAlexandra has a paper strip with...
[{"type": "stdin_stdout", "input": "2 1000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1\n-1000000000 1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2 1000000000 4\n-1000000000 1000000000\n", "output": "-1"}, {"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\nProblem\n\nThe popular video pos...
[{"type": "stdin_stdout", "input": "110000", "output": "110000\n"}, {"type": "stdin_stdout", "input": "100010", "output": "100000\n"}, {"type": "stdin_stdout", "input": "121470", "output": "121000\n"}, {"type": "stdin_stdout", "input": "101101", "output": "101000\n"}, {"type": "stdin_stdout", "input": "113193", "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\nThis morning Chef wants to jump ...
[{"type": "stdin_stdout", "input": "-114", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-138", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-119", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-17", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-11", "output": "yes\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\nIahub is a big fan of tourists. ...
[{"type": "stdin_stdout", "input": "50\n3987477 8934938 4067156 6712855 7269334 5039822 9533601 9335400 5992073 2619268 438734 8620973 4347619 4307947 2249161 815221 7615258 8244100 8341666 5908546 6646952 4812769 6215114 7479369 6290438 5623785 6466133 9953199 3525873 4326034 3510072 8117068 2342953 1717542 9766539 65...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 multiset (i. e. ...
[{"type": "stdin_stdout", "input": "2\n28\n15 72 79 36 2 43 100 11 236 94 76 83 90 20 58 39 47 57 37 88 92 92 59 80 97 22 20 47 9 88 21 82 94 71 25 38 45 51 23 76 58 5 39 11 15 9 11 24 9 84 90 58 0 37 54 65\n43\n79 24 82 7 26 19 63 22 94 22 4 72 19 5 92 92 83 93 35 19 45 87 40 61 58 65 21 48 96 85 63 100 86 63 30 50 58...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an array, consist...
[{"type": "stdin_stdout", "input": "100\n968 793 -628 -416 942 -308 977 168 728 -879 952 781 -425 -475 -480 738 -740 142 -319 -116 -701 -183 41 324 -918 -391 -176 781 763 888 475 -617 134 -802 -133 -211 855 -869 -236 503 550 387 137 -221 -957 -800 -56 -673 440 -791 -217 -959 -892 886 -593 427 890 223 -425 -342 -262 693...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMasha has $n$ types of tiles of ...
[{"type": "stdin_stdout", "input": "6\n3 4\n1 2\n5 6\n5 7\n7 4\n8 9\n9 8\n2 5\n1 1\n1 1\n2 2\n2 2\n1 100\n10 10\n10 10\n1 2\n4 5\n8 4\n2 2\n1 1\n1 1\n1 2\n3 4\n1 2\n1 1\n1 1\n", "output": "YES\nNO\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\n3 4\n0 2\n5 6\n5 7\n7 4\n8 9\n9 8\n2 5\n1 1\n1 1\n2 2\n2 2\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\nMary has just graduated from one...
[{"type": "stdin_stdout", "input": "10 10000\n", "output": "55\n"}, {"type": "stdin_stdout", "input": "10 10000\n", "output": "55\n"}, {"type": "stdin_stdout", "input": "10 1022\n", "output": "53\n"}, {"type": "stdin_stdout", "input": "10 1023\n", "output": "55\n"}, {"type": "stdin_stdout", "input": "10 1024\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\n\"Pizza At\", a fast food chain,...
[{"type": "stdin_stdout", "input": "1500 2000 500 90000 100000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "1143 3132 1087 90000 100000", "output": "217400000\n"}, {"type": "stdin_stdout", "input": "1500 2445 500 90000 100000", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "1500 3132 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\nSnuke had N cards numbered 1 thr...
[{"type": "stdin_stdout", "input": "7961\n570641734 802212645 776309598 809873412 803841293 359931843 792939994 233099102 401692872 600486353 217303985 108107734 560874418 799955982 883190766 630019949 636623822 273032982 235540677 331099668 777155291 724397459 613181400 534080974 922902142 15555595 732730818 469781636...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBaby Ehab was toying around with...
[{"type": "stdin_stdout", "input": "100\n2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYui Hirasawa, who attends privat...
[{"type": "stdin_stdout", "input": "3\n49 128 67 78 41\n29 59 100 45 84\n50 36 40 95 66\n2\n100 000 100 100 110\n0 0 -1 0 0\n1\n89 90 85 120 82\n0", "output": "363 287\n410 -1\n466 466\n"}, {"type": "stdin_stdout", "input": "3\n49 128 67 78 19\n29 59 100 45 84\n50 36 40 95 66\n2\n100 000 100 100 110\n0 0 -1 0 0\n1\n89 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 people numbered 1 to...
[{"type": "stdin_stdout", "input": "4\nRBRR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRRCR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRRAR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRARR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRCRR", "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\nDuring cleaning the coast, Alice...
[{"type": "stdin_stdout", "input": "5\n3\n1 2 1\n3\n1 1 2\n5\n2 2 2 1 3\n5\n2100 1900 1600 3000 1600\n2\n2443 2445\n", "output": "\nYES\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n3\n1 2 1\n3\n1 1 2\n5\n2 2 2 1 3\n5\n2100 1900 1600 3000 1600\n2\n2443 2445\n", "output": "YES\nYES\nYES\nYES\nNO\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 building of Jewelry Art G...
[{"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 4 17 10", "output": "430\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 6 17 10", "output": "410\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 4 17 11", "output": "420\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 18 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\nHaving two standards for a keypa...
[{"input": "\"0789456123\"", "output": "[\"0123456789\"]", "fn_name": "computer_to_phone"}, {"input": "\"94561\"", "output": "[\"34567\"]", "fn_name": "computer_to_phone"}, {"input": "\"000\"", "output": "[\"000\"]", "fn_name": "computer_to_phone"}, {"input": "\"919\"", "output": "[\"373\"]", "fn_name": "computer_to_ph...
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\nRule 30 is a one-dimensional bin...
[{"input": "[1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1]\n75", "output": "[[1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, ...
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\nAt the pancake shop you work for...
[{"type": "stdin_stdout", "input": "3\n5 4423 -1", "output": "8846\n"}, {"type": "stdin_stdout", "input": "3\n4 1618 1", "output": "3236\n"}, {"type": "stdin_stdout", "input": "3\n4 2801 1", "output": "5602\n"}, {"type": "stdin_stdout", "input": "3\n5 4573 2", "output": "9146\n"}, {"type": "stdin_stdout", "input": "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\nYou are given a convex polygon P...
[{"type": "stdin_stdout", "input": "19\n449447997 711296339\n530233434 692216537\n535464528 613140435\n535533467 100893188\n530498867 -265063956\n519107979 -271820709\n482156929 -287792333\n-303730271 -287970295\n-416935204 -263348201\n-443613873 -249980523\n-453444829 -173903413\n-462102798 -80789280\n-462064673 -1322...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi loves takoyaki - a bal...
[{"type": "stdin_stdout", "input": "1000 1 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "999 10 1000\n", "output": "100000\n"}, {"type": "stdin_stdout", "input": "1000 1 1100", "output": "1100000\n"}, {"type": "stdin_stdout", "input": "1010 1 1100", "output": "1111000\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\nVova, the Ultimate Thule new sha...
[{"type": "stdin_stdout", "input": "499999998500000001 1000000000\n", "output": "999955279\n"}, {"type": "stdin_stdout", "input": "499999998500000000 1000000000\n", "output": "999955279\n"}, {"type": "stdin_stdout", "input": "499999999500000000 1000000000\n", "output": "999999998\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\nYour task is to validate rhythm ...
[{"input": "[7, 2]\n\"222|1112|2222222|2222\"", "output": "[\"Valid rhythm with anacrusis\"]", "fn_name": "validate_rhythm"}, {"input": "[5, 8]\n\"888|448|82|88\"", "output": "[\"Valid rhythm with anacrusis\"]", "fn_name": "validate_rhythm"}, {"input": "[7, 2]\n\"222|111|2222222|1112|2222\"", "output": "[\"Invalid rhyt...
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\n# Task\n Given a `sequence` of i...
[{"input": "[149, 15, 23, 32, 41, 48, 58, 66, 69, 75, 81, 91, 178, 100, 109, 118, 128, 134, 143]", "output": "[false]", "fn_name": "almost_increasing_sequence"}, {"input": "[10, 1, 2, 3, 4, 5]", "output": "[true]", "fn_name": "almost_increasing_sequence"}, {"input": "[4, 5, 6, 1, 2, 3]", "output": "[false]", "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\nMr. A is planning to travel alon...
[{"type": "stdin_stdout", "input": "1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1001\n2 3 3 1 3\n1 3 2300\n1 2 1000\n2 3 1200\n2 6 6 5 1\n1 2 1500\n1 3 4500\n2 6 2000\n5 4 1000\n6 4 2200\n3 5 3000\n0 0 0 0 0", "output": "1000\n1100\n3750\n"}, {"type": "stdin_stdout", "input": "1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1001\n2 3 3 1 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 A = {a1, a2, ..., an} be any...
[{"type": "stdin_stdout", "input": "130 32\n72 56 81 71 45 17 65 13 87 22 17 75 72 80 68 76 62 35 14 53 49 72 19 55 10 57 28 35 66 59 45 24 37 65 46 31 34 1 30 12 37 13 40 41 39 6 31 28 30 0 2 7 23 32 0 34 21 0 23 3 18 33 7 6 20 19 21 10 27 28 19 23 5 15 22 13 14 1 3 14 0 5 1 14 0 0 7 11 10 1 1 1 6 5 3 3 0 1 0 0 0 0 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\nI decided to create a program th...
[{"type": "stdin_stdout", "input": "2\n9\n64", "output": "#########\n# #\n# ##### #\n# # # #\n# # # # #\n# # # # #\n# # ### #\n# # #\n# #######\n\n################################################################\n# #\n# ###########################...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA multi-subject competition is c...
[{"type": "stdin_stdout", "input": "19 2\n1 2\n1 -3\n1 -1\n1 -2\n2 0\n1 -2\n1 -3\n2 -2\n2 -4\n2 -3\n2 0\n1 2\n1 -1\n1 -2\n1 -3\n1 -4\n2 2\n1 1\n1 -4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "19 2\n1 2\n1 -3\n1 -1\n1 -2\n2 0\n1 -2\n1 -3\n2 -2\n2 -4\n2 -3\n2 0\n1 2\n1 -1\n1 -2\n1 -3\n1 -4\n2 2\n1 1\n1 -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\nIn the city, there are two pastr...
[{"type": "stdin_stdout", "input": "2\n-1\n3\n26 4 2\n0", "output": "-1\n16\n"}, {"type": "stdin_stdout", "input": "2\n-1\n3\n26 4 1\n0", "output": "-1\n15\n"}, {"type": "stdin_stdout", "input": "2\n-1\n4\n1 -1 1\n0", "output": "-1\n0\n"}, {"type": "stdin_stdout", "input": "2\n1\n54\n13 9 10\n0", "output": "1\n0\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\nYou are an all-powerful being an...
[{"type": "stdin_stdout", "input": "4\n7 8\nAAP@AABA\nPPPPAAAA\nPPPPAAAA\nAPAAPPPP\nAPAPPAPP\nAAAAPPAP\nAAAAPPAA\n6 5\nAAAAA\nAAAAA\nAAPAA\nAAPAP\nAAAPP\nAAAOP\n4 4\nPPPP\nPPPP\nPPPP\nPPPP\n1 4\nPPPP\nPA@P\nPPPP\n", "output": "2\n1\nMORTAL\nMORTAL\n"}, {"type": "stdin_stdout", "input": "4\n7 8\nAAPAAAAA\nPPPPAAAA\nPPPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 may be familiar with the con...
[{"input": "100\n10", "output": "[17310309456440]", "fn_name": "choose"}, {"input": "200\n8", "output": "[55098996177225]", "fn_name": "choose"}, {"input": "300\n6", "output": "[962822846700]", "fn_name": "choose"}, {"input": "500\n4", "output": "[2573031125]", "fn_name": "choose"}, {"input": "1000\n3", "output": "[166...
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\nVasya has found a strange device...
[{"type": "stdin_stdout", "input": "9999 10000\n", "output": "5000\n"}, {"type": "stdin_stdout", "input": "9999 10000\n", "output": "5000\n"}, {"type": "stdin_stdout", "input": "9998 10000\n", "output": "4999\n"}, {"type": "stdin_stdout", "input": "9998 10000\n", "output": "4999\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\nWe have a sequence of length N c...
[{"type": "stdin_stdout", "input": "10\n1000 193 256 777 -1 3 2173 4898286181422 34 221", "output": "4898286186026\n"}, {"type": "stdin_stdout", "input": "10\n1000 193 256 777 -2 3 1355 4898286181422 34 224", "output": "4898286185212\n"}, {"type": "stdin_stdout", "input": "10\n1000 193 256 777 -2 3 2159 4898286181422 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of $n$ ...
[{"type": "stdin_stdout", "input": "6\n-18 -12 -9 -10 -6 4\n3\n1 6 -9\n1 3 -10\n6 6 -3\n", "output": "3\n-2\n-2\n-4\n"}, {"type": "stdin_stdout", "input": "6\n-9 -12 -9 -6 -6 4\n3\n1 6 -9\n1 2 -10\n4 6 -3\n", "output": "4\n-1\n-1\n-2\n"}, {"type": "stdin_stdout", "input": "6\n-9 -12 -9 -10 -6 4\n3\n1 6 -9\n1 3 -10\n6 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe first positive integer, `n`,...
[{"input": "14313", "output": "[14313]", "fn_name": "find_closest_value"}, {"input": "20005", "output": "[20293]", "fn_name": "find_closest_value"}, {"input": "18331", "output": "[17944]", "fn_name": "find_closest_value"}, {"input": "18332", "output": "[18720]", "fn_name": "find_closest_value"}, {"input": "5000", "outp...
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\nMultiplication of Big Integers I...
[{"type": "stdin_stdout", "input": "-15 87", "output": "-1305\n"}, {"type": "stdin_stdout", "input": "-81 -15", "output": "1215\n"}, {"type": "stdin_stdout", "input": "-1 -111", "output": "111\n"}, {"type": "stdin_stdout", "input": "-23 -15", "output": "345\n"}, {"type": "stdin_stdout", "input": "-46 -15", "output": "6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe marmots have prepared a very...
[{"type": "stdin_stdout", "input": "100 60\n1443 3849 6174 8249 696 8715 3461 9159 4468 2496 3044 2301 2437 7559 7235 7956 8959 2036 4399 9595 8664 9743 7688 3730 3705 1203 12615 7088 8563 3860 2794 8014 6951 1160 8616 970 9885 2421 17193 4885 5246 6146 8849 5141 8602 9486 7257 3300 8323 4797 4082 7135 80 9622 4543 656...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 will be given two strings `a...
[{"input": "\"code*warrior\"\n\"codewars\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"codewar*s\"\n\"codewars\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"code*s\"\n\"codewars\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"aaa*aaa\"\n\"aaa\"", "output": "[false]", "fn_name": "solve...
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\nConsider an array that has no pr...
[{"input": "2000", "output": "[18118]", "fn_name": "solve"}, {"input": "3000", "output": "[46166]", "fn_name": "solve"}, {"input": "1000", "output": "[9110]", "fn_name": "solve"}, {"input": "200", "output": "[1060]", "fn_name": "solve"}, {"input": "300", "output": "[1668]", "fn_name": "solve"}, {"input": "400", "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\nzscoder loves simple strings! A ...
[{"type": "stdin_stdout", "input": "rxxxrrxrxxxxxrrrrrxxxxrrrrxrxxrxxrxrxrrrxrrxrrxrxxxrxrrxrrxrxrxxxxxrxxxxrrrxrxxrxxrxxxrrrrrxrrxrrxrr\n", "output": "rxaxraxrxaxaxrararxaxararaxrxarxarxrxrarxraxraxrxaxrxraxraxrxrxaxaxrxaxararxrxarxarxaxrararxraxraxra\n"}, {"type": "stdin_stdout", "input": "xxxxrrxrxxxxxrrrrrxxxxrrrrx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 integers n and...
[{"type": "stdin_stdout", "input": "9\n6 9\n5 7\n4 6\n4 4\n612 4624\n53 311\n8 25\n3 3\n6 11\n", "output": "YES\n1 1 2 2 4 \nYES\n1 1 2 4 \nYES\n1 2 3 \nYES\n1 1 2 \nYES\n1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 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\nDuring a normal walk in the fore...
[{"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\nproblem\n\nTaro often shop at JO...
[{"type": "stdin_stdout", "input": "380\n-48\n0", "output": "4\n10\n"}, {"type": "stdin_stdout", "input": "380\n10\n0", "output": "4\n10\n"}, {"type": "stdin_stdout", "input": "380\n12\n0", "output": "4\n13\n"}, {"type": "stdin_stdout", "input": "380\n16\n0", "output": "4\n13\n"}, {"type": "stdin_stdout", "input": "380...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce Bob took a paper stripe of ...
[{"type": "stdin_stdout", "input": "100\n-4 2 4 4 1 3 -3 -3 2 1 -4 0 0 2 3 -1 -4 -3 4 -2 -3 -3 -3 -1 -2 -3 -1 -4 0 4 0 -1 4 0 -4 -4 4 -4 -2 1 -4 1 -3 -2 3 -4 4 0 -1 3 -1 4 -1 4 -1 3 -3 -3 -2 -2 4 -3 -3 4 -3 -2 -1 0 -2 4 0 -3 -1 -2 -3 1 -4 1 -3 -3 -3 -2 -3 0 1 -2 -2 -4 -3 -1 2 3 -1 1 1 0 3 -3 -1 -2\n", "output": "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\nBaby Ehab has a piece of Cut and...
[{"type": "stdin_stdout", "input": "100 1\n1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 1 2 1 1 1 2 2 1 2 2 2 2 1 1 2 1 1 1 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 2 2 2\n1 100\n", "output": "46\n"}, {"type": "stdin_stdout", "input": "100 1\n1 1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs Sherlock Holmes was investiga...
[{"type": "stdin_stdout", "input": "64 28\n+54\n+44\n+55\n-3\n+33\n-54\n-54\n-7\n+33\n+54\n+54\n+26\n-54\n+14\n-54\n-47\n+25\n-54\n-54\n-54\n-52\n+54\n+54\n+54\n+54\n+20\n+7\n+54\n+4\n+32\n+46\n-54\n-47\n+15\n+32\n-54\n+7\n+62\n-16\n-54\n+3\n+54\n+54\n+54\n+54\n-54\n+54\n-54\n+54\n-52\n+27\n-7\n+54\n-5\n-54\n-18\n+1\n+...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string $s$ consi...
[{"type": "stdin_stdout", "input": "100\naa\nb\ncbc\nc\nbab\nc\nbdb\ndd\nhfh\nebe\nb\nf\ngg\na\nm\nkkk\nqq\ni\noo\nss\ntt\nere\njgj\nqiq\nkk\nn\naaa\nb\naa\nb\nc\na\nf\ne\na\naa\nff\ne\na\nafa\no\nmom\nqq\nf\niii\nh\njj\njj\nkgk\nbb\nhih\nj\na\naaa\nbb\nbab\ne\naa\nd\nb\nfdf\nibi\nbb\nfhf\ncc\nf\ngig\nene\nbob\na\nrcr\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLapindrome is defined as a strin...
[{"type": "stdin_stdout", "input": "6\ngaga\nabcde\nrotor\nxyzxy\nabbbab\nababc", "output": "YES\nNO\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "6\ngaga\nedcca\nrouos\nxyzxy\nabbbab\nabbab", "output": "YES\nNO\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\ngaga\nabcde\nrosor\nxyzxy\nabbbab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a matrix $2 \\times 2$ ...
[{"type": "stdin_stdout", "input": "6\n1 3\n5 7\n8 10\n3 4\n8 10\n4 3\n6 1\n9 2\n7 5\n4 2\n1 2\n4 3\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "1\n13 54\n91 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n14 54\n91 11\n", "output": "NO\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\n## Sum Even Fibonacci Numbers\n\...
[{"input": "123456789000000", "output": "[154030760585064]", "fn_name": "SumEvenFibonacci"}, {"input": "10000000000000", "output": "[8583840088782]", "fn_name": "SumEvenFibonacci"}, {"input": "7347000000", "output": "[6293134512]", "fn_name": "SumEvenFibonacci"}, {"input": "144100000", "output": "[82790070]", "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\nIn AtCoder City, there are three...
[{"type": "stdin_stdout", "input": "ABA\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "BBA\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "BAB\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "AAB\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ABB\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\nOne cold winter evening Alice an...
[{"type": "stdin_stdout", "input": "918273645\n546372819\n", "output": "WRONG_ANSWER\n"}, {"type": "stdin_stdout", "input": "111111111\n111110111\n", "output": "WRONG_ANSWER\n"}, {"type": "stdin_stdout", "input": "987235645\n206049167\n", "output": "WRONG_ANSWER\n"}, {"type": "stdin_stdout", "input": "918273645\n278718...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an undirected graph o...
[{"type": "stdin_stdout", "input": "5\n24 228\n24 228\n24 228\n24 228\n24 228\n", "output": "1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n2 11\n2 12\n2 13\n2 14\n2 15\n2 16\n2 17\n2 18\n2 19\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\nThe problem describes the proper...
[{"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\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 an adventurer currently ...
[{"type": "stdin_stdout", "input": "17\n.EEEEE...EEEE..EE\nEEE..E...EEEEE..E\n.E..E..EEE.EE...E\n.EEE.EE..EE...E..\nE..EEEEEE.EE.....\nE.EE...EEEEEEE.E.\nEEEE....EE..E.EEE\n...EEEEE.E..EE...\nEEE.E..EEEE.EEE..\n..E.E....EEE.....\nEE..E..E.E..EEEEE\nEEE..E.EEEEE.E...\n..EEEEE.E..EE.EE.\nEE.E...E..E..E.EE\n..E.EEE.EE..EE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nImagine a triangle of numbers wh...
[{"input": "10000", "output": "[500000005000]", "fn_name": "cumulative_triangle"}, {"input": "1000", "output": "[500000500]", "fn_name": "cumulative_triangle"}, {"input": "500", "output": "[62500250]", "fn_name": "cumulative_triangle"}, {"input": "150", "output": "[1687575]", "fn_name": "cumulative_triangle"}, {"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\nYou are given an integer k and a...
[{"type": "stdin_stdout", "input": "20 2\n3 14\n13 1\n4 3\n13 5\n12 20\n19 12\n6 3\n12 15\n11 2\n11 17\n9 5\n19 7\n6 11\n17 5\n16 18\n16 7\n12 8\n19 11\n16 10\n", "output": "122844\n"}, {"type": "stdin_stdout", "input": "20 2\n6 14\n13 1\n4 3\n13 5\n12 20\n19 12\n6 3\n12 15\n11 2\n11 17\n9 5\n19 7\n6 11\n17 5\n16 18\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 A_1, A_...
[{"type": "stdin_stdout", "input": "10 3\n1\n5\n2\n1\n1\n6\n11\n11\n4\n2", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 3\n0\n5\n4\n3\n14\n11\n9\n5\n3\n4", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 3\n0\n5\n4\n3\n11\n11\n9\n7\n6\n1", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 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\nYou are given two matrices $A$ a...
[{"type": "stdin_stdout", "input": "5 50\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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\nChef Shifu and Chef Po are parti...
[{"type": "stdin_stdout", "input": "3\n2 4 3 8 12\n1 4 0 2 -1\n11 22 10 18 16", "output": "13\n-1\n1\n"}, {"type": "stdin_stdout", "input": "3\n2 4 3 8 12\n1 4 4 2 -1\n10 22 12 9 16", "output": "13\n-1\n5\n"}, {"type": "stdin_stdout", "input": "3\n2 4 3 8 12\n1 4 0 2 -1\n11 22 10 7 16", "output": "13\n-1\n3\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\nOh no! You have stumbled upon a...
[{"input": "\".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --.. ----- .---- ..--- ...-- ....- ..... -.... --... ---.. ----.\"", "output": "[\"abcdefghijklmnopqrstuvwxyz0123456789\"]", "fn_name": "decode"}, {"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\nWe have N balance beams numbered...
[{"type": "stdin_stdout", "input": "10\n1375710043 178537096\n1332309236 80797230\n164044598 544580992\n117241210 865935868\n383133839 231371336\n378371075 681212831\n304570952 16537461\n1789737664 267238505\n844917655 218662351\n662961957 100386692", "output": "1121712759 3406064155"}, {"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\nStudents love to celebrate their...
[{"type": "stdin_stdout", "input": "50 1000 49\n", "output": "YES\n1 1000.00000000000000000000 2 20.40816326530612201395 \n2 979.59183673469385666976 3 40.81632653061224402791 \n3 959.18367346938771333953 4 61.22448979591836604186 \n4 938.77551020408168369613 5 81.63265306122448805581 \n5 918.36734693877554036590 6 102...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKicker (table football) is a boa...
[{"type": "stdin_stdout", "input": "1 100\n100 1\n99 99\n99 99\n", "output": "Team 1\n"}, {"type": "stdin_stdout", "input": "80 79\n79 30\n80 81\n40 80\n", "output": "Team 2\n"}, {"type": "stdin_stdout", "input": "48 41\n15 47\n11 38\n19 31\n", "output": "Team 1\n"}, {"type": "stdin_stdout", "input": "51 54\n95 28\n42 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor GukiZ is concerned abo...
[{"type": "stdin_stdout", "input": "5 3\n999999999 999999999 999999999 999999999 19992232\n", "output": " 1339997413"}, {"type": "stdin_stdout", "input": "19 100000\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", "output": " ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDid you hear about the Nibiru co...
[{"type": "stdin_stdout", "input": "3\n-1 0 R\n2\n1 -1 U\n1 1 D\n1 1 U\n1\n1 0 U\n0 0 R\n1\n4 -1 L", "output": "SAFE\nSAFE\nSAFE\n"}, {"type": "stdin_stdout", "input": "3\n0 0 R\n2\n1 -4 U\n2 3 D\n1 2 U\n1\n2 -1 U\n0 0 R\n1\n7 1 L", "output": "SAFE\nSAFE\nSAFE\n"}, {"type": "stdin_stdout", "input": "3\n0 0 R\n2\n1 -4 U...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 great hero guards the countr...
[{"type": "stdin_stdout", "input": "10\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\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\nSonya was unable to think of a s...
[{"type": "stdin_stdout", "input": "75\n392 1038 98 533 515 448 220 310 386 28 539 294 208 828 75 534 875 493 94 205 656 105 546 493 60 188 222 108 788 504 809 621 934 455 307 178 630 298 938 62 850 421 839 134 950 256 934 817 209 559 866 67 990 835 534 672 468 768 757 516 959 893 275 136 692 927 321 554 801 805 885 12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 circles. Find ...
[{"type": "stdin_stdout", "input": "368831644 125127030 959524552\n690900461 -368007601 1000000000\n", "output": "1877639096067727828.75000000000000000000\n"}, {"type": "stdin_stdout", "input": "368831644 125127030 959524552\n690900461 -368007601 1000000000\n", "output": "1877639096067727828.62500000000000000000"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two 100-story building...
[{"type": "stdin_stdout", "input": "1 100 100 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1 100 50 100\n", "output": "9950\n"}, {"type": "stdin_stdout", "input": "1 100 33 65\n", "output": "6468\n"}, {"type": "stdin_stdout", "input": "1 100 33 67\n", "output": "6567\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\nIn order to participate in the A...
[{"type": "stdin_stdout", "input": "6\n1 1 6 200\n2 1 11 300\n3 0 1 400\n4 0 5 1200\n5 0 5 1674\n10 4 4 6\n3\n1015 1 5 84\n1343 2 4 20\n123 3 6 500\n2\n4 1 3 100\n1 1 1 100\n0", "output": "2\n1\n4\n5\n10\n3\n123\n1015\n1343\n4\n1\n"}, {"type": "stdin_stdout", "input": "6\n1 1 6 200\n2 1 11 300\n3 0 1 400\n4 0 5 1200\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\nI need some help with my math ho...
[{"input": "\"-954x^2\"", "output": "[\"-1908x\"]", "fn_name": "get_derivative"}, {"input": "\"-3x^10\"", "output": "[\"-30x^9\"]", "fn_name": "get_derivative"}, {"input": "\"3x^-1\"", "output": "[\"-3x^-2\"]", "fn_name": "get_derivative"}, {"input": "\"-3x^-1\"", "output": "[\"3x^-2\"]", "fn_name": "get_derivative"}, ...
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\nWrite a function that calculates...
[{"input": "230.0", "output": "[200.0]", "fn_name": "excluding_vat_price"}, {"input": "460.0", "output": "[400.0]", "fn_name": "excluding_vat_price"}, {"input": "123", "output": "[106.96]", "fn_name": "excluding_vat_price"}, {"input": "777", "output": "[675.65]", "fn_name": "excluding_vat_price"}, {"input": "null", "ou...
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\nA game field is a strip of 1 Γ— n...
[{"type": "stdin_stdout", "input": "100\n************************************************************P***************************************\n", "output": "138\n"}, {"type": "stdin_stdout", "input": "100\n************************************************************P***************************************\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\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "1334146180889758954\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "123456789123456789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "999999999999994744\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "446486416781684178\n", "output": "YES\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus has a sequence, consi...
[{"type": "stdin_stdout", "input": "10\n375813 659427 484038 348181 432640 368050 271089 721588 345312 630771\n", "output": "29\n"}, {"type": "stdin_stdout", "input": "10\n375813 873836 484038 348181 432640 368050 271089 721588 345312 630771\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "10\n375813 873836 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\nA trick I learned in elementary ...
[{"input": "\"9876543211234567890002\"", "output": "[false]", "fn_name": "divisible_by_three"}, {"input": "\"9876543211234567890009\"", "output": "[true]", "fn_name": "divisible_by_three"}, {"input": "\"10110101011\"", "output": "[false]", "fn_name": "divisible_by_three"}, {"input": "\"10987654321\"", "output": "[false...
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\nSorting algorithms for sorting d...
[{"type": "stdin_stdout", "input": "5\n5\n1\n2\n-1\n0\n4\n1\n6\n2\n4\n4\n22\n3\n4\n1\n-1\n0", "output": "8\n2\n5\n0\n"}, {"type": "stdin_stdout", "input": "5\n10\n1\n4\n-1\n0\n8\n0\n3\n9\n7\n5\n22\n3\n4\n1\n-1\n0", "output": "8\n11\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1\n2\n-1\n0\n8\n1\n6\n2\n4\n5\n22\n3\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\nValera considers a number beauti...
[{"type": "stdin_stdout", "input": "10001100101100101000100101000100100111100001111001000011101001010001100111001010011111100101110101010011101101110000111111010100100111110000011111000100011000000010111011000110010110001100010011111100110011100001110011011110000011101111000110100010000111011010011101100101010010110011...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Disgaea as in most role-playi...
[{"type": "stdin_stdout", "input": "20 1 0.78\nxc 6799\nztrfjsq 3023\nkhbcbsaztwigxeidh 2974\nkksvbmtjiiqlguwv 188\nwvqzzjrpmxsdbfvua 4547\niqkqqwtqifdpxfhslpv 6264\nwarmknju 9472\nfheisuiufwmtagl 292\nwge 4338\nzaklermeji 6733\nfcn 6282\nbjyjzgzkgzy 1778\ngufpvhdnsesyfuegef 4998\nxnhuhwzzxqbaphktqbc 8485\ncokabaqahfw ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has got many devices that ...
[{"type": "stdin_stdout", "input": "50 50 2\n2 2 4 5 2 1 5 4 5 4 5 2 1 2 3 3 5 1 2 2 1 3 4 5 5 4 3 2 2 1 3 2 3 2 4 4 1 3 5 4 3 2 4 3 4 4 4 4 3 4\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "50 30 1\n2 1 2 1 2 3 3 1 2 2 3 2 1 3 1 3 1 2 2 3 2 1 3 1 1 2 3 2 2 1 1 3 3 2 2 2 3 2 3 3 3 3 1 1 3 1 1 3 1 3\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 often uses his smartpho...
[{"type": "stdin_stdout", "input": "5\n5 13\n6 4 2 2 2\n2 1 1 2 1\n1 3\n2\n1\n5 10\n2 3 10 2 3\n1 1 2 2 1\n4 10\n4 1 3 1\n1 2 1 2\n4 9\n2 2 1 2\n1 1 2 1\n", "output": "5\n-1\n2\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "5\n5 7\n6 4 2 2 2\n2 1 1 2 1\n1 3\n2\n1\n5 10\n2 3 10 2 3\n1 1 2 2 1\n4 10\n4 1 3 1\n1 2 1 2\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\nYou are given n points on a line...
[{"type": "stdin_stdout", "input": "100\n457 827 807 17 871 935 907 -415 536 170 551 -1454 865 758 -457 -892 -875 -488 684 19 0 555 -807 -624 -239 826 318 811 20 -732 -91 460 551 -610 555 -493 -154 442 -141 946 -913 -104 704 -380 699 32 106 -455 -518 214 -464 -861 243 -798 -472 559 529 -844 -32 871 -459 236 387 626 -31...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a function that takes in a...
[{"input": "\"This sentence is a sentence\"", "output": "[\"This ecnetnes is a ecnetnes\"]", "fn_name": "spin_words"}, {"input": "\"Hey fellow warriors\"", "output": "[\"Hey wollef sroirraw\"]", "fn_name": "spin_words"}, {"input": "\"CodeWars\"", "output": "[\"sraWedoC\"]", "fn_name": "spin_words"}, {"input": "\"Welcom...
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\nTwo little greedy bears have fou...
[{"type": "stdin_stdout", "input": "1488496828 607500000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1183431925 540244525\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1270836736 387420489\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "100000007 800000011\n", "output": "-1\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\nDuring the last Sereja's Codesec...
[{"type": "stdin_stdout", "input": "10 -6\n5 2 1 9 5 2 4 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"type": "stdin_stdout", "input": "10 -6\n5 2 1 8 5 2 4 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"type": "stdin_stdout", "input": "10 0\n5 14 1 1 5 1 1 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\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\nSam has opened a new sushi train...
[{"input": "\"rrrrrrrrrrrrrrrrrr rr r\"", "output": "[34]", "fn_name": "total_bill"}, {"input": "\"rr rrr rrr rr\"", "output": "[16]", "fn_name": "total_bill"}, {"input": "\"rr rrr\"", "output": "[8]", "fn_name": "total_bill"}, {"input": "\"rr\"", "output": "[4]", "fn_name": "total_bill"}, {"input": "\"\"", "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\nGiven are integers S and P.\nIs ...
[{"type": "stdin_stdout", "input": "1000000000000 999999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "50000000002 100000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "978530427494 321593407609\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "203939391324 871114841657\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\nInput\n\nThe input contains two ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "1000000000 0000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "1999999999\n"}, {"type": "stdin_stdout", "input": "937477084 827336327\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\nproblem\n\nOnce upon a time ther...
[{"type": "stdin_stdout", "input": "10\n2 0\n1 1\n1 0\n1 -1\n2 5\n0 1\n2 1\n1 4\n1 14\n18 1\n10\n4 14\n4 0\n2 1\n0 2\n1 4\n0 5\n4 1\n1 1\n2 6\n5 -1\n0", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "10\n16 0\n0 1\n1 1\n1 0\n2 7\n0 3\n3 1\n1 3\n1 14\n18 2\n10\n2 7\n5 5\n2 1\n0 2\n1 4\n1 4\n4 1\n1 1\n1 6\n5 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\nYou have $N$ items that you want...
[{"type": "stdin_stdout", "input": "1 96\n113 10\n111 20\n120 31", "output": "113.0000000000\n"}, {"type": "stdin_stdout", "input": "1 77\n119 10\n111 20\n120 31", "output": "119.0000000000\n"}, {"type": "stdin_stdout", "input": "1 77\n197 10\n111 20\n120 31", "output": "197.0000000000\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\nConsider the infinite sequence s...
[{"type": "stdin_stdout", "input": "9\n2\n2\n6\n4\n14\n11\n13\n8\n17\n", "output": "2\n2\n12\n4\n9\n11\n7\n10\n32\n"}, {"type": "stdin_stdout", "input": "9\n2\n2\n3\n4\n10\n12\n12\n8\n11\n", "output": "2\n2\n3\n4\n6\n13\n13\n10\n11\n"}, {"type": "stdin_stdout", "input": "9\n2\n2\n6\n4\n14\n17\n13\n8\n17\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\nRecently, the Fair Nut has writt...
[{"type": "stdin_stdout", "input": "100 1000000000\nbbabbaabbbaaaaabbabbbaaabbbbabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbaabbbbabaabbbabbaaaaabbbbaab\nbbabbaabbbaaaaabbabbbaaabbbbabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaababbbabbbbaaaaabbaaaaaaaab\n", "output": "41073741883\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\n# Task\n Your Informatics teache...
[{"input": "\"O\"", "output": "[[\"A + O\", \"B + N\", \"C + M\", \"D + L\", \"E + K\", \"F + J\", \"G + I\", \"H + H\"]]", "fn_name": "new_numeral_system"}, {"input": "\"G\"", "output": "[[\"A + G\", \"B + F\", \"C + E\", \"D + D\"]]", "fn_name": "new_numeral_system"}, {"input": "\"E\"", "output": "[[\"A + E\", \"B + ...
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\nMr. Kitayuta has just bought an ...
[{"type": "stdin_stdout", "input": "5 7\n1 5 1\n2 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "1\n1\n1\n1\n2\n"}, {"type": "stdin_stdout", "input": "5 7\n1 1 1\n2 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "0\n0\n1\n0\n1\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\nYou are given a bracket sequence...
[{"type": "stdin_stdout", "input": "8\n3\n)()\n8\n)()()(((\n4\n(()(\n5\n(())(\n6\n))((()\n5\n))())\n1\n)\n2\n)(\n", "output": "1 0\n3 1\n1 2\n2 1\n3 0\n2 1\n0 1\n0 2\n"}, {"type": "stdin_stdout", "input": "5\n3\n)()\n8\n)()()(((\n4\n(()(\n5\n(())(\n6\n))((()\n", "output": "1 0\n3 1\n1 2\n2 1\n3 0\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWelcome! Everything is fine.\n\n...
[{"type": "stdin_stdout", "input": "2\n3\n1 2 3\n3 2 4\n2 4 0\n4 5 10\n5 6 5\n1\n1 2 2\n1 5 2\n1 4 6\n", "output": "12 32\n2 2\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 2 3\n3 2 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 1\n1 3 0\n1 4 3\n", "output": "15 33\n4 4\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 2 3\n3 2 4\n2 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\nDreamoon likes coloring cells ve...
[{"type": "stdin_stdout", "input": "2000 100\n5 128 1368 1679 1265 313 1854 1512 1924 338 38 1971 238 1262 1834 1878 1749 784 770 1617 191 395 303 214 1910 1300 741 1966 1367 24 268 403 1828 1033 1424 218 1146 925 1501 1760 1164 1881 1628 1596 1358 1360 29 1343 922 618 1537 1839 1114 1381 704 464 692 1450 1590 1121 670...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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### Description:\n\n Remove all ...
[{"input": "\"Hi! Hi!\"", "output": "[\"Hi Hi!\"]", "fn_name": "remove"}, {"input": "\"Hi!!!\"", "output": "[\"Hi!!!\"]", "fn_name": "remove"}, {"input": "\"!Hi!\"", "output": "[\"Hi!\"]", "fn_name": "remove"}, {"input": "\"Hi!\"", "output": "[\"Hi!\"]", "fn_name": "remove"}, {"input": "\"!Hi\"", "output": "[\"Hi\"]", ...
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\nGiven a string of characters, I ...
[{"input": "\"asd.f855dasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[0]", "fn_name": "find_middle"}, {"input": "\"asd.fasd.ga654sdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[2]", "fn_name": "find_middle"}, {"input": "\"asd.fasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[-1]", "fn_name": "find_middle"},...
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\nConsider a football tournament w...
[{"type": "stdin_stdout", "input": "10000\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 1\n1 100\n100 ...
code_stdio