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\nTakahashi the Jumbo will practic... | [{"type": "stdin_stdout", "input": "7\n500 1009", "output": "OK\n"}, {"type": "stdin_stdout", "input": "7\n500 1407", "output": "OK\n"}, {"type": "stdin_stdout", "input": "7\n500 2719", "output": "OK\n"}, {"type": "stdin_stdout", "input": "7\n500 1806", "output": "OK\n"}, {"type": "stdin_stdout", "input": "7\n782 1806"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 tree T with N vertice... | [{"type": "stdin_stdout", "input": "7\n4 7\n3 1\n2 6\n5 4\n7 1\n2 7", "output": "835937507\n"}, {"type": "stdin_stdout", "input": "7\n4 7\n3 1\n3 6\n5 4\n7 1\n2 7", "output": "679687506\n"}, {"type": "stdin_stdout", "input": "7\n4 7\n3 1\n2 6\n5 1\n7 1\n2 7", "output": "570312505\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 p = {p_1,\\ p... | [{"type": "stdin_stdout", "input": "7\n1 2 3 4 5 6 7", "output": "YES"}, {"type": "stdin_stdout", "input": "5\n-1 20 0 -2 0", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5\n-2 20 0 -2 0", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5\n1 20 -1 -2 0", "output": "NO\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\nIn the Ancient Kingdom of Snuke,... | [{"type": "stdin_stdout", "input": "3\n99 1 191\n100 1 192\n99 0 192", "output": "100 0 193"}, {"type": "stdin_stdout", "input": "3\n99 1 191\n000 1 192\n99 0 192", "output": "49 0 242\n"}, {"type": "stdin_stdout", "input": "3\n99 1 191\n000 1 154\n99 0 192", "output": "68 0 223\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\nGotou just received a dictionary... | [{"type": "stdin_stdout", "input": "abcdefghijklmnopqrytuvwzsx", "output": "abcdefghijklmnopqrytuvwzx\n"}, {"type": "stdin_stdout", "input": "abcpefghijklmnodqrytuvwzsx", "output": "abcpefghijklmnodqrytuvwzx\n"}, {"type": "stdin_stdout", "input": "azcdefghijklmnopqrstuvwbyx", "output": "azcdefghijklmnopqrstuvwx\n"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the largest square number n... | [{"type": "stdin_stdout", "input": "1205711547", "output": "1205686729\n"}, {"type": "stdin_stdout", "input": "1258489257", "output": "1258475625\n"}, {"type": "stdin_stdout", "input": "1044195797", "output": "1044194596\n"}, {"type": "stdin_stdout", "input": "115087508", "output": "115068529\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\nBased on some criterion, Snuke d... | [{"type": "stdin_stdout", "input": "12 12", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 12", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5 10", "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\nTakahashi and Aoki are going to ... | [{"type": "stdin_stdout", "input": "1000001000 1000000000", "output": "212353005\n"}, {"type": "stdin_stdout", "input": "1000001000 1010000000", "output": "938420542\n"}, {"type": "stdin_stdout", "input": "1000000000 1010000000", "output": "623631994\n"}, {"type": "stdin_stdout", "input": "1001000000 1010010000", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEvi has N integers a_1,a_2,..,a_... | [{"type": "stdin_stdout", "input": "4\n-100 -45 -100 -100", "output": "2269\n"}, {"type": "stdin_stdout", "input": "4\n-100 -100 -100 -100", "output": "0"}, {"type": "stdin_stdout", "input": "3\n-3 -1 23", "output": "419\n"}, {"type": "stdin_stdout", "input": "3\n-3 -1 21", "output": "355\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\nStellar history 2005.11.5. You a... | [{"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n1 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 14\n0 0 10", "output": "MISS\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\nA witch named Marie lived deep i... | [{"type": "stdin_stdout", "input": "5 4\n1 2\n2 3\n3 4\n4 5\n4 6\n1 2\n1 3\n1 4\n2 4\n2 4\n3 4\n5 0\n0 0", "output": "yes\nno\nyes\n"}, {"type": "stdin_stdout", "input": "5 4\n1 2\n2 3\n3 4\n4 5\n7 6\n1 2\n1 3\n1 4\n2 4\n2 4\n3 4\n5 0\n0 0", "output": "yes\nno\nyes\n"}, {"type": "stdin_stdout", "input": "5 4\n1 2\n2 3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a string consisting of onl... | [{"type": "stdin_stdout", "input": "5\n28\n14\n1\n0", "output": "11131221121113122118\n311311222113111231131112132112311321322112111312211312111322212311322113212221\n"}, {"type": "stdin_stdout", "input": "5\n23\n14\n1\n0", "output": "11131221121113122113\n311311222113111231131112132112311321322112111312211312111322212... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHierarchical Democracy\n\nThe pr... | [{"type": "stdin_stdout", "input": "6\n[[123][4567][89]]\n[[5][3][6][3][9]]\n[[[99][59][63][85][51]][[1539][7995][466]][[51][57][79][99][3][91][59]]]\n[[[37][95][31][77][25]][[43][5][5][5][85]][[71][3][51][89][29]][[57][94][5][69][31]][[99][59][65][73][31]]]\n[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMany cats live on the campus of ... | [{"type": "stdin_stdout", "input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n41 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n55 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\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\nExample\n\nInput\n\n3\n()(()((\n... | [{"type": "stdin_stdout", "input": "3\n()(()((\n))()()(()\n)())(())", "output": "Yes"}, {"type": "stdin_stdout", "input": "3\n()(()((\n))()(((()\n)())(())", "output": "No\n"}, {"type": "stdin_stdout", "input": "3\n()(()((\n))()(((()\n))(())()", "output": "No\n"}, {"type": "stdin_stdout", "input": "3\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\nD: Country In Distortion-\n\nsto... | [{"type": "stdin_stdout", "input": "4 4\n1 3 4\n2 3 0\n1 1 4\n3 4 2\n5\n0 10 12", "output": "100\n"}, {"type": "stdin_stdout", "input": "4 4\n1 3 4\n2 2 0\n1 1 7\n3 4 2\n5\n0 13 18", "output": "124\n"}, {"type": "stdin_stdout", "input": "4 4\n1 3 5\n2 3 0\n3 2 10\n3 4 1\n5\n8 10 6", "output": "39\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\nF: MOD Rush\n\nproblem\n\nGiven ... | [{"type": "stdin_stdout", "input": "3 0\n11 3 9\n0 -1 24", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 0\n8 3 13\n0 -1 24", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 0\n11 3 9\n0 -2 24", "output": "0\n"}, {"type": "stdin_stdout", "input": "2 0\n4 2 5\n1 -1 16", "output": "0\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRun, Twins\n\nE869120 You starte... | [{"type": "stdin_stdout", "input": "14 86\n9 1 20", "output": "119.428571428571"}, {"type": "stdin_stdout", "input": "-6 -4\n-2 -1 -5", "output": "-5.66667\n"}, {"type": "stdin_stdout", "input": "-6 -4\n-2 -2 -7", "output": "-5.33333\n"}, {"type": "stdin_stdout", "input": "20 124\n10 0 27", "output": "169.926\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\nWrite a program which manipulate... | [{"type": "stdin_stdout", "input": "10 7\n0 1 3 1\n0 0 4 -2\n1 0 5\n1 0 2\n0 1 5 0\n1 2 4\n1 0 0", "output": "-10\n-6\n0\n-2\n"}, {"type": "stdin_stdout", "input": "10 7\n0 1 2 1\n0 2 4 -2\n1 0 5\n1 0 2\n0 1 5 -1\n1 0 4\n1 0 0", "output": "-5\n-1\n-4\n0\n"}, {"type": "stdin_stdout", "input": "10 7\n0 1 3 1\n0 2 4 -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\nDid you know that the yummy gold... | [{"type": "stdin_stdout", "input": "1\n4\n10 20 34 89\n4\n10 26\n7 21\n14 21\n7 35", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4\n10 20 34 55\n4\n7 14\n7 21\n14 21\n7 35", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n4\n10 20 34 89\n4\n7 14\n7 21\n14 21\n7 35", "output": "2\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two strings a and ... | [{"type": "stdin_stdout", "input": "7\nabacaba\nbacabaa\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\nabacaba\naabacab\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\nabacaaa\naabacab\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\nabacaaa\naabacaa\n", "output": "4\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\nXXI Berland Annual Fair is comin... | [{"type": "stdin_stdout", "input": "78 74\n20194 1621 21498 13827 31277 19791 6583 13579 11160 20419 26490 160 3450 12925 18134 10381 27009 28815 10209 6478 18504 15371 32608 14197 12075 13723 12612 19020 28762 11057 12891 31164 16684 13717 19933 25453 2742 4955 6814 2863 10397 15461 20616 10905 2600 20137 4681 9199 27... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThree years have passes and noth... | [{"type": "stdin_stdout", "input": "250\n1 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 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\nThis problem is a version of pro... | [{"type": "stdin_stdout", "input": "3\n8\n1 0\n4 1\n2 0\n4 1\n5 1\n6 1\n3 0\n2 0\n4\n1 1\n1 1\n2 1\n2 1\n9\n2 0\n2 0\n4 1\n4 1\n4 1\n7 0\n7 1\n7 0\n7 1\n", "output": "3 3\n3 3\n9 5\n"}, {"type": "stdin_stdout", "input": "3\n8\n1 0\n4 1\n2 0\n4 1\n5 1\n6 1\n3 0\n2 0\n4\n1 1\n1 1\n2 1\n2 1\n9\n2 0\n2 0\n4 1\n4 1\n4 1\n7 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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_1, a_2,... | [{"type": "stdin_stdout", "input": "5\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n1000000000 1000000000 1000000000 1000000000 0000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n1000000000 1000000000 1000000000 1000000000 000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis problem is different from t... | [{"type": "stdin_stdout", "input": "10\n11\nartiovnldnp\nartiovsldsp\n2\naa\nzz\n2\naa\nxy\n2\nab\nba\n2\nza\nzz\n3\nabc\nbca\n16\naajjhdsjfdsfkadf\naajjhjsjfdsfkajf\n2\nix\nii\n2\noo\nqo\n2\npp\npa\n", "output": "Yes\nYes\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "10\n11\nartiovnldnp\nart... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that the permutation is a... | [{"type": "stdin_stdout", "input": "250000 996140731\n", "output": "227969454\n"}, {"type": "stdin_stdout", "input": "244435 994838543\n", "output": "634651929\n"}, {"type": "stdin_stdout", "input": "200422 984828937\n", "output": "556345906\n"}, {"type": "stdin_stdout", "input": "140426 454141843\n", "output": "451934... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. You ca... | [{"type": "stdin_stdout", "input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababbbaababbbbababbbabbbbbabaabbaaaabaa\nbbbababbaabbbbbaabaaabaababaaaabaabbbabbababaaabba\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 three integers n, ... | [{"type": "stdin_stdout", "input": "20 10 20\n6 8 384\n6 7 385\n6 10 128\n13 14 182\n15 19 0\n19 20 468\n20 20 477\n6 8 384\n17 20 16\n2 4 205\n6 6 899\n16 20 0\n20 20 477\n12 15 6\n9 11 513\n11 11 873\n16 19 0\n15 16 15\n7 9 180\n10 10 727\n", "output": "298754800\n"}, {"type": "stdin_stdout", "input": "20 10 20\n6 8 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem.\... | [{"type": "stdin_stdout", "input": "1000 18\n", "output": "964 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 86 87 88 89 90 91 92 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVera adores poems. All the poems... | [{"type": "stdin_stdout", "input": "7 3\nferwljzwakxedlgwl\noerwljzwakxedlgwl\nhyqombizhuhxedprb\netptjrizhuhxedprb\nurtuckar\ndkartmwramklcmi\nrurtuckar\nnurartmwramklcmi\niraziomsv\nsaziomsv\nbprapiqpayzurgij\nusyemayzurgij\nztstmeecvmkvuu\nquexlecvmkvuu\nrlhwecvmkvuu\nzecvmkvuu\niikymgbncljtub\nqiikymgbncljtub\nbcav... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 undirected grap... | [{"type": "stdin_stdout", "input": "3\n3\n1 2\n2 3\n1 3\n4\n1 2\n2 3\n3 4\n4 2\n5\n1 2\n2 3\n1 3\n2 5\n4 3\n", "output": "\n6\n11\n18\n"}, {"type": "stdin_stdout", "input": "3\n3\n1 2\n2 3\n1 3\n4\n1 4\n2 3\n3 4\n4 2\n5\n1 2\n2 3\n1 3\n2 5\n4 3\n", "output": "6\n11\n18\n"}, {"type": "stdin_stdout", "input": "3\n3\n1 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\nLong time ago there was a symmet... | [{"type": "stdin_stdout", "input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n7 11 7 11\n1\n1 1\n4\n40 56 48 40 160 56 117 48\n6\n240 154 210 162 174 154 186 240 174 186 162 210\n", "output": "YES\nNO\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n0 11 7 11\n1\n1 1\n4\n40 56 48 40 160 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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> <image>\n\n*The two imag... | [{"type": "stdin_stdout", "input": "-1079\n", "output": "-1164239\n"}, {"type": "stdin_stdout", "input": "-340\n", "output": "-115598\n"}, {"type": "stdin_stdout", "input": "-449\n", "output": "-201599\n"}, {"type": "stdin_stdout", "input": "-685\n", "output": "-469223\n"}, {"type": "stdin_stdout", "input": "-432\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\nLast summer Peter was at his gra... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "958220352\n"}, {"type": "stdin_stdout", "input": "972408\n", "output": "377259665\n"}, {"type": "stdin_stdout", "input": "956022\n", "output": "864671299\n"}, {"type": "stdin_stdout", "input": "941322\n", "output": "359985814\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider some square matrix A wi... | [{"type": "stdin_stdout", "input": "100\n", "output": "15"}, {"type": "stdin_stdout", "input": "010\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "001\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "011\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "61\n", "output": "11"}, {"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\nOnce at a team training Vasya, P... | [{"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 9 2 9 2 10 9 8\n", "output": "40 59\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n3 1 9 2 9 2 10 9 8\n", "output": "43 56\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 6 2 9 2 10 9 8\n", "output": "42 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJoe has been hurt on the Interne... | [{"type": "stdin_stdout", "input": "20 20\n..+#+.+++.+++#+..#++\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\nHaving written another programmi... | [{"type": "stdin_stdout", "input": "2 3\n1000000000 1\n2 2\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "2 4\n1000000000 1\n2 2\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "2 4\n1000000000 1\n2 0\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "2 4\n1000000000 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\nYaroslav, Andrey and Roman can p... | [{"type": "stdin_stdout", "input": "10\n00000000000111111110\n00000000011111111111\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "10\n00010000000111111110\n00000000011111111111\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "10\n00000000000111111111\n00000000011111111111\n", "output": "Draw... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMashmokh's boss, Bimokh, didn't ... | [{"type": "stdin_stdout", "input": "2\n2 1 16 1\n4\n1 2 1 2\n", "output": "1\n4\n2\n3\n"}, {"type": "stdin_stdout", "input": "2\n2 1 16 1\n4\n2 2 0 2\n", "output": "2\n3\n3\n2\n"}, {"type": "stdin_stdout", "input": "2\n2 1 16 1\n4\n1 2 0 2\n", "output": "1\n4\n4\n1\n"}, {"type": "stdin_stdout", "input": "2\n2 1 4 3\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 is a collector. Once he w... | [{"type": "stdin_stdout", "input": "3 999999\n22 1000000 1000000 1250369 623205 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000100 1506663 1001000 1010000 999999 1000000 1000000 1010000 352800 999999 1000000\n14 999999 999999 1521826 1368902 999999 1000000 999999 1556972 999999 999999 418013 999999 1000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCaisa solved the problem with th... | [{"type": "stdin_stdout", "input": "99\n1401 2019 1748 3785 3236 3177 3443 3772 2138 1049 353 1195 310 2388 1322 88 2160 2783 435 2248 1471 706 2468 2319 3156 3506 2794 1999 1983 2519 2597 3735 537 344 3519 3772 3872 2961 3895 2010 10 247 3269 671 2986 942 758 1146 77 1545 3745 1547 2250 2565 217 1406 2070 3010 3404 40... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 monster is attacking the Cyber... | [{"type": "stdin_stdout", "input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100 1\n100 100 100\n1 100 100\n", "output": "1891\n"}, {"type": "stdin_stdout", "input": "50 100 51\n100 100 100\n1 100 100\n", "output": "1384\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\nToday Tavas got his test result ... | [{"type": "stdin_stdout", "input": "77\n", "output": "seventy-seven\n"}, {"type": "stdin_stdout", "input": "73\n", "output": "seventy-three\n"}, {"type": "stdin_stdout", "input": "78\n", "output": "seventy-eight\n"}, {"type": "stdin_stdout", "input": "27\n", "output": "twenty-seven\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\nRecently, Vladimir got bad mark ... | [{"type": "stdin_stdout", "input": "1000 1000 999 1000\n* * *\n", "output": "999000000000\n"}, {"type": "stdin_stdout", "input": "720 903 589 804\n* * *\n", "output": "307887168960\n"}, {"type": "stdin_stdout", "input": "573 598 1387 124\n* * *\n", "output": "58932376152\n"}, {"type": "stdin_stdout", "input": "739 903 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn vacations n pupils decided to... | [{"type": "stdin_stdout", "input": "10010 1000000000 999999999 1000000000 1\n", "output": "1.0000000009999002\n"}, {"type": "stdin_stdout", "input": "10000 1000000000 999999999 1000000000 10000\n", "output": "1.000000000"}, {"type": "stdin_stdout", "input": "10010 1000000000 1 1000000000 10000\n", "output": "2.99999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTarly has two different type of ... | [{"type": "stdin_stdout", "input": "100000 100000 10000\n", "output": "308343288\n"}, {"type": "stdin_stdout", "input": "100000 100000 1000\n", "output": "402115033\n"}, {"type": "stdin_stdout", "input": "100000 100000 1001\n", "output": "500272705\n"}, {"type": "stdin_stdout", "input": "100000 100000 100\n", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n boxes with colored b... | [{"type": "stdin_stdout", "input": "200\n1 2 4 10 5 8 1 10 9 10 1 9 5 5 3 10 4 7 7 1 5 10 1 6 7 3 9 3 5 8 8 9 7 3 1 5 6 7 3 3 1 4 9 2 8 7 2 10 2 1 10 9 6 1 9 5 3 5 9 3 3 2 4 9 5 9 4 8 5 6 10 1 3 10 8 6 10 10 4 6 8 4 10 7 5 2 6 6 8 8 8 10 3 2 4 5 10 2 2 10 4 5 3 1 8 10 8 5 6 4 9 10 8 10 8 6 3 1 6 4 7 4 10 10 6 7 1 1 2 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\nUnlucky year in Berland is such ... | [{"type": "stdin_stdout", "input": "433333986179614514 1000001000000000000 433333986179614515 726628630292055493\n", "output": "293294644112440978\n"}, {"type": "stdin_stdout", "input": "239838434825939759 805278168279318096 202337849919104640 1225406646213503725\n", "output": "565439733453378336\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\nBran and his older sister Arya a... | [{"type": "stdin_stdout", "input": "100 456\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nThe construction of subway in Be... | [{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer m.\n\nL... | [{"type": "stdin_stdout", "input": "30 10\n001000000011000111000010010000\n000001100001010000000000000100\n000110100010100000000000101000\n110000010000000001000000000000\n100001000000000010010101000101\n001001000000000100000000110000\n000000010000100000001000000000\n001000010001000000001000000010\n000000110000000001001... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 walruses standing in... | [{"type": "stdin_stdout", "input": "15\n18 6 18 21 14 20 13 9 18 20 28 13 19 25 21\n", "output": "10 -1 8 8 6 6 0 -1 2 2 3 -1 -1 0 -1 "}, {"type": "stdin_stdout", "input": "15\n14 4 5 12 6 19 14 19 12 22 23 17 14 21 27\n", "output": "7 -1 -1 0 -1 6 1 4 -1 3 2 0 -1 -1 -1 "}, {"type": "stdin_stdout", "input": "15\n14 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\nThe Resistance is trying to take... | [{"type": "stdin_stdout", "input": "24\n19 14\n8 15\n13 4\n18 16\n1 17\n10 3\n22 21\n10 14\n6 11\n9 12\n15 22\n11 3\n21 7\n2 12\n7 4\n4 19\n16 9\n24 17\n5 15\n8 2\n23 10\n20 12\n18 24\n", "output": "1 20 21 22 23 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24\n"}, {"type": "stdin_stdout", "input": "24\n19 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\nPaul was the most famous charact... | [{"type": "stdin_stdout", "input": "100\n130 0 130\n8938 6200 6439\n1059 816 676\n2421 621 2340\n9530 7280 6150\n9997 9228 3845\n68 60 32\n1412 0 1412\n9 0 9\n769 600 481\n3740 1760 3300\n91 84 35\n156 144 60\n1525 1365 681\n5 4 3\n400 384 113\n1844 1520 1044\n3256 0 3256\n1586 864 1330\n710 0 710\n10 0 10\n6 -1 6\n13 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEd, Edd and Eddy are given an ar... | [{"type": "stdin_stdout", "input": "5\nkelio\nhi olldg ii\nged\ncba eed\njwaa\npxthon\nd\ncplusplus\nhellohi\nhellotherdhi\n\nS@NPNE", "output": "not possible\nnot possible\nnot possible\nnot possible\nnot possible\n"}, {"type": "stdin_stdout", "input": "5\nkelio\nhi olldg ii\nged\ncba eed\njwaa\npxthon\nd\nsulpsulpc\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\nMilly loves to eat chocolates. S... | [{"type": "stdin_stdout", "input": "5\n332\n2 63 41 84 96 4 62 52 38 36 89 99 82 72 50 100 26 34 57 54 38 62 57 39 94 4 87 34 89 38 59 64 27 67 16 28 92 28 66 58 13 82 47 94 70 60 91 72 37 90 9 75 79 50 37 30 20 11 83 51 40 95 28 70 71 9 24 44 88 94 91 81 17 11 44 2 6 20 3 59 76 4 58 88 60 9 6 43 89 41 94 29 85 56 40 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou want to repaint your house e... | [{"type": "stdin_stdout", "input": "3 3\n1 -1 1\n4 2 -1\n6 2 5\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 4\n0 -2 2\n4 3 -1\n6 2 6\n\nSAMPLE", "output": "-2\n"}, {"type": "stdin_stdout", "input": "3 3\n1 -1 1\n4 3 -1\n6 2 5\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 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 an array a_0, a_1,... | [{"type": "stdin_stdout", "input": "5 5\n1 2 3 2 1\n2 1 5\n3 2 3\n1 3 1\n2 2 4\n3 1 0", "output": "3\n3\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2 1 2 1\n2 1 5\n3 2 3\n1 3 1\n2 2 4\n3 1 0", "output": "2\n6\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2 1 2 1\n2 1 5\n3 2 3\n1 3 1\n2 2 4\n3 2 0", "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\nWe have a tree with N vertices, ... | [{"type": "stdin_stdout", "input": "10\n1 2 4 2 11 1 7 11 0 4\n1 3\n2 3\n3 4\n7 5\n2 6\n6 7\n1 8\n2 9\n2 10", "output": "1\n2\n2\n2\n4\n2\n3\n2\n2\n3\n"}, {"type": "stdin_stdout", "input": "10\n1 2 4 0 12 1 7 11 0 4\n1 5\n2 3\n3 4\n7 5\n2 6\n6 7\n1 8\n2 9\n2 10", "output": "1\n2\n3\n3\n2\n2\n2\n2\n2\n3\n"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a sequence of N \\times ... | [{"type": "stdin_stdout", "input": "11 97\n0 1 8 2 5 4 2 6 2 3 5", "output": "0 1 8 6 2 3 5\n"}, {"type": "stdin_stdout", "input": "11 47\n0 1 0 3 10 5 1 36 2 2 0", "output": "10 5 1 36 0\n"}, {"type": "stdin_stdout", "input": "11 101\n0 2 4 1 5 4 4 6 0 3 5", "output": "2 4 6 0 3 5\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA museum exhibits N jewels, Jewe... | [{"type": "stdin_stdout", "input": "10\n66 38 71040136000\n65 77 74799603000\n80 53 172413930453\n24 34 24931901000\n51 78 49867703000\n52 71 46108236000\n46 119 74799603000\n56 66 93122668000\n32 51 74374554736\n33 26 70912345000\n21\nL 69 1\nL 7 0\nU 47 4\nR 92 0\nR 91 1\nD 53 2\nR 65 3\nD 13 0\nU 63 3\nL 68 3\nD 47 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is a user of a site th... | [{"type": "stdin_stdout", "input": "4500\n-140", "output": "-4780\n"}, {"type": "stdin_stdout", "input": "4500\n-148", "output": "-4796\n"}, {"type": "stdin_stdout", "input": "4500\n-237", "output": "-4974\n"}, {"type": "stdin_stdout", "input": "2002\n416", "output": "-1170\n"}, {"type": "stdin_stdout", "input": "2002\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 pond with a rectangul... | [{"type": "stdin_stdout", "input": "10 10\n.o...o..o.\n....o.....\n....oo.oo.\n..oooo..o.\n....oo....\n..o..o....\no..o....So\no....T....\n....o.....\n........oo", "output": "5"}, {"type": "stdin_stdout", "input": "9 10\n.o...o..o.\n....o.....\n....oo.oo.\n..oooo..o.\n....oo....\n..o..o....\no..o....So\no....T....\n...... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N computers and N sock... | [{"type": "stdin_stdout", "input": "3\n3\n4\n18\n11\n0\n10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n3\n4\n18\n20\n0\n10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n3\n10\n8\n7\n0\n10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n3\n10\n9\n7\n0\n10", "output": "1\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\nIroha is very particular about n... | [{"type": "stdin_stdout", "input": "1001 8\n1 0 4 5 6 7 15 11", "output": "2222\n"}, {"type": "stdin_stdout", "input": "1001 8\n1 3 2 5 6 7 15 9", "output": "4000\n"}, {"type": "stdin_stdout", "input": "1001 8\n1 3 4 5 6 7 8 9", "output": "2000\n"}, {"type": "stdin_stdout", "input": "1000 8\n2 3 4 5 6 7 8 9", "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\nI decided to plant vegetables in... | [{"type": "stdin_stdout", "input": "5\n1 2 3 11 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0", "output": "11\n1\n12\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 14 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9 11 12\n0", "output": "14\n1\n12\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 25 4 5\n6\n1 3 6 9 12 15 18\n4\n5 7 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nGiven a sequence of n... | [{"type": "stdin_stdout", "input": "5 1\n-1\n18\n-4\n17\n2\n0 0", "output": "18\n"}, {"type": "stdin_stdout", "input": "5 1\n-1\n3\n-4\n30\n2\n0 0", "output": "30\n"}, {"type": "stdin_stdout", "input": "5 3\n2\n13\n-3\n27\n1\n0 0", "output": "37\n"}, {"type": "stdin_stdout", "input": "5 1\n2\n10\n-4\n14\n2\n0 0", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen naming identifiers (variabl... | [{"type": "stdin_stdout", "input": "get^user_name L\ngetTserNbme U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nGetTserNbme\nema_nres_ute_g\n"}, {"type": "stdin_stdout", "input": "get^user_name L\nembNresTteg U\nemaNresUteG D\nEndOfInput X", "output": "get^userName\nEmbNresTteg\nema_nres_ute_g\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\nChain Disappearance Puzzle\n\nWe... | [{"type": "stdin_stdout", "input": "1\n6 9 9 9 9\n5\n3 9 6 0 12\n5 6 6 9 9\n4 6 3 10 15\n3 2 2 14 9\n2 2 1 1 1\n10\n3 10 6 5 6\n2 4 1 8 3\n6 2 7 9 2\n8 7 7 6 1\n7 9 6 4 9\n8 9 1 1 10\n5 6 1 8 0\n6 8 2 1 2\n9 6 3 3 5\n5 3 8 8 8\n5\n1 2 3 4 5\n6 7 8 9 1\n2 3 4 5 6\n7 8 9 1 2\n4 4 1 6 12\n3\n2 2 4 7 4\n6 5 7 7 7\n8 8 2 9 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStylish is a programming languag... | [{"type": "stdin_stdout", "input": "5 4\n(Folmow.my.style\n.........starting.from.round.brackets)\n{then.curly.brackets\n.....[.and.finally\n.......square.brackets.]}\n(Thank.you\n{for.showing.me\n[all\nthe.secrets]})\n4 2\n(This.time.I.will.show.you\n.........(how.to.use.round.brackets)\n.........[but.not.about.square... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are a teacher at a cram scho... | [{"type": "stdin_stdout", "input": "2 6\n1 16\n3 9\n2 334\n34 79\n0 0", "output": "0 1\n4 0\n0 1\n0 166\n0 13\n"}, {"type": "stdin_stdout", "input": "3 8\n1 5\n3 10\n2 218\n36 198\n0 0", "output": "3 0\n1 0\n1 0\n0 108\n0 2\n"}, {"type": "stdin_stdout", "input": "2 6\n1 16\n3 15\n2 200\n34 62\n0 0", "output": "0 1\n4 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\nAn angel lives in the clouds abo... | [{"type": "stdin_stdout", "input": "4\n6 4\nC E D# E G A\nC E F G\n6 4\nC E D# F G A\nD D# F G\n3 6\nC D D\nD# B D B D# C#\n0 12\nB B B B B B F F\nC A B B B B B B", "output": "Yes\nNo\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "4\n6 4\nC E D# E G A\nC E F G\n6 4\nC E D# F G A\nC D# F G\n3 6\nC D D\nD# B D B D# C#\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\ncoastline\n\nWaves rush to the b... | [{"type": "stdin_stdout", "input": "5 2 3\n3\n2\n1\n2\n6\n3 100 100\n5\n3\n4\n20 2 8\n3\n2\n10\n1\n14\n1\n1\n4\n2\n2\n16\n1\n8\n8\n2\n6\n3\n8\n3\n8\n7 2 2\n0\n2\n5\n2\n5\n2\n-1\n0 0 0", "output": "2\n0\n11\n5\n"}, {"type": "stdin_stdout", "input": "5 2 3\n3\n2\n1\n2\n6\n3 110 100\n5\n3\n4\n20 2 3\n3\n2\n10\n1\n14\n1\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\nC: Short-circuit evaluation\n\np... | [{"type": "stdin_stdout", "input": "?&?&?|?|?&?", "output": "3 2\n"}, {"type": "stdin_stdout", "input": "?|?&?|?&?&?", "output": "3 1\n"}, {"type": "stdin_stdout", "input": "?&?&?|?&?|?", "output": "3 3\n"}, {"type": "stdin_stdout", "input": "?&?|?|?&?&?", "output": "3 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\nGiven a set of $N$ axis-aligned ... | [{"type": "stdin_stdout", "input": "4\n0 0 3 1\n-1 0 1 3\n-1 2 4 3\n3 0 3 3", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n0 0 3 1\n-1 0 1 3\n-1 0 4 3\n2 0 3 2", "output": "15\n"}, {"type": "stdin_stdout", "input": "4\n0 0 3 2\n-1 0 1 3\n-1 0 8 3\n2 0 3 2", "output": "27\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\nThere is an array with n element... | [{"type": "stdin_stdout", "input": "5 119899\n60825 99853 69251 68402 1266\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 65537\n60825 99853 69251 68402 1266\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 132\n10060 81912 13624 40413 19012\n", "output": "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\nYou invited n guests to dinner! ... | [{"type": "stdin_stdout", "input": "10\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n1000000000 1000000000\n", "output": "10000000010\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\nVova has won n trophies in diffe... | [{"type": "stdin_stdout", "input": "300\nSSGSGSSSGSGSSSSGGSGSSGGSGSGGSSSGSSGSGGSSGGSGSSGGSGGSSGSSSGSGSGSSGSGGSSSGSSGSSGGGGSSGSSGSSGSGGSSSSGGGGSSGSSSSSSSSGSSSSGSGSSSSSSSSGSGSSSSGSSGGSSGSGSSSSSSGSGSSSGGSSGSGSSGSSSSSSGGGSSSGSGSGSGGSGGGSSGSGSSSGSSGGSSGSSGGGGSGSSGSSSSGGSSSSGGSGSSSSSSGSSSGGGSGSGGSSGSSSSSSGGSSSGSSSSGGGSSGSSSG... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 tree consisting ... | [{"type": "stdin_stdout", "input": "3\n1601 1601 1601\n1 2\n2 3\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1601 2970 1601\n1 2\n2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1601 1572 1601\n1 2\n2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1883 1601 1601\n1 2\n2 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\nPetya got interested in grammar ... | [{"type": "stdin_stdout", "input": "hqaagnslliola vdumwjqalkyzbybwcaomxyffbkufaarhoebrqlpgshbmvjbwchfolyniuqkrysdhakzzrbiznhatifkbrqruswzhkewvgarmqtuadmsiquueumnpftiulfdpvzqfdgcfscczfsqivcdbuqvtyujirjwohskuabufdkehctkkguvetra oxnpizgojsrtinites\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "lioslialapetrpetr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 beauty of an array b_... | [{"type": "stdin_stdout", "input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 program fails again. This t... | [{"type": "stdin_stdout", "input": "98 102\n79 30 51 48 80 91 32 16 39 54 79 17 48 24 8 66 9 94 45 14 85 82 54 89 44 92 26 62 47 5 75 33 102 24 63 39 91 31 33 55 81 63 81 87 26 19 41 108 46 56 91 97 67 30 94 81 40 5 22 8 23 34 5 77 43 66 67 15 7 154 26 22 19 71 26 82 69 52 40 4 98 27 63 74 68 74 55 75 25 51 18 100 22 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\n[THE SxPLAY & KIVΛ - 漂流](https:/... | [{"type": "stdin_stdout", "input": "10000000000000000 10000000000000000 100 100 10000000000000000 10000000000000000\n10000000000000000 10000000000000000 10000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3449558549195209 933961699330867 25 92 2448338832051825 8082390281981957\n7818990402072641 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSuppose you are performing the f... | [{"type": "stdin_stdout", "input": "1\n30 2\n16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736 137438953472 274877906944 549755813888 1099511627776 2199023255552 4398046511104 8796093022208 17592186044416 35184372088832 7036874417766... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYoung wilderness explorers set o... | [{"type": "stdin_stdout", "input": "2\n3\n1 1 1\n5\n2 3 1 2 2\n", "output": "3\n2\n\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 1 1\n5\n2 3 1 2 4\n", "output": "3\n2\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 1 1\n5\n2 3 1 1 2\n", "output": "3\n3\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 2 2\n5\n2 3 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\nWhile playing yet another strate... | [{"type": "stdin_stdout", "input": "11\n559227829 -118401759 491756598 -50857099 491152214 -500410377 141179566 -723654625 144131087 -460846619 791017750\n", "output": "4088562193\n"}, {"type": "stdin_stdout", "input": "11\n559227829 -118401759 491756598 -26772290 491152214 -500410377 141179566 -723654625 144131087 -46... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 upon a time in the Kingdom ... | [{"type": "stdin_stdout", "input": "1000 1000\n", "output": "500000\n"}, {"type": "stdin_stdout", "input": "999 1000\n", "output": "499500\n"}, {"type": "stdin_stdout", "input": "1000 997\n", "output": "498500\n"}, {"type": "stdin_stdout", "input": "997 1000\n", "output": "498500\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\nThere is a trampoline park with ... | [{"type": "stdin_stdout", "input": "3\n7\n1 2 10 2 2 2 2\n2\n2 1\n5\n1 1 1 2 1\n", "output": "10\n1\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n2 4 3 2 2 13 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "13\n4\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n3 4 3 2 2 24 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "24\n4\n1\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 2 arrays a and b, ... | [{"type": "stdin_stdout", "input": "56\n902 939 451 62 914 396 59 694 724 798 850 498 327 678 543 203 879 284 795 646 575 817 4 129 49 877 452 430 720 242 37 973 532 487 34 798 234 93 135 310 242 44 159 921 721 701 475 952 244 269 949 170 437 952 299 485\n828 750 266 900 991 302 872 874 141 258 671 726 702 513 35 295 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\nOne must train much to do well o... | [{"type": "stdin_stdout", "input": "86 81 36\n84 44 92 12 39 24 70 73 17 43 50 59 9 89 87 67 80 35 7 49 6 23 1 19 2 70 40 84 4 28 18 60 13 97 3 76 69 5 13 26 55 27 21 62 17 3 6 40 55 69 16 56 13 55 20 72 35 13 38 24 14 73 73 92 75 46 92 39 22 86 3 70 12 95 48 40 37 69 4 83 42 9 4 63 66 56\n16 5 2 16 -1 21 11 -1 1 48 -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\nLet's denote d(n) as the number ... | [{"type": "stdin_stdout", "input": "100 100 100\n", "output": "51103588"}, {"type": "stdin_stdout", "input": "98 34 100\n", "output": "13589991\n"}, {"type": "stdin_stdout", "input": "41 82 100\n", "output": "13808108\n"}, {"type": "stdin_stdout", "input": "39 90 100\n", "output": "14574419\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\nVasya has n items lying in a lin... | [{"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 110 100 10000 10000\n100 100\n", "output": "21000\n"}, {"type": "stdin_stdout", "input": "2 110 100 10000 11101\n100 000\n", "output": "11000\n"}, {"type": "stdin_stdout", "input": "2 110 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\nMany countries have such a New Y... | [{"type": "stdin_stdout", "input": "8 704 99 110\n", "output": "ACACACACACACACACACACBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA\nACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACBBBBBBBBBBBBBA\n"}, {"type": "stdin_stdout", "input": "8 66... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 we are given a... | [{"type": "stdin_stdout", "input": "8 20\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 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\nAnfisa the monkey learns to type... | [{"type": "stdin_stdout", "input": "200 1 200\nlycjpjrpkgxrkfvutlcwglghxadttpihmlpphwfttegfpimjxintjdxgqfhzrmxfcfojnxruhyfynlzgpxjeobjyxarsfxaqeogxfzvdlwsimupkwujudtfenryulzvsiazneyibqtweeuxpzrbumqqswjasliyjnnzfzuvthhzcsgfljikkajqkpjftztrzpjneaxqg\n", "output": "l\ny\nc\nj\np\nj\nr\np\nk\ng\nx\nr\nk\nf\nv\nu\nt\nl\nc\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\nLast week, Hamed learned about a... | [{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "infinity"}, {"type": "stdin_stdout", "input": "1000000000 1000001000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1204165230 1287214915\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1000000000 1010001000\n", "output": "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\nA soldier wants to buy w bananas... | [{"type": "stdin_stdout", "input": "1000 61465564 1000\n", "output": "439034436\n"}, {"type": "stdin_stdout", "input": "859 453892 543\n", "output": "126416972\n"}, {"type": "stdin_stdout", "input": "859 453892 889\n", "output": "339370803\n"}, {"type": "stdin_stdout", "input": "859 267939 889\n", "output": "339556756\... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.