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\nA: Flick input\n\nA college stud... | [{"type": "stdin_stdout", "input": "5R3D", "output": "neso\n"}, {"type": "stdin_stdout", "input": "5D2R", "output": "noke\n"}, {"type": "stdin_stdout", "input": "5T2D", "output": "nako\n"}, {"type": "stdin_stdout", "input": "5D3R", "output": "nose\n"}, {"type": "stdin_stdout", "input": "5U2D", "output": "nuko\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\nExample\n\nInput\n\n7\n>>\n\n\nO... | [{"type": "stdin_stdout", "input": "7\n>=", "output": "7\n"}, {"type": "stdin_stdout", "input": "7\n=>", "output": "7\n"}, {"type": "stdin_stdout", "input": "7\n?=", "output": "7\n"}, {"type": "stdin_stdout", "input": "7\n=?", "output": "7\n"}, {"type": "stdin_stdout", "input": "7\n<?", "output": "7\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has N character ... | [{"type": "stdin_stdout", "input": "4 2\npi\nip\nrr\nrr", "output": "iprrrrpi\n"}, {"type": "stdin_stdout", "input": "4 3\noi\nio\nsr\nrs", "output": "iorssroi\n"}, {"type": "stdin_stdout", "input": "4 2\noi\nio\nrr\nrr", "output": "iorrrroi"}, {"type": "stdin_stdout", "input": "4 2\noi\nio\nrr\nsr", "output": "iorroi\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 $ acitivities with... | [{"type": "stdin_stdout", "input": "5\n1 2\n10 2\n-1 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n10 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n12 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n10 2\n0 4\n1 2\n3 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\nLittle C loves number «3» very m... | [{"type": "stdin_stdout", "input": "1582786060\n", "output": "1 1 1582786058\n"}, {"type": "stdin_stdout", "input": "1000100000\n", "output": "1 2 1000099997\n"}, {"type": "stdin_stdout", "input": "1000071476\n", "output": "1 2 1000071473\n"}, {"type": "stdin_stdout", "input": "1042579470\n", "output": "1 1 1042579468\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 colony of villains wi... | [{"type": "stdin_stdout", "input": "sYDMlMKcqjyzmIKKjjcNyUgaixfaNUJYXjHXRHiRzNyHysnxTt\n68\n19 15\n46 34\n38 30\n50 39\n22 11\n4 14\n23 2\n10 47\n42 15\n9 5\n38 40\n43 16\n11 46\n29 46\n49 5\n28 1\n33 22\n48 8\n5 33\n8 34\n31 4\n49 3\n22 21\n31 22\n13 48\n17 50\n48 41\n7 9\n23 16\n18 12\n42 20\n17 43\n25 23\n34 30\n47 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEach day in Berland consists of ... | [{"type": "stdin_stdout", "input": "23\n1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "23\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "23\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1\n", "output": "4\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA company has n employees number... | [{"type": "stdin_stdout", "input": "77\n53\n-1\n48\n-1\n51\n-1\n54\n43\n70\n19\n64\n31\n45\n58\n6\n61\n41\n56\n34\n-1\n54\n-1\n66\n65\n74\n16\n38\n1\n2\n61\n-1\n34\n-1\n-1\n7\n19\n57\n13\n61\n42\n-1\n34\n65\n16\n31\n61\n6\n5\n34\n15\n-1\n13\n4\n22\n74\n7\n-1\n70\n38\n61\n45\n53\n46\n22\n-1\n65\n34\n19\n43\n48\n33\n58\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 a given integer n. Find... | [{"type": "stdin_stdout", "input": "60\n", "output": "1073741824"}, {"type": "stdin_stdout", "input": "54\n", "output": "134217728\n"}, {"type": "stdin_stdout", "input": "58\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "56\n", "output": "268435456"}, {"type": "stdin_stdout", "input": "50\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\nA sequence a0, a1, ..., at - 1 i... | [{"type": "stdin_stdout", "input": "100 3\n329 226 331 909 962 112 837 1005 194 818 506 416 125 648 367 459 400 582 989 547 329 438 234 121 272 226 821 376 834 427 718 164 834 113 654 177 737 212 169 696 744 180 89 944 233 147 667 990 809 1072 1085 1093 814 265 1067 312 833 572 303 901 1032 504 185 817 389 158 613 723 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 environmental activis... | [{"type": "stdin_stdout", "input": "4\n1\n100\n50 2\n49 1\n100\n8\n100 200 100 200 100 200 100 100\n16 2\n15 3\n107\n3\n1000000000 1000000000 1000000000\n50 1\n50 1\n4850788900\n5\n200 100 100 100 100\n105 5\n31 1\n90\n", "output": "-1\n6\n-1\n2\n"}, {"type": "stdin_stdout", "input": "4\n1\n100\n50 2\n49 1\n100\n8\n100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a and... | [{"type": "stdin_stdout", "input": "3\n0 0\n2 1\n2 -1\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\n11 2\n-1 0\n1 2\n", "output": "NO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "3\n2 14\n2 1\n-1 0\n", "output": "NO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\n0 0\n2 1\n-1 0\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\nThis is the hard version of this... | [{"type": "stdin_stdout", "input": "8\n5 6 2\n2 4 3 5 12\n5 5 2\n2 4 3 5 10\n3 1 1\n4 2 6\n5 2 5\n10 1 3 9 2\n2 10000 2\n10000 10000\n2 9999 2\n10000 10000\n4 6 4\n3 2 2 2\n5 5 3\n1 2 2 1 2\n", "output": "3\n2\n0\n1\n2\n0\n4\n5\n"}, {"type": "stdin_stdout", "input": "8\n5 6 2\n2 4 3 5 12\n5 5 2\n2 4 1 5 10\n3 1 1\n4 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation p_1,... | [{"type": "stdin_stdout", "input": "100 77\n59 92 18 16 45 82 63 43 50 68 19 13 53 79 48 28 94 49 25 77 54 8 61 66 40 100 99 20 35 14 52 56 22 17 57 36 23 90 4 65 84 42 30 27 3 15 87 32 93 74 46 91 41 9 34 12 11 7 10 86 78 72 81 73 51 55 58 97 39 31 5 24 29 88 95 6 44 37 60 62 83 33 47 21 2 38 26 98 71 75 96 70 76 69 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\nA card pyramid of height 1 is co... | [{"type": "stdin_stdout", "input": "50\n11833308\n5211498\n64660\n9077929\n2699416\n2432035\n234901\n1337830\n8457191\n10523566\n5722429\n5452712\n5511654\n8587879\n348160\n3141182\n2661936\n395300\n6950223\n2119926\n4407089\n3559060\n10228325\n5752720\n1607500\n647047\n8904557\n1954681\n698061\n9852830\n1972893\n13760... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice guesses the strings that B... | [{"type": "stdin_stdout", "input": "10\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\nbccddaaf\nzzzzzzzzzz\n", "output": "abac\nac\nbcdaf\nzzzzzz\nabac\nac\nbcdaf\nzzzzzz\nbcdaf\nzzzzzz\n"}, {"type": "stdin_stdout", "input": "11\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nac\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\nDespite his bad reputation, Capt... | [{"type": "stdin_stdout", "input": "7\n7\n23\n31\n36\n44\n100\n258\n", "output": "NO\nNO\nYES\n6 10 14 1\nYES\n6 10 15 5\nYES\n6 10 15 13\nYES\n6 10 14 70\nYES\n6 10 14 228\n"}, {"type": "stdin_stdout", "input": "7\n7\n23\n31\n36\n44\n100\n258\n", "output": "NO\nNO\nYES\n6 10 14 1\nY... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "997 1000\n", "output": "498500\n"}, {"type": "stdin_stdout", "input": "999 1000\n", "output": "499500\n"}, {"type": "stdin_stdout", "input": "1000 999\n", "output": "499500\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 are n + 1 cities, numbered... | [{"type": "stdin_stdout", "input": "2\n6\nLRRRLL\n3\nLRL\n", "output": "\n1 3 2 3 1 3 2\n1 4 1 4\n"}, {"type": "stdin_stdout", "input": "2\n6\nLLRRRL\n3\nLRL\n", "output": "1 2 3 2 3 1 3\n1 4 1 4\n"}, {"type": "stdin_stdout", "input": "2\n6\nLLRRRL\n3\nRLL\n", "output": "1 2 3 2 3 1 3\n3 1 3 2\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce upon a time, Oolimry saw a ... | [{"type": "stdin_stdout", "input": "73 95\n4 53 37 9 45 54 16 34 12 10 13 24 2 36 33 48 50 43 15 11 47 42 46 30 27 52 67 72 66 19 56 61 69 21 68 1 70 49 64 62 3 51 44 65 29 25 38 28 8 5 39 59 17 6 26 20 63 7 41 23 22 32 40 14 57 60 55 31 35 58 18 0 71\n", "output": "423380456"}, {"type": "stdin_stdout", "input": "7 129... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya is writing an operating sy... | [{"type": "stdin_stdout", "input": "11\npwd\ncd /home/vasya\npwd\ncd ..\npwd\ncd vasya/../../petya\npwd\ncd /a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a\npwd\ncd ..\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\nMad scientist Mike has just fini... | [{"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\nInna is a great piano player and... | [{"type": "stdin_stdout", "input": "10\n2 2 2 4 10 6 7 16 9 17\n1 2 3 5 5 6 7 8 18 10\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "10\n1 2 0 4 10 4 7 16 9 17\n1 2 3 5 5 6 7 8 18 10\n", "output": "154\n"}, {"type": "stdin_stdout", "input": "10\n1 2 2 4 10 6 7 16 9 17\n1 2 3 5 5 6 7 8 18 10\n", "output": "1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe R1 company has recently boug... | [{"type": "stdin_stdout", "input": "100 50\n5B2N,CXCWOIWH71XV!HCFEUCN3U88JDRIFRO2VHY?!N.RGH.?W14X5S.Y00RIY6YA19BPD0T,WECXYI,O2RF1U4NX9,F5AVLPOYK\n", "output": "LEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 dad was at work, a little ... | [{"type": "stdin_stdout", "input": "100\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 GCD table G of size n × n fo... | [{"type": "stdin_stdout", "input": "5\n537163 537163 537163 537163 537163 537163 1074326 537163 537163 537163 515139317 1074326 537163 537163 537163 539311652 321760637 170817834 537163 537163 537163 537163 537163 537163 392666153\n", "output": "539311652 515139317 392666153 321760637 170817834 "}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMikhail the Freelancer dreams of... | [{"type": "stdin_stdout", "input": "10 468662 93838\n589910 727627\n279516 867207\n470524 533177\n467834 784167\n295605 512137\n104422 629804\n925609 728473\n922365 964620\n998983 958315\n425628 935048\n", "output": "0.4691391144794256\n"}, {"type": "stdin_stdout", "input": "10 326330 93838\n589910 727627\n279516 86720... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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's telephone contains n pho... | [{"type": "stdin_stdout", "input": "100 20 100 15061\nwwwwhhwhhwhhwhhhhhwwwhhhwwwhwwhwhhwwhhwwwhwwhwwwhwhwhwwhhhwwwhhwhwwhhwhwhwwwhwwwwhwhwwwwhwhhhwhwhwwh\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 20 110 15061\nwwwwhhwhhwhhwhhhhhwwwhhhwwwhwwhwhhwwhhwwwhwwhwwwhwhwhwwhhhwwwhhwhwwhhwhwhwwwhwwwwhwhwwww... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVanya smashes potato in a vertic... | [{"type": "stdin_stdout", "input": "25 1000000000 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 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\nPresident of Berland has a very ... | [{"type": "stdin_stdout", "input": "24 11 N\n.NNNNNNNNNN\n.NNNNNNNNNN\n........RRR\n........RRR\n........RRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMM...\n....XXXXXXX\n...........\n.....CCCCCC\n.....CCCCCC\n.HHHHHHHHHH\n..VVVVV....\n..VVVVV....\n..VVVVV....\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n..... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Maxim has found an arra... | [{"type": "stdin_stdout", "input": "100 5 100\n-45 -36 -55 -96 -49 8 -88 -87 -82 51 27 -33 -65 0 -1 -42 -58 -19 -11 77 -54 14 -49 -90 -35 -9 -2 -48 0 -21 44 22 37 -32 -81 64 28 85 -77 44 18 -74 -50 62 8 -74 41 -15 -91 -93 -2 57 -12 2 -2 -90 84 6 -92 -14 72 85 86 -71 -59 57 -89 -4 78 56 56 24 -15 -78 27 -30 -31 -32 -92 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChloe, the same as Vladik, is a ... | [{"type": "stdin_stdout", "input": "50 844424930131968\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "49 351843720888320\n", "output": "47\n"}, {"type": "stdin_stdout", "input": "48 133865540681728\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "50 1125899906842623\n", "output": "1\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\nMahmoud wants to write a new dic... | [{"type": "stdin_stdout", "input": "8 4 12\nhello hi welcome goaway hateyou mmmm momo mana\n1 hello hi\n1 hi welcome\n2 goaway welcome\n2 hateyou hi\nhateyou goaway\nhateyou hi\nhateyou hi\nhateyou welcome\nmmmm momo\nwelcome hi\nwelcome hateyou\nhateyou goaway\nhello goaway\nhello goaway\nhello hateyou\ngoaway mmmm\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe flag of Berland is such rect... | [{"type": "stdin_stdout", "input": "15 28\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBB... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sum of p rubles is charged fro... | [{"type": "stdin_stdout", "input": "10 1 10\n1 1000000000\n2 1000000000\n3 1000000000\n4 1000000000\n5 1000000000\n6 1000000000\n7 1000000000\n8 1000000000\n9 1000000000\n10 1000000000\n", "output": " 0"}, {"type": "stdin_stdout", "input": "14 4115 100\n18 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\nAlice decides to challenge Bob t... | [{"type": "stdin_stdout", "input": "10\n9699845986115288644154449969375578463311146124654217164226835725255676242441727218631546924475239861698217274382299442628518127964469554694458444938229418553749514796627711773489739492876115633143647794765425336871894747423586549472121441495652824789216899777352396915598187239911... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 of Oz is very strai... | [{"type": "stdin_stdout", "input": "10\n1 1 1000000000000000000\n3\n1 1000010000000000000 1000000000000000000\n3\n10 1 1000100000000000000\n3 2 7 5 10 11 19 17 29 23\n5 44 18509\n178 67 13 31 83\n5 26501 45670\n69 61 11 83 53\n3 11479 40837\n83 42 3\n1 24465 975\n37\n2 23282 40109\n43 41\n3 492 3487\n47 37 7\n2 4828 20... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a set of disti... | [{"type": "stdin_stdout", "input": "2\n2\n2 11\n3\n1 11 14\n\nEMPLAS", "output": "500000009\n454545459\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 11\n3\n2 11 14\n\nEMPLAS", "output": "500000009\n500000009\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 11\n3\n2 18 14\n\nEMPLAS", "output": "500000009\n285714289\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\nCampus Ambassador has organized ... | [{"type": "stdin_stdout", "input": "15\n_hjm -4\njibl -1\nzcjjw -1\nvimk^ -34\nppqkc 2\nhrdkbq -1\n`muija 2\naoinqib 4\niasanhm 0\nl_ile -1\ndasrhit 0\nqaulh 0\nicmi 10\nlvxci 2\nansinag -35", "output": "icmi\n"}, {"type": "stdin_stdout", "input": "15\n`hjm -3\nlahj 0\nvkkcz 1\nvink^ -59\npoqjc 6\nqbldrh -1\n`mtika 6\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\nDo you remember the game of Snak... | [{"type": "stdin_stdout", "input": "1\n11025 64\n297 345\n3266 10057\n5366 9583\n1815 5123\n1255 1449\n315 1580\n160 513\n2557 3726\n452 4632\n560 3339\n6643 9342\n2591 5273\n1473 5777\n826 10203\n1572 3833\n101 323\n2311 5011\n2124 5492\n6325 6700\n7925 9037\n5995 6129\n1157 3090\n463 3925\n2823 5693\n7447 10803\n1077... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer S. Find how ... | [{"type": "stdin_stdout", "input": "1175", "output": "531468532\n"}, {"type": "stdin_stdout", "input": "1729", "output": "294867501"}, {"type": "stdin_stdout", "input": "333", "output": "223377764\n"}, {"type": "stdin_stdout", "input": "106", "output": "759001237\n"}, {"type": "stdin_stdout", "input": "192", "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\nA bracket sequence is a string t... | [{"type": "stdin_stdout", "input": "4\n((()))\n((((((\n))))))\n)()()(", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n)))(((\n((((((\n))))))\n)()()(", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n((())(\n(()(()\n))))))\n)((()(", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\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\nFor two sequences S and T of len... | [{"type": "stdin_stdout", "input": "5\n52 103 72 25 79", "output": "292096\n"}, {"type": "stdin_stdout", "input": "5\n63 103 72 25 79", "output": "306176\n"}, {"type": "stdin_stdout", "input": "5\n20 67 72 25 79", "output": "227072\n"}, {"type": "stdin_stdout", "input": "5\n2 124 30 25 55", "output": "171520\n"}, {"typ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have two bottles for holding ... | [{"type": "stdin_stdout", "input": "6 113 -1", "output": "106\n"}, {"type": "stdin_stdout", "input": "6 228 -1", "output": "221\n"}, {"type": "stdin_stdout", "input": "2 228 -1", "output": "225\n"}, {"type": "stdin_stdout", "input": "2 396 -1", "output": "393\n"}, {"type": "stdin_stdout", "input": "2 666 -1", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng... | [{"type": "stdin_stdout", "input": "8 3\nACACTABG\n6 3\n4 6\n2 1", "output": "-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n4 3\n1 2", "output": "2\n-1\n1\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n8 5\n1 6", "output": "2\n-1\n2\n"}, {"type": "stdin_stdout", "input": "8 3\nACACT... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 programming, hexadecimal nota... | [{"type": "stdin_stdout", "input": "E F", "output": "<\n"}, {"type": "stdin_stdout", "input": "A A", "output": "=\n"}, {"type": "stdin_stdout", "input": "E B", "output": ">\n"}, {"type": "stdin_stdout", "input": "D F", "output": "<\n"}, {"type": "stdin_stdout", "input": "A C", "output": "<\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer sequenc... | [{"type": "stdin_stdout", "input": "7 26\n10\n20\n30\n43\n30\n20\n10", "output": "13\n"}, {"type": "stdin_stdout", "input": "7 26\n10\n20\n30\n40\n30\n20\n10", "output": "13"}, {"type": "stdin_stdout", "input": "1 26\n10\n20\n30\n43\n30\n20\n10", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 26\n10\n20\n30\n12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 pinholes on the xy-p... | [{"type": "stdin_stdout", "input": "8 1 2\n1 5\n4 3\n8 2\n5 7\n11 8\n3 3\n6 5\n4 8", "output": "8"}, {"type": "stdin_stdout", "input": "8 1 2\n1 5\n4 3\n8 2\n4 7\n8 8\n3 3\n6 6\n4 8", "output": "7"}, {"type": "stdin_stdout", "input": "8 1 2\n1 5\n4 3\n8 2\n4 7\n7 8\n3 3\n6 6\n4 8", "output": "6"}, {"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\nSnuke got an integer sequence fr... | [{"type": "stdin_stdout", "input": "28 2\n7\n17\n4\n8\n10\n2\n8\n19\n33\n143", "output": "3\n3\n3\n2\n2\n2\n2\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "27 12\n16\n19\n21\n7\n10\n4\n9\n0\n22\n0", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn extension of a complex number... | [{"type": "stdin_stdout", "input": "2\n2 0 2 1 89 0 26 7\n13 11 25 8 -1 3 0 -2\n0", "output": "119 -12 230 103\n-30 -22 21 -109\n"}, {"type": "stdin_stdout", "input": "2\n2 0 2 5 89 0 26 4\n7 11 25 8 -1 3 0 -2\n0", "output": "106 -122 230 453\n-24 -40 21 -97\n"}, {"type": "stdin_stdout", "input": "2\n2 0 2 5 89 0 26 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\nAdvanced Creative Mobile (ACM) h... | [{"type": "stdin_stdout", "input": "5\n<main>10,10,190,150<menu>20,20,70,140</menu><primary>80,20,180,140</primary></main>\n9 10\n0 17\n40 190\n2 3\n130 80\n0", "output": "OUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nprimary 0\n"}, {"type": "stdin_stdout", "input": "5\n<main>10,10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA decimal representation of an i... | [{"type": "stdin_stdout", "input": "2012 8\n83268 3\n1112 9\n0 1\n20 2\n0 0", "output": "13 86526432 3\n5 74943 4\n5 954197541 14\n0 0 1\n2 63 5\n"}, {"type": "stdin_stdout", "input": "245 9\n83268 23\n821 3\n0 0\n99 1\n0 -1", "output": "3 863098632 14\n12 98765433331976666543211 5\n3 495 1\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\nDr. Jimbo, an applied mathematic... | [{"type": "stdin_stdout", "input": "1\nA=[1 2 3;4 5 6].\n1\nA=[[1 2 3;4 5 6] [7 8;9 10] [11;12];13 14 15 16 17 18].\n3\nB=[3 -2 1;-9 8 7].\nC=([1 2 3;4 5 6]+B)(2,3).\nD=([1 0 3;4 5 6]+B)([1 2],[2 3]).\n5\nA=2*[1 2;-3 4]'.\nB=A([2 1 2],[2 1]).\nA=[1 2;3 4]*3.\nA=[2]*[1 3;2 4].\nA=[1 2;3 4]*[3].\n2\nA=[11 12 13;0 22 23;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\nThe sales department of Japanese... | [{"type": "stdin_stdout", "input": "4\n0 0 x\n2 0 x\n0 1 x\n2 1 x\n4\n1 0 x\n0 1 x\n3 1 x\n1 2 x\n4\n0 0 x\n2 0 y\n0 1 y\n1 2 x\n0", "output": "Yes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "4\n0 0 x\n2 0 x\n0 1 x\n2 1 x\n4\n1 0 x\n0 1 x\n3 1 x\n1 2 x\n4\n0 0 x\n2 0 y\n0 1 y\n2 2 x\n0", "output": "Yes\nYes\nYes\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "4 5\n0 1 1\n0 2 10\n1 2 3\n1 1 2\n1 1 3", "output": "10\n11\n11\n"}, {"type": "stdin_stdout", "input": "4 5\n1 1 1\n1 4 3\n0 3 3\n1 1 2\n1 2 3", "output": "0\n0\n0\n3\n"}, {"type": "stdin_stdout", "input": "4 5\n0 1 1\n1 2 3\n1 2 3\n1 1 2\n1 2 2", "output": "0\n0\n1\n0\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\nDevu is a class teacher of a cla... | [{"type": "stdin_stdout", "input": "8\n-1\nBB\n0\nBG\n1\nGBGB\n2\nBGG\n2\nBGGB\n1\nBBBGG\n2\nBBGG\n2\nBGB", "output": "-1\n0\n0\n1\n1\n3\n1\n0\n"}, {"type": "stdin_stdout", "input": "8\n1\nBB\n0\nBG\n0\nBBGG\n1\nAGG\n0\nBGGB\n1\nBBBGG\n2\nBBGG\n2\nBGB", "output": "-1\n0\n1\n-1\n1\n3\n1\n0\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\nThis is an interactive problem.\... | [{"type": "stdin_stdout", "input": "10\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n", "output": "? 2 1 10 10\n? 2 2 10 10\n? 2 3 10 10\n? 2 4 10 10\n? 2 5 10 10\n? 2 6 10 10\n? 2 7 10 10\n? 2 8 10 10\n? 2 9 10 10\n? 1 1 10 9\n? 1 1 9 9\n? 1 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe German University in Cairo (... | [{"type": "stdin_stdout", "input": "44 42\n4 37 166\n34 25 47\n28 19 367\n20 14 811\n8 3 878\n39 1 925\n35 9 206\n32 18 841\n16 44 503\n5 20 426\n22 34 896\n44 43 471\n17 33 577\n40 22 317\n24 31 818\n37 11 292\n21 39 888\n6 8 983\n43 36 170\n11 21 662\n36 17 942\n18 7 356\n2 32 220\n12 5 774\n19 27 193\n13 40 63\n15 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\nReading books is one of Sasha's ... | [{"type": "stdin_stdout", "input": "tttdddssstttssstttdddddddddttttttdddsssdddtttsssdddsssssstttddddddtttdddssstttsssttttttdddtttsssssstttssssssssstttsssssstttssstttdddddddddsssdddssssssdddssstttsssdddssstttdddttttttdddddddddsssssstttdddtttssssssdddddddddttttttdddtttsssdddssstttsssdddssssssdddsssdddddddddtttssstttsssss... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 analyze a program written ... | [{"type": "stdin_stdout", "input": "9\nc111=a&b\nd=b^a\ne=c111#d\nd=d\nf=f\nf=c111$d\ng=e$f\nh=e#f\nres=g^h\n", "output": "7\naaaa=a&b\naaab=b^a\naaac=aaaa#aaab\naaad=aaaa$aaab\naaae=aaac$aaad\naaaf=aaac#aaad\nres=aaae^aaaf\n"}, {"type": "stdin_stdout", "input": "9\nc=a$b\ne=c#c\nf=c$c\nh=a$b\nx=h$h\nh#h=y\nz=x^y\ng=f^... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, on the course of algor... | [{"type": "stdin_stdout", "input": "71 57\n9 26 80 2 65 60 63 1 15 109 114 1 58 27 41 97 42 9 42 56 87 22 10 28 34 90 13 70 71 56 65 21 0 78 47 96 56 77 32 83 28 16 10 41 0 18 118 12 27 112 4 67 21 41 111 20 21 52 74 10 83 74 43 123 2 15 0 63 68 7 72\n81\n47\n81\n81\n5\n9\n41\n76\n81\n92\n95\n94\n78\n93\n47\n30\n152\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sorted array a_1... | [{"type": "stdin_stdout", "input": "7 6\n-3 0 -1 -2 -2 -4 -1\n", "output": "-2\n"}, {"type": "stdin_stdout", "input": "8 1\n1 1 2 3 5 8 13 21\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "5 3\n99 101 103 105 107\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "8 2\n1 1 2 3 5 8 13 21\n", "output": "1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAll of us love treasures, right?... | [{"type": "stdin_stdout", "input": "2 250\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\nThis is the harder version of th... | [{"type": "stdin_stdout", "input": "100\n61 28 67 53 13 6 70 5 79 82 60 60 84 17 80 25 82 82 69 76 81 43 58 86 18 78 4 25 8 30 33 87 91 18 90 26 62 11 28 66 9 33 58 66 47 48 108 38 25 57 4 84 79 71 54 84 63 32 97 62 26 68 5 69 54 93 25 26 100 73 24 94 80 39 30 45 95 80 0 29 57 98 92 15 17 76 69 11 57 56 48 10 28 7 63 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\nYeah, we failed to make up a New... | [{"type": "stdin_stdout", "input": "5\n3 1\n15 21\n4 13\n13 2\n8 1\n", "output": "1 2 3\n1 2 3 4 5 6 7 8 9 10 15 13 14 11 12\n-1\n1 2 3 4 5 6 7 8 9 10 11 13 12\n1 2 3 4 5 6 7 8\n"}, {"type": "stdin_stdout", "input": "5\n3 2\n10 21\n4 13\n13 2\n8 1\n", "output": "1 3 2\n1 2 3 4 5 10 8 9 6 7\n-1\n1 2 3 4 5 6 7 8 9 10 11 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this task Anna and Maria play... | [{"type": "stdin_stdout", "input": "S..SSS.A\nS.S.SSSS\nSSSSSSSS\n...SS...\nS.SSSSSS\nSS..SS.S\nSS..S.S.\nMSS..SSS\n", "output": "LOSE\n"}, {"type": "stdin_stdout", "input": ".SSSSSSA\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\nSSSSSSS.\nMSSSSSSS\n", "output": "LOSE\n"}, {"type": "stdin_stdout", "input": ".SSSS.... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIf the girl doesn't go to Denis,... | [{"type": "stdin_stdout", "input": "30 8\n0 1 7 10 23 24 26 30\n40 13\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 7 10 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 7 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 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\nAshish has a tree consisting of ... | [{"type": "stdin_stdout", "input": "10\n64 0 0\n10 0 0\n17 0 1\n90 1 1\n97 1 1\n19 1 0\n26 1 1\n95 1 1\n46 0 0\n86 0 0\n5 4\n7 1\n9 5\n6 8\n1 6\n7 5\n8 10\n3 7\n3 2\n", "output": "128"}, {"type": "stdin_stdout", "input": "10\n92 0 1\n19 1 0\n46 1 0\n53 1 0\n13 1 0\n63 0 1\n3 0 1\n67 1 0\n20 0 1\n82 0 1\n6 5\n9 1\n3 7\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe length of the longest common... | [{"type": "stdin_stdout", "input": "1\n100\n47 48 49 47 48 49 47 48 48 49 47 48 91 47 47 49 49 49 49 47 49 47 47 47 49 47 48 49 48 47 49 49 47 47 49 48 47 48 49 47 49 47 49 47 49 47 47 47 92 49 48 49 48 48 47 48 47 47 49 48 49 48 48 47 49 48 47 77 48 47 48 48 49 47 48 48 48 49 47 48 47 48 47 49 48 47 49 48 47 47 48 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\nYou're given an array a of n int... | [{"type": "stdin_stdout", "input": "7\n4\n-3 5 -3 1\n2\n1 -1\n4\n-3 2 -3 4\n4\n-1 1 1 -1\n7\n-5 7 -6 -4 17 -13 4\n6\n-1000000000 -1000000000 -1000000000 1000000000 1000000000 1000000000\n1\n0\n", "output": "3\n0\n4\n1\n8\n3000000000\n0\n"}, {"type": "stdin_stdout", "input": "1\n6\n4 -4 -4 3 2 -1\n", "output": "4\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKolya got an integer array a_1, ... | [{"type": "stdin_stdout", "input": "100\n-6 2 8 -9 -9 3 -3 -2 7 3 2 -2 -9 -7 -10 -9 10 4 5 -9 8 -5 7 -2 6 -2 4 4 -2 -5 6 4 8 -8 9 7 -4 2 -3 7 4 -10 -7 -4 8 2 10 -8 -3 -8 -5 -5 -10 -6 -8 -5 7 -1 7 -5 9 10 3 5 10 -7 -3 -7 1 -5 -8 5 1 -1 4 10 2 6 -4 9 3 10 -5 -10 -10 -2 1 9 10 1 10 2 8 -3 -3 -1 7 -5 8 -4\n", "output": "11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA string t is called an anagram ... | [{"type": "stdin_stdout", "input": "??fb???a??\ndeeefc\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??fb???a??\ndedefc\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??fb???a??\ndedefd\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??a???bf??\ndedefd\n", "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\nYou are given two strings x and ... | [{"type": "stdin_stdout", "input": "justamassivetesttocheck\nhowwellyouhandlemodulooperations\n", "output": "\n667387032\n"}, {"type": "stdin_stdout", "input": "justamassivetestsocheck\nhowwellyouhandlemodulooperations\n", "output": "732028571\n"}, {"type": "stdin_stdout", "input": "kcehcostsetevissamatsuj\nhowwellyouh... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "24\n4\n3 2 1 4\n4\n4 2 1 3\n4\n1 2 3 4\n4\n4 3 1 2\n4\n1 3 4 2\n4\n3 1 2 4\n4\n1 3 2 4\n4\n2 1 4 3\n4\n4 2 3 1\n4\n4 1 2 3\n4\n1 2 4 3\n4\n1 4 2 3\n4\n3 4 2 1\n4\n2 4 1 3\n5\n1 4 3 2\n4\n2 4 3 1\n4\n3 1 4 2\n4\n3 2 4 1\n4\n2 3 1 4\n4\n4 3 2 1\n4\n2 1 3 4\n4\n4 1 3 2\n4\n2 3 4 1\n4\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSuppose you have two points p = ... | [{"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n6 9 1 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n6 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"type": "stdin_stdout", "input": "3\n4\n2 4 1 3\n5\n0 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"ty... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've got string s, consisting ... | [{"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabdacdbcacdbcacabaaba\n", "output": "zzzyyxxwddddccbba\n"}, {"type": "stdin_stdout", "input": "zyxzxzwyxybxxwabcdawdacdccacdbcacabaaba\n", "output": "zzzyyxxwwdddccbba\n"}, {"type": "stdin_stdout", "input": "thankstosamarasauteddybearsforthiscontest\n", "output": "y... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 decided to lay a parque... | [{"type": "stdin_stdout", "input": "100 100 10000 10000 10000\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabb\naabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabb\nbbaabbaabbaabbaabbaabbaabbaabbaabbaabba... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 often have to copy large volu... | [{"type": "stdin_stdout", "input": "20 30\n5 6 -6 10 10 -6 10 7 0 -20 3 1 -7 -13 1 -7 5 1 -1 1\n2 10 -10 -1 -9 3 9 -9 6 5 10 -2 -5 -14 1 5 -4 -1 -8 -7\n2 14\n1 8 11 1\n2 7\n1 6 11 1\n1 9 2 7\n1 12 1 7\n2 20\n2 5\n1 14 8 3\n1 8 17 4\n2 4\n1 11 12 9\n2 8\n2 3\n2 2\n1 17 13 2\n1 3 18 1\n2 11\n1 5 12 6\n1 12 13 1\n2 16\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\nSmart Beaver recently got intere... | [{"type": "stdin_stdout", "input": "hrsszhjvrbsszvqesessiqbzeqijjerqirhhjsehiehezvzihzssivhvihrivrhizeqvvhejvibhqrbbqjrjsessvrhijzsrqirvsqqbibzhrzseijesszsrzhjjbqsrjrsrizivvhsjvqz\n3\nrzzevhiibziqiirhsebebrvrvvjihsjhvjjrejvqezireqevqeszrrseriijijijveqzbsbrezqhrrhbshqrhzshjervqjjzveeqsisrbevvjvjhbzvbjrrvizh 0 122\niqqqj... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nGeorge loves graphs. Most of all... | [{"type": "stdin_stdout", "input": "5 25\n4 2\n1 4\n5 2\n2 2\n3 1\n4 5\n2 1\n2 5\n2 4\n1 2\n4 1\n4 4\n1 1\n1 5\n4 3\n5 1\n3 3\n1 3\n5 5\n2 3\n5 3\n3 5\n3 2\n5 4\n3 4\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "500 12\n129 135\n47 22\n382 193\n17 381\n325 499\n70 192\n266 250\n116 430\n429 428\n451 65\n104... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 little Vasya read an articl... | [{"type": "stdin_stdout", "input": "hvewdvwdwudrwarwmddwnazmwauzatrmwptwwevavpmwrtruwnpwantewrnwmepdwvtmnveanunrvrtwpvhhnuhnmpptdttzmmndtvudmzhhannmmnahdpzamuvhzaavnhtnumwrwvttdetvuewaaennddwuvzvaptdzrzhtetwwzmzedrwuvrwznprhdvnavrruvvhzuwpdtmpwmzrwvermrhdamv\nuvzhwtpuputnahwwarduzddhpnwwvettprwavdmnztdnrddmarmvuevtdezn... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem, your task is to... | [{"type": "stdin_stdout", "input": "23\n33 42 55 36 73 42 36 39 35 38 38 65 31 33 26 40 20 32 45 32 31 35 36\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\nVasya trains to compose crosswor... | [{"type": "stdin_stdout", "input": "ABBAAAABBBB\nBBABAAAABAABAB\nBAABABBBABBBBBAAA\nBABABAAABBAAABBAAAAB\nABAAAABBBBBABAABABBAAAAABBBBBB\nBBBBAABBAABBBBABAAABAABBAABBAA\n", "output": "BAABABBBABBBBBAAA.............\nA...............B.............\nB...............A.............\nA...............A.............\nB.......... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeonid wants to become a glass c... | [{"type": "stdin_stdout", "input": "10 19 10\nV 6\nH 8\nV 4\nV 8\nH 2\nH 5\nV 9\nH 7\nH 3\nV 7\n", "output": "114\n66\n44\n44\n44\n44\n44\n44\n44\n44\n"}, {"type": "stdin_stdout", "input": "15 5 10\nV 13\nV 6\nV 3\nH 4\nV 12\nV 7\nV 2\nH 1\nV 4\nH 3\n", "output": "65\n35\n35\n28\n24\n20\n20\n15\n15\n10\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\nChris the Rabbit has been intere... | [{"type": "stdin_stdout", "input": "100000\n", "output": "879367333\n"}, {"type": "stdin_stdout", "input": "99925\n", "output": "414342728\n"}, {"type": "stdin_stdout", "input": "54904\n", "output": "917915735\n"}, {"type": "stdin_stdout", "input": "57500\n", "output": "540890446\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 function <image> is called Lip... | [{"type": "stdin_stdout", "input": "3 6\n48261735 26888803 75904937\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "21372932\n119405200\n49016134\n21372932\n49016134\n119405200\n"}, {"type": "stdin_stdout", "input": "3 6\n48261735 26888803 95582211\n1 2\n1 3\n2 3\n1 2\n2 3\n1 3\n", "output": "21372932\n158759748\n68693408... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Farmer John rebuilds his f... | [{"type": "stdin_stdout", "input": "13 78\n10 2\n6 5\n5 7\n10 3\n6 13\n4 7\n4 13\n1 12\n13 2\n1 7\n10 5\n10 13\n12 2\n10 6\n5 3\n10 8\n9 11\n6 1\n4 5\n12 3\n6 7\n8 2\n1 9\n4 11\n5 8\n6 3\n9 5\n5 2\n13 11\n10 4\n12 7\n5 13\n12 8\n10 12\n6 12\n5 11\n1 8\n7 8\n12 4\n10 7\n1 5\n1 2\n10 11\n2 11\n12 13\n9 7\n8 3\n12 9\n9 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\nA wise man told Kerem \"Differen... | [{"type": "stdin_stdout", "input": "45\naaabbbcccdddeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "45\naaabbbcccdedeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "45\naaabbbcccdedeeefffgghhijjjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBarney lives in country USC (Uni... | [{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.000000 28.500000 27.000000 38.000000 38.50... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 plays the Need For Brake. ... | [{"type": "stdin_stdout", "input": "20\ng 1000000\nibb 1000000\nidj 1000000\nkccg 1000000\nbbe 1000000\nhjf 1000000\na 1000000\nf 1000000\niij 1000000\nakgf 1000000\nkdkhj 1000000\ne 1000000\nh 1000000\nhb 1000000\nfaie 1000000\nj 1000000\ni 1000000\nhgg 1000000\nfi 1000000\nicf 1000000\n12\n1000000 1000000 1000000 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\nApart from having lots of holida... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "100000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "900000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "703450474\n", "output": "96549526\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's hard times now. Today Petya... | [{"type": "stdin_stdout", "input": "k\n*\n89\nb\ncbbbc\ncabac\nbccbb\nccc\ncabaa\nabbaa\nccbaa\nccccb\ncabbb\nbbcbc\nbac\naaac\nabb\nbcbb\ncb\nbacc\nbbaba\nb\nacc\nbaac\naaba\nbcbba\nbaa\nbc\naaccb\nb\nab\nc\nbbbb\nabbcb\nacbb\ncba\nc\nbac\nc\nac\ncc\nb\nbbc\nbaab\nc\nbbc\nab\nb\nc\naa\naab\nab\naccbc\nacbaa\na\nccc\nc... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOlya loves energy drinks. She lo... | [{"type": "stdin_stdout", "input": "10 10 1000\n..........\n..........\n..........\n..........\n..........\n...-......\n..........\n........./\n..........\n..........\n10 10 1 3\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 10 1000\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\nAlice has a very important messa... | [{"type": "stdin_stdout", "input": "10\n331415699 278745619 998190004 423175621 42983144 166555524 843586353 802130100 337889448 685310951\n226011312 266003835 342809544 504667531 529814910 684873393 817026985 844010788 993949858 1031395667\n", "output": "\n128965467 \n243912600 \n4281110 \n112029883 \n223689619 \n7692... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKatie, Kuro and Shiro are best f... | [{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000001\n"}, {"type": "stdin_stdout", "input": "1043714136496022950\n", "output": "1043714136496022951\n"}, {"type": "stdin_stdout", "input": "1837625121252532586\n", "output": "1837625121252532587\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 string s of length n can be en... | [{"type": "stdin_stdout", "input": "100\noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n", "output": "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n"}, {"type": "stdin_stdout", "input": "100\nedykhvzcntljuuoqg... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nView Russian Translation\n\nLitt... | [{"type": "stdin_stdout", "input": "DDURLDRRUURDRLRDUDUDDUURULLUDRLUDUURDURRURDDRLDLRDURURDLDDDRRRLLURDUURRDLDDDDUDLDLULRRLLUDRLDRRRLDLRULULLLRRLDUDRRUDLUULLDRURULLRULRDLUDDDLDDLRLLUDLRLUULRDDULRRDRRLLRDLRDLRLDLRRDRUUDUUDRRDULUDUDLLRLUDLRRLRDULLRLLULURRUDRRRRLUDDLRURRRLLDDDUDRRDLURLRLDLRRLDRDDDRLULLDDLUDULDDRUULRUDULRU... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. Hahn, our very own DJ, was s... | [{"type": "stdin_stdout", "input": "1\n\nSANPLE", "output": "7 3\n"}, {"type": "stdin_stdout", "input": "1\n\nSANQLE", "output": "7 3\n"}, {"type": "stdin_stdout", "input": "1\n\nSNAQLE", "output": "7 3\n"}, {"type": "stdin_stdout", "input": "1\n\nSEAQLN", "output": "7 3\n"}, {"type": "stdin_stdout", "input": "1\n\nSEA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Statement:\nYou are one ... | [{"type": "stdin_stdout", "input": "Far\nout\nin\nthe\nuncharted\nbackwaters\nof\nthe\nunfashionable\nend\nof\nthe\nwestern\nspiral\nPRAGYAN\narm\nof\nthe\nGalaxy\nlies\na\nsmall\nunregarded\nyellow\nsun", "output": "Far\nout\nin\nthe\nuncharted\nbackwaters\nof\nthe\nunfashionable\nend\nof\nthe\nwestern\nspiral\nPRAGYA... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.