messages listlengths 1 1 | ground_truth stringlengths 156 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\nA string is called square if it is some string written twice in a row. For example, the strings \"aa\", \"abc... | [{"input": "10\na\naa\naaa\naaaa\nabab\nabcabc\nabacaba\nxxyy\nxyyx\nxyxy\n", "output": "NO\nYES\nNO\nYES\nYES\nYES\nNO\nNO\nNO\nYES\n"}, {"input": "10\na\naa\naaa\naaaa\nabab\nabcabc\nabacaba\nyxxy\nxyyx\nxyxy\n", "output": "NO\nYES\nNO\nYES\nYES\nYES\nNO\nNO\nNO\nYES\n"}, {"input": "10\nb\naa\naaa\naaaa\nabab\nabcabc... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have to write two methods to *encrypt* and *decrypt* strings.\nBoth methods have two parameters:\n```\n1.... | [{"input": "\"Do the kata Kobayashi Maru Test. Endless fun and excitement when finding a solution.\"\n583", "output": "[\"Sr pgi jlpl Jr,lqlage Zlow Piapc I.skiaa dw. l.s ibnepizi.p ugi. de.se.f l arkwper.c\"]", "fn_name": "encrypt"}, {"input": "\"This is a test.\"\n348", "output": "[\"Iaqh qh g iyhi,\"]", "fn_name": "... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently, Dima met with Sasha in a philatelic store, and since then they are collecting coins together. Their... | [{"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 50 4 80 72 39\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\nA robber has attempted to rob a bank but failed to complete his task. However, he had managed to open all the... | [{"input": "8 3 13\n12\n3 3 3 12 7 6 10 1 8 8 7 12\n", "output": "8\n"}, {"input": "8 3 13\n12\n3 3 3 8 7 6 10 1 8 8 7 12\n", "output": "8\n"}, {"input": "8 5 13\n12\n3 3 3 8 7 6 10 1 7 8 7 11\n", "output": "8\n"}, {"input": "8 5 13\n12\n3 3 3 8 7 0 10 1 7 8 7 11\n", "output": "7\n"}, {"input": "6 3 13\n12\n3 3 3 5 7 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\nSheldon Cooper, Leonard Hofstadter and Penny decide to go for drinks at Cheese cake factory. Sheldon proposes... | [{"input": "8\n4 8 9 7 45 6 3 27\n156", "output": "False"}, {"input": "8\n4 8 9 7 45 6 3 27\n56", "output": "True"}, {"input": "6\n45 55 5 7 23 4\n107", "output": "True"}, {"input": "7\n2 5 4 9 7 33 6\n44", "output": "True"}, {"input": "4\n55 45 2 23\n58", "output": "False"}, {"input": "4\n4 3 25 5\n33", "output": "Tru... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMonocarp is playing yet another computer game. In this game, his character has to kill a dragon. The battle w... | [{"input": "4\n2 13\n1 5\n3 11\n1 4 20\n5 3\n1 2 4 8 7\n4 1000\n5 25 95 1337\n", "output": "9\n4\n1\n455\n"}, {"input": "4\n2 1\n1 5\n3 10\n2 4 10\n5 3\n1 2 4 5 7\n4 1000\n3 25 124 1337\n", "output": "1\n4\n1\n440\n"}, {"input": "4\n2 5\n1 5\n3 10\n2 4 10\n5 3\n1 2 4 5 7\n4 1000\n3 25 64 1337\n", "output": "3\n4\n1\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\nChampernown constant is an irrational number represented in decimal by \"0.\" followed by concatenation of al... | [{"input": "11 17\n11 14\n0 0", "output": "01112131415161718\n01112131415161\n"}, {"input": "4 7\n2 26\n0 0", "output": "4567891\n23456789101112131415161718\n"}, {"input": "2 5\n1 26\n0 0", "output": "23456\n12345678910111213141516171\n"}, {"input": "9 15\n11 14\n0 0", "output": "910111213141516\n01112131415161\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\nYour back at your newly acquired decrypting job for the secret organization when a new assignment comes in. ... | [{"input": "\"this is a secret\"\n\" *\"", "output": "[\"this*is*a*secret\"]", "fn_name": "mirror"}, {"input": "\"gsrh rh z hvxivg\"", "output": "[\"this is a secret\"]", "fn_name": "mirror"}, {"input": "\"Welcome home\"\n\"w\"", "output": "[\"welcome home\"]", "fn_name": "mirror"}, {"input": "\"Welcome home\"", "outpu... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consist... | [{"input": "50 7 3\n50\n17 47 1 12 21 25 6 5 49 27 34 8 16 38 11 44 48 9 2 20 3 22 33 23 36 41 15 35 31 30 50 7 45 42 37 29 14 26 24 46 19 4 10 28 18 43 32 39 40 13\n", "output": "19\n"}, {"input": "50 1 1\n50\n1 13 21 37 30 48 23 19 6 49 36 14 9 24 44 10 41 28 20 2 15 11 45 3 25 33 50 38 35 47 31 4 12 46 32 8 42 26 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\nLook for the Winner!\n\nThe citizens of TKB City are famous for their deep love in elections and vote countin... | [{"input": "1\nA\n4\nA A B B\n5\nL M N L N\n6\nK K K K K K\n6\nX X X Y Z X\n10\nB A A B A C A C C B\n10\nV U U U U W V W V W\n0", "output": "A 1\nTIE\nTIE\nK 4\nX 5\nA 10\nU 10\n"}, {"input": "1\nA\n4\nA A B B\n5\nL M N L N\n6\nK K K K K K\n6\nX X X Y Z X\n10\nB A A B A C A C C B\n10\nV T U U U W W W V W\n0", "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\nThe whole world got obsessed with robots,and to keep pace with the progress, great Berland's programmer Draud... | [{"input": "RLRRRRRDRRDRRRRDLRRRRRRRDLRLDDLRRRRLDLDRDRRRRDRDRDRDLRRURRLRRRRDRRRRRRRRLDDRLRRDRRRRRRRDRDRLDRDDDRDR\n", "output": "BUG\n"}, {"input": "DDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRUUUUUUUUUUUUUUUUUUUUUUUU\n", "output": "BUG\n"}, {"input": "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a bookshelf which can fit $n$ books. The $i$-th position of bookshelf is $a_i = 1$ if there is a boo... | [{"input": "5\n7\n0 0 1 0 1 0 1\n3\n1 0 0\n5\n1 1 0 0 1\n6\n1 0 0 0 0 1\n5\n1 1 0 1 1\n", "output": "2\n0\n2\n4\n1\n"}, {"input": "5\n7\n0 0 1 0 1 0 1\n3\n1 0 0\n5\n1 1 0 1 1\n6\n1 0 0 0 0 1\n5\n1 1 0 1 1\n", "output": "2\n0\n1\n4\n1\n"}, {"input": "5\n7\n0 0 1 0 1 0 1\n3\n1 0 0\n5\n1 0 0 0 1\n6\n1 0 0 0 0 1\n5\n1 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\nPolycarp took $n$ videos, the duration of the $i$-th video is $a_i$ seconds. The videos are listed in the chr... | [{"input": "6 3\n3 3 1 4 1 6\n", "output": "Yes\n2 3 1 \n"}, {"input": "6 3\n3 3 1 4 1 6\n", "output": "Yes\n2 3 1 "}, {"input": "3 3\n1 1 1\n", "output": "Yes\n1 1 1 \n"}, {"input": "3 3\n1 1 1\n", "output": "Yes\n1 1 1 "}, {"input": "3 1\n1 10 100\n", "output": "Yes\n3 \n"}, {"input": "3 1\n1 10 100\n", "output": "Ye... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya writes his own library for building graphical user interface. Vasya called his creation VTK (VasyaToolK... | [{"input": "20\nVBox hykl\nVBox enwv\nenwv.pack(hykl)\nVBox dlepf\ndlepf.pack(hykl)\nenwv.set_border(30)\nWidget mjrrik(54,21)\nhykl.set_border(2)\ndlepf.set_border(22)\nenwv.set_border(3)\nenwv.pack(dlepf)\ndlepf.pack(mjrrik)\nhykl.set_spacing(96)\nenwv.set_border(32)\ndlepf.set_border(72)\nWidget j(54,86)\nhykl.pack(... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAkari has n kinds of flowers, one of each kind.\nShe is going to choose one or more of these flowers to make ... | [{"input": "1000000000 199999 200000\n", "output": "382492393\n"}, {"input": "1000000000 141421 173205\n", "output": "34076506\n"}, {"input": "750063539 163676 194328\n", "output": "801789004\n"}, {"input": "686442509 103497 190629\n", "output": "506071717\n"}, {"input": "699889611 31932 135902\n", "output": "784137353... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWell, the series which Stepan watched for a very long time, ended. In total, the series had n episodes. For e... | [{"input": "100 100\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "output": "YES\n"}, {"input": "100 100\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "output": "YES\n"}, {"input": "100 000\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\nLet $LCM(x, y)$ be the minimum positive integer that is divisible by both $x$ and $y$. For example, $LCM(13, ... | [{"input": "69\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\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\nRead problems statements in Mandarin Chinese and Russian. \n\nYou are given an array A of N integers. You ar... | [{"input": "5 3\n0 13 10 -1 -2\nR -1\nC 1\nR 4\n@ 1\nS 2", "output": "-1\n-2\n"}, {"input": "5 3\n0 13 10 -1 -2\nR -2\nC 1\nR 4\n@ 1\nS 2", "output": "10\n-2\n"}, {"input": "5 3\n0 13 10 -1 -2\nR 0\nC 1\nR 4\n@ 1\nS 2", "output": "-2\n-2\n"}, {"input": "5 3\n0 13 10 -1 -2\nR 0\nC 1\nR 1\n@ 2\nT 2", "output": "-2\n13\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\nCalculate the product of all elements in an array.\n```if:csharp\nIf the array is *null*, you should throw `A... | [{"input": "[5, 4, 1, 3, 9]", "output": "[540]", "fn_name": "product"}, {"input": "[-2, 6, 7, 8]", "output": "[-672]", "fn_name": "product"}, {"input": "[0, 2, 9, 7]", "output": "[0]", "fn_name": "product"}, {"input": "null", "output": "[null]", "fn_name": "product"}, {"input": "[10]", "output": "[10]", "fn_name": "pro... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera's lifelong ambition was to be a photographer, so he bought a new camera. Every day he got more and mor... | [{"input": "50 50\n6 10\n10 0\n1 9\n8 2\n4 9\n0 7\n2 0\n7 5\n4 8\n13 7\n2 4\n5 6\n6 8\n3 2\n4 6\n7 8\n6 9\n7 7\n7 3\n9 5\n3 10\n7 2\n4 3\n2 0\n6 5\n5 3\n1 7\n1 7\n9 1\n10 4\n10 5\n4 2\n10 10\n0 7\n1 2\n10 1\n1 7\n3 7\n8 7\n5 2\n6 1\n3 1\n4 7\n7 10\n1 5\n10 8\n5 5\n5 1\n3 3\n1 6\n2 1\n", "output": "3\n6 23 50 \n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTake an integer `n (n >= 0)` and a digit `d (0 <= d <= 9)` as an integer. Square all numbers `k (0 <= k <= n)... | [{"input": "11549\n1", "output": "[11905]", "fn_name": "nb_dig"}, {"input": "12526\n1", "output": "[13558]", "fn_name": "nb_dig"}, {"input": "14956\n1", "output": "[17267]", "fn_name": "nb_dig"}, {"input": "11011\n2", "output": "[9481]", "fn_name": "nb_dig"}, {"input": "12224\n8", "output": "[7733]", "fn_name": "nb_dig... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAndrey thinks he is truly a successful developer, but in reality he didn't know about the binary search algor... | [{"input": "1000 1000 999\n", "output": "756641425\n"}, {"input": "1000 501 501\n", "output": "646597996\n"}, {"input": "1000 888 888\n", "output": "644649893\n"}, {"input": "1000 500 500\n", "output": "646597996\n"}, {"input": "1000 1000 999\n", "output": "756641425"}, {"input": "1000 501 347\n", "output": "385628187\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G.\nG consis... | [{"input": "6 8\n1 2\n2 1\n3 4\n4 11\n5 0\n1 5\n1 5\n4 6\n1 4", "output": "-1\n"}, {"input": "6 8\n1 2\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 6\n1 6\n", "output": "2\n"}, {"input": "6 8\n1 4\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 1\n1 6", "output": "-1\n"}, {"input": "6 8\n1 2\n2 1\n3 4\n4 6\n5 0\n1 5\n1 5\n4 6\n1 4", "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\nGardener Alexey teaches competitive programming to high school students. To congratulate Alexey on the Teache... | [{"input": "11\n9969 9945 12703 11114 8159 10000 9928 9985 6747 9181 9933\n", "output": "5991155360\n"}, {"input": "11\n9969 9945 12703 9914 8159 10000 9928 9985 6747 9939 9933\n", "output": "5907768442\n"}, {"input": "11\n9969 9945 12703 9914 8159 10000 9928 9985 6747 9181 9933\n", "output": "5840383266\n"}, {"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\nEach month Blake gets the report containing main economic indicators of the company \"Blake Technologies\". T... | [{"input": "100 30\n65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 74 57 115 16 55 102 79 97 21 80 41 56 49 103 61 66 1 36 44 43 82 37 38 106 27 114 51 112 55 87 41 69 31 86 58 27 46 99 18 105 91 38 5 9 2 109 39 2 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\n<image>\n\nThe International Clown and Pierrot Competition (ICPC), is one of the most distinguished and also ... | [{"input": "3\n1000\n342\n-1\n5\n-1\n2\n18\n11\n932\n5\n420\n1100\n0\n200\n685\n8\n353\n143\n402\n274\n283\n31\n402\n523\n0", "output": "342\n10\n435\n309\n"}, {"input": "3\n1000\n342\n0\n5\n2\n2\n11\n11\n932\n5\n148\n1000\n0\n200\n400\n8\n353\n242\n1097\n274\n283\n107\n402\n523\n0", "output": "342\n8\n249\n346\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\nYou have integer $n$. Calculate how many ways are there to fully cover belt-like area of $4n-2$ triangles wit... | [{"input": "1\n1000000000\n", "output": "1000000000\n"}, {"input": "1\n1000000000\n", "output": "1000000000\n"}, {"input": "1\n1111011001\n", "output": "1111011001\n"}, {"input": "1\n1011011001\n", "output": "1011011001\n"}, {"input": "1\n1011001001\n", "output": "1011001001\n"}, {"input": "1\n1011001101\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\nYou are given string s consists of opening and closing brackets of four kinds <>, {}, [], (). There are two t... | [{"input": "))>)}}>>]}]{{}{({)>{(((}>>))<[})}{}(){}}}]>><){<{<><{[[]{<(<{{])(({[<}({)[}>>([>>(>]>[{]{}<<)()]})])}([>]{}(>{(<([([<(\n", "output": "Impossible\n"}, {"input": "))>)}}>>]}]{{}{({)>{(((}>>))<[})}{}(){}}}]>><){;{<><{[[]{<(<{{])(({[<}({)[}>>([>>(>]>[{]{}<<)()]})])}([>]{}(>{(<([([<(\n", "output": "Impossible\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\nIt's that time of the year, Felicity is around the corner and you can see people celebrating all around the H... | [{"input": "100 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\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\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram ... | [{"input": "1000\ninqmubaqoc\ndxdglvihpa\npnagqofdzf\ndxegqbbhza\nlxwdrvmekl\nwccdceedww\ncedcwwwced\nkmemzhaioi\nrnkmsbaaei\nccddwwwcee\nqghqrvbxgg\ncgavbvslgb\nwcwswceded\nwecwwdcced\nypecevpoyy\nlxwdbvmqkl\nwobwicidod\nedwccewdwc\nrragafedvf\nyvnbozkgqy\nlxddbvmqkl\nrpwaqejdgf\nrnkwqewjni\ndwcecdwcwe\nwdcwwcedce\nrn... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily $8 \\times 8$,... | [{"input": "10\n16 92 81 8 70 28 72 91 87 13\n32 17 93 83 5 69 27 74 89 88\n43 31 22 99 79 4 65 26 71 90\n50 41 29 15 98 80 9 68 24 73\n59 51 38 35 18 96 82 6 67 25\n57 60 49 45 37 19 97 85 7 66\n76 53 61 46 40 36 14 95 86 3\n11 75 55 58 48 44 34 20 94 84\n2 10 77 56 62 52 39 30 23 100\n64 1 12 78 54 63 47 42 33 21\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\nWrite a function which reduces fractions to their simplest form! Fractions will be presented as an array/tupl... | [{"input": "[10956590, 13611876]", "output": "[[30605, 38022]]", "fn_name": "reduce_fraction"}, {"input": "[24622321, 24473455]", "output": "[[42673, 42415]]", "fn_name": "reduce_fraction"}, {"input": "[35884747, 5576447]", "output": "[[76841, 11941]]", "fn_name": "reduce_fraction"}, {"input": "[4255316, 11425973]", "o... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne way to create a task is to learn from life. You can choose some experience in real life, formalize it and... | [{"input": "100 1\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 100 100 100 100 100 100 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\nA girl named Sonya is studying in the scientific lyceum of the Kingdom of Kremland. The teacher of computer s... | [{"input": "100 1000000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "216163471\n"}, {"input": "100 1000000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWinter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. ... | [{"input": "4\n7 12 15 5\n", "output": "55\n"}, {"input": "4\n5 12 4 6\n", "output": "57\n"}, {"input": "4\n5 12 5 6\n", "output": "50\n"}, {"input": "4\n7 6 15 5\n", "output": "49\n"}, {"input": "4\n7 12 1 6\n", "output": "37\n"}, {"input": "4\n5 12 1 6\n", "output": "35\n"}, {"input": "4\n4 6 12 5\n", "output": "57\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\nConstraints\n\n* 1 β€ |V| β€ 100\n* 0 β€ |E| β€ 9900\n* -2 Γ 107 β€ di β€ 2 Γ 107\n* There are no parallel edges\n*... | [{"input": "15 6\n1 2 2\n1 3 -5\n1 2 3\n1 11 4\n2 0 1\n3 2 12", "output": "0 INF INF INF INF INF INF INF INF INF INF INF INF INF INF\n4 0 3 -5 INF INF INF INF INF INF INF 4 INF INF INF\n1 INF 0 INF INF INF INF INF INF INF INF INF INF INF INF\n13 INF 12 0 INF INF INF INF INF INF INF INF INF INF INF\nINF INF INF INF 0 IN... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is an infinite 2-dimensional grid. The robot stands in cell $(0, 0)$ and wants to reach cell $(x, y)$. ... | [{"input": "100\n0 0\n0 1\n1 0\n1 1\n0 2\n1 2\n2 0\n2 1\n2 2\n0 3\n1 3\n2 3\n3 0\n3 1\n3 2\n3 3\n0 4\n1 4\n2 4\n3 4\n4 0\n4 1\n4 2\n4 3\n4 4\n0 5\n1 5\n2 5\n3 5\n4 5\n5 0\n5 1\n5 2\n5 3\n5 4\n5 5\n0 6\n1 6\n2 6\n3 6\n4 6\n5 6\n6 0\n6 1\n6 2\n6 3\n6 4\n6 5\n6 6\n0 7\n1 7\n2 7\n3 7\n4 7\n5 7\n6 7\n7 0\n7 1\n7 2\n7 3\n7 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\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N. Each of the vertices, except the root, ha... | [{"input": "6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n3 6\n6 5", "output": "6\n4\n2\n0\n6\n3\n"}, {"input": "6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n3 6\n4 5", "output": "6\n4\n2\n0\n4\n3\n"}, {"input": "6 3\n3 1\n4 3\n4 1\n4 2\n6 1\n4 6\n3 6\n4 5", "output": "6\n4\n4\n0\n4\n3\n"}, {"input": "6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n3 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\n$n$ heroes fight against each other in the Arena. Initially, the $i$-th hero has level $a_i$.\n\nEach minute,... | [{"input": "2\n8\n1 9 1 9 8 10 10 10\n5\n10 10 10 10 10\n", "output": "6\n0\n"}, {"input": "2\n8\n1 9 1 9 8 10 10 10\n5\n10 10 10 10 10\n", "output": "6\n0\n"}, {"input": "2\n8\n1 9 1 9 8 10 16 10\n5\n10 10 10 10 10\n", "output": "6\n0\n"}, {"input": "2\n8\n1 9 2 9 8 10 16 10\n5\n10 10 10 10 10\n", "output": "7\n0\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLee was cleaning his house for the party when he found a messy string under the carpets. Now he'd like to mak... | [{"input": "5\n10\n0010111111\n4\n0000\n8\n01011111\n10\n1011010100\n1\n0\n", "output": "000111111\n0000\n0011111\n0\n0\n"}, {"input": "5\n10\n0010111111\n4\n1111\n8\n01011111\n10\n1011010100\n1\n0\n", "output": "000111111\n1111\n0011111\n0\n0\n"}, {"input": "5\n10\n0010111111\n4\n0001\n8\n11011111\n10\n1011010100\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\nLet's imagine we have a popular online RPG. A player begins with a score of 0 in class E5. A1 is the highest ... | [{"input": "332532105", "output": "[\"Well done! You have advanced to the qualifying stage. Win 2 out of your next 3 games to rank up.\"]", "fn_name": "playerRankUp"}, {"input": "100", "output": "[\"Well done! You have advanced to the qualifying stage. Win 2 out of your next 3 games to rank up.\"]", "fn_name": "playerR... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a house with 4 levels.\nIn that house there is an elevator.\nYou can program this elevator to go up ... | [{"input": "\"length\"\n\"length\"", "output": "[0]", "fn_name": "goto"}, {"input": "null\n\"2\"", "output": "[0]", "fn_name": "goto"}, {"input": "\"2\"\n\"3\"", "output": "[0]", "fn_name": "goto"}, {"input": "1.5\n\"3\"", "output": "[0]", "fn_name": "goto"}, {"input": "1\n\"0\"", "output": "[-1]", "fn_name": "goto"}, ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWith a friend we used to play the following game on a chessboard\n(8, rows, 8 columns).\nOn the first row at ... | [{"input": "3000001", "output": "[[9000006000001, 2]]", "fn_name": "game"}, {"input": "750001", "output": "[[562501500001, 2]]", "fn_name": "game"}, {"input": "3000000", "output": "[[4500000000000]]", "fn_name": "game"}, {"input": "750000", "output": "[[281250000000]]", "fn_name": "game"}, {"input": "120000", "output":... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIt is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a town in Zabaikalsky region)... | [{"input": "20\n804301132 586588704 822785255 552472140 16115810 148658854 66743034 628305150 677780684 931815125 208050516 401554301 954478790 571480982 387546138 832279893 641889899 80960260 717802881 172455365\n61699500 83254572 29028223 27833657 55743179 118122387 94729965 147554867 62937826 3626886 131711239 36649... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn African crossword is a rectangular table n Γ m in size. Each cell of the table contains exactly one letter... | [{"input": "14 27\npzoshpvvjdpmwfoeojapmkxjrnk\nitoojpcorxjdxrwyewtmmlhjxhx\ndoyopbwusgsmephixzcilxpskxh\nygpvepeuxjbnezdrnjfwdhjwjka\nrfjlbypoalbtjwrpjxzenmeipfg\nkhjhrtktcnajrnbefhpavxxfnlx\nvwlwumqpfegjgvoezevqsolaqih\npdrvrtzqsoujqfeitkqgtxwckrl\nxtepjflcxcrfomhqimhimnzfxzg\nwhkfkfvvjkwmwhfgeovwowshyhw\nolchgmhiehu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDid you know that Chwee kueh, a cuisine of Singapore, means water rice cake ? Its a variety of the most popul... | [{"input": "3\n4\n1 4 2 3\n2\n1 2\n10\n1 0 3 4 1 6 7", "output": "-1\n-1\n-1\n"}, {"input": "3\n4\n1 4 2 3\n2\n1 2\n10\n1 0 3 1 1 6 7", "output": "-1\n-1\n-1\n"}, {"input": "3\n4\n1 4 1 3\n2\n1 2\n7\n1 -1 3 4 6 6 7", "output": "-1\n-1\n-1\n"}, {"input": "3\n4\n1 4 2 3\n2\n1 2\n10\n1 1 3 4 1 6 7", "output": "-1\n-1\n-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\nYou are given $n$ chips on a number line. The $i$-th chip is placed at the integer coordinate $x_i$. Some chi... | [{"input": "66\n17474 17509 20550 10873 31311 10156 24680 28012 29609 8266 18126 20151 648 2722 13599 9467 8289 17005 1 31436 21443 265 21543 32682 11647 30228 15498 1331 8459 20026 24054 23702 15400 7243 3017 10315 451 22673 6648 30210 27673 27232 4178 13529 23071 28654 8969 23505 27681 14437 5230 21635 5033 9271 2559... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Little Elephant from the Zoo of Lviv has an array A that consists of N positive integers. Let A[i] be the... | [{"input": "2\n3\n3 4 16\n3\n1 10 6", "output": "-1\n-1\n"}, {"input": "2\n1\n1 4 6\n1\n1 13 10", "output": "-1\n-1\n"}, {"input": "2\n2\n2 3 8\n3\n0 0 11", "output": "-1\n11\n"}, {"input": "2\n3\n10 5 0\n3\n4 38 3", "output": "5\n-1\n"}, {"input": "2\n1\n2 4 12\n3\n1 12 5", "output": "2\n-1\n"}, {"input": "2\n2\n2 4 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\nCompare given two sequence $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$ and $B = \\\\{b_0, b_1, ..., b_{m-1}$ lexic... | [{"input": "4\n0 4 12 1\n5\n1 2 5 4 1", "output": "1\n"}, {"input": "4\n1 4 1 1\n2\n-1 4 5 4 2", "output": "0\n"}, {"input": "4\n1 4 1 1\n2\n-1 4 9 4 2", "output": "0\n"}, {"input": "4\n1 4 1 1\n2\n-2 4 9 4 2", "output": "0\n"}, {"input": "4\n1 4 1 1\n2\n-4 4 9 4 2", "output": "0\n"}, {"input": "4\n1 4 1 1\n2\n-4 8 9 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\nWe have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i... | [{"input": "10 10\n6 5 -1 5 2 0 7 13 14 2\n5 6\n2 4\n6 7\n2 2\n7 8\n7 9\n2 8\n6 9\n8 10\n6 8", "output": "2\n2\n2\n1\n2\n3\n6\n4\n3\n3\n"}, {"input": "10 10\n6 5 -1 5 2 0 7 13 14 2\n5 6\n2 4\n6 7\n2 2\n7 8\n7 9\n2 8\n6 5\n8 10\n6 8", "output": "2\n2\n2\n1\n2\n3\n6\n0\n3\n3\n"}, {"input": "10 10\n6 5 -1 5 2 0 7 13 14 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\nVasya is preparing a contest, and now he has written a statement for an easy problem. The statement is a stri... | [{"input": "25\ndadddhrdhradrdzzzahazaddr\n582987584 321035417 414785252 587245865 701672370 65936511 563890835 134108386 387506178 22811155 989335244 1206131752 445085282 809768866 105799145 196558041 1131981383 134067229 875977231 488184174 41982468 225574390 702881847 937432062 185455403\n", "output": "445085282\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\nEveryone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequent... | [{"input": "\"FOR THIS REASON IT IS RECOMMENDED THAT PASSPHRASES NOT BE REUSED ACROSS DIFFERENT OR UNIQUE SITES AND SERVICES.\"\n15", "output": "[\".hTrXkGtH ScP HtIxH TjFxCj gD IcTgTuUxS HhDgRp sThJtG Tq iDc hThPgWeHhPe iPwI StScTbBdRtG Hx iX CdHpTg hXwI GdU\"]", "fn_name": "play_pass"}, {"input": "\"TO BE HONEST WITH... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLesha plays the recently published new version of the legendary game hacknet. In this version character skill... | [{"input": "1 1000000000 1000 1000 1000000000000000\n1000000000\n", "output": "1000000001000\n1000000000 \n"}, {"input": "1 1000001000 1000 1000 1000000000000000\n1000000000\n", "output": "1000001001000\n1000001000\n"}, {"input": "1 1000000000 1000 1000 1000000000000010\n1000000000\n", "output": "1000000001000\n1000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe \"Bulls and Cows\" game needs two people to play. The thinker thinks of a number and the guesser tries to... | [{"input": "10\n0132 0 1\n6801 0 1\n8749 1 1\n8036 0 0\n7384 0 2\n8594 0 1\n9307 1 0\n7390 0 1\n6127 1 1\n0381 0 1\n", "output": "Incorrect data\n"}, {"input": "10\n8795 0 3\n4971 1 1\n5032 0 1\n5479 0 3\n2501 0 1\n9052 1 1\n3649 0 1\n1927 1 0\n9173 0 1\n8014 0 2\n", "output": "Incorrect data\n"}, {"input": "10\n9360 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\nWe say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime.\nYou are given Q queries.\nI... | [{"input": "6\n1 53\n7 129\n37 55\n19 51\n103 169\n13 33", "output": "4\n4\n1\n1\n1\n1\n"}, {"input": "6\n1 53\n7 129\n65 55\n19 51\n17 169\n13 49", "output": "4\n4\n-1\n1\n4\n2\n"}, {"input": "6\n1 53\n13 91\n37 55\n19 51\n73 91\n13 49\n", "output": "4\n4\n1\n1\n1\n2\n"}, {"input": "6\n1 53\n7 119\n37 55\n19 83\n73 39... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi likes the sound when he buys a drink from a vending machine.\nThat sound can be heard by spending A... | [{"input": "100 100 100\n", "output": "1\n"}, {"input": "1 100 100\n", "output": "100\n"}, {"input": "011 -1 106", "output": "-1\n"}, {"input": "001 -1 106", "output": "-1\n"}, {"input": "101 -1 106", "output": "-1\n"}, {"input": "1 100 99\n", "output": "99\n"}, {"input": "111 -1 33", "output": "-1\n"}, {"input": "001 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nXenia the beginner mathematician is a third year student at elementary school. She is now learning the additi... | [{"input": "2+3+3+1+2+2+2+1+1+2+1+3+2+2+3+3+2+2+3+3+3+1+1+1+3+3+3+2+1+3+2+3+2+1+1+3+3+3+1+2+2+1+2+2+1+2+1+3+1+1\n", "output": "1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3\n"}, {"input": "2+1+2+2+1+3+2+3+1+1+2+1+2+2+3+1+1+3+3+3+2+2+3+2+2+2+1+2+1+2+3+2+2+2+1+3+1+3+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\nThe development of algae in a pond is as follows.\nLet the total weight of the algae at the beginning of the ... | [{"input": "28 -2 -1", "output": "-26\n-726\n-20326\n-569126\n-15935526\n-446194726\n-12493452326\n-349816665126\n-9794866623526\n-274256265458726\n"}, {"input": "17 -2 -1", "output": "-15\n-253\n-4299\n-73081\n-1242375\n-21120373\n-359046339\n-6103787761\n-103764391935\n-1763994662893\n"}, {"input": "13 0 -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\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, a... | [{"input": "1000\n", "output": "ABC\n"}, {"input": "2000\n", "output": "ARC\n"}, {"input": "0000", "output": "ABC\n"}, {"input": "2936", "output": "ARC\n"}, {"input": "0100", "output": "ABC\n"}, {"input": "1432", "output": "ARC\n"}, {"input": "1100", "output": "ABC\n"}, {"input": "1101", "output": "ABC\n"}, {"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\nA checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the p... | [{"input": "\"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"", "output": "[848640]", "fn_name": "quicksum"}, ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe GCD table G of size n Γ n for an array of positive integers a of length n is defined by formula \n\n<imag... | [{"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 "}, {"input": "5\n2029 6087 2029 2029 6087 2029 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA new school year is approaching, which also means students will be taking tests. \n\nThe tests in this kata ... | [{"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 0]\n6\n0\n1.5", "output": "[87]", "fn_name": "score_test"}, {"input": "[0, 1, 2, 0, 0, 2, 0, 1, 2, 1, 0, 0, 1, 0, 2, 1, 0, 2, 2, 0]\n9\n3\n2", "output": "[84]", "fn_name": "score_test"}, {"input": "[0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 2, ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a rectangular grid of size $n \\times m$. Each cell has a number written on it; the number on the ce... | [{"input": "10 10 524287\n1 2 4 8 16 32 64 128 256 512\n2 4 8 16 32 64 128 256 512 1024\n4 8 16 32 64 128 256 512 1024 2048\n8 16 32 64 128 256 512 1024 2048 4096\n16 32 64 128 256 512 1024 2048 4096 8192\n32 64 128 256 512 1024 2048 4096 8192 16384\n64 128 256 512 1024 2048 4096 8192 16384 32768\n128 256 512 1024 2048... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA subsequence of a string S is a string that can be obtained by deleting zero or more characters from S witho... | [{"input": "frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpnclfkpervxmdbvrbrdn\n", "output": "aca\n"}, {"input": "frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhzktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnf... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nΒ«One dragon. Two dragon. Three dragonΒ», β the princess was counting. She had trouble falling asleep, and she ... | [{"input": "10\n10\n10\n10\n100000\n", "output": "10000\n"}, {"input": "10\n10\n10\n4\n100000\n", "output": "30000\n"}, {"input": "10\n10\n16\n4\n100000\n", "output": "30000\n"}, {"input": "1\n1\n1\n1\n100000\n", "output": "100000\n"}, {"input": "9\n7\n10\n10\n42357\n", "output": "13312\n"}, {"input": "9\n7\n11\n10\n42... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe `depth` of an integer `n` is defined to be how many multiples of `n` it is necessary to compute before al... | [{"input": "25", "output": "[36]", "fn_name": "compute_depth"}, {"input": "8", "output": "[12]", "fn_name": "compute_depth"}, {"input": "13", "output": "[8]", "fn_name": "compute_depth"}, {"input": "7", "output": "[10]", "fn_name": "compute_depth"}, {"input": "42", "output": "[9]", "fn_name": "compute_depth"}, {"input"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMr Keks is a typical white-collar in Byteland.\n\nHe has a bookshelf in his office with some books on it, eac... | [{"input": "30 4\n893642632982367 772277951746295 510759449350295 826812150840579 1060893142351815 525992742241552 154832018679993 645715002371268 27232975419720 475004229372388 200177708355593 810661468479466 49618609534806 301608930846726 97042172725806 441637617418914 594900693592862 626510702147446 653604971179679 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn one school with Vasya there is a student Kostya. Kostya does not like physics, he likes different online g... | [{"input": "3 3 2 5\ndesolator\nrefresher\nperseverance\nvanguard: desolator 1, refresher 1\nmaelstorm: perseverance 2\n1 desolator\n2 perseverance\n1 refresher\n2 desolator\n2 perseverance\n", "output": "1\nvanguard 1\n2\ndesolator 1\nmaelstorm 1\n0\n"}, {"input": "2 3 2 5\ndesolator\nrefresher\nperseverance\nvanguard... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPrime numbers are widely applied for cryptographic and communication technology. A twin prime is a prime numb... | [{"input": "12\n110\n200\n300\n0", "output": "5 7\n107 109\n197 199\n281 283\n"}, {"input": "12\n110\n200\n227\n0", "output": "5 7\n107 109\n197 199\n197 199\n"}, {"input": "12\n110\n200\n329\n0", "output": "5 7\n107 109\n197 199\n311 313\n"}, {"input": "12\n110\n200\n239\n0", "output": "5 7\n107 109\n197 199\n227 229\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDO YOU EXPECT ME TO FIND THIS OUT?\n\nWHAT BASE AND/XOR LANGUAGE INCLUDES string?\n\nDON'T BYTE OF MORE THAN ... | [{"input": "10\n5 5 10 10 10 2 4 3 4 10\n", "output": "0\n"}, {"input": "10\n5 5 10 10 10 2 4 3 4 10\n", "output": "0\n"}, {"input": "10\n5 5 10 10 10 1 4 3 4 10\n", "output": "0\n"}, {"input": "10\n3 5 10 10 10 1 4 3 4 10\n", "output": "0\n"}, {"input": "10\n3 5 10 10 10 1 4 3 5 10\n", "output": "0\n"}, {"input": "10\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn this Kata, you will implement the [Luhn Algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm), which is ... | [{"input": "4111111111111111", "output": "[true]", "fn_name": "validate"}, {"input": "2626262626262626", "output": "[true]", "fn_name": "validate"}, {"input": "8675309", "output": "[false]", "fn_name": "validate"}, {"input": "922030", "output": "[false]", "fn_name": "validate"}, {"input": "912030", "output": "[true]", ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSmith wakes up at the side of a dirty, disused bathroom, his ankle chained to pipes. Next to him is tape-play... | [{"input": "15 6\naaa\naaabbb\naaabb\naaaaa\naaaaaa\naaaa\naaabbbb\naaaaa\naaaaaa\naaaa\naaabbbb\naabbbb\naa\naa\naab\na\n?a?\n??\n?aa?bb?\n?aa?aa?\n??aaa?\n", "output": "0\n4\n2\n5\n6\n7\n"}, {"input": "15 6\naaa\naaabbb\naaabb\naaaaa\naaaaaa\naaaa\naaabbbb\naaaaa\naaaaaa\naaaa\naaabbbb\naabbbc\naa\naa\naab\na\n?a?\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\nWe define the \"unfairness\" of a list/array as the *minimal* difference between max(x1,x2,...xk) and min(x1,... | [{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n10", "output": "[0]", "fn_name": "min_unfairness"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]\n10", "output": "[1]", "fn_name": "min_unfairness"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]\n9", "output": "[0]", "fn_name... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there ... | [{"input": "3\n3 1000 1000 1000\n6 1000 1000 1000 1000 1000 1010\n5 1000 1000 1000 1000 1000\n", "output": "7000 7010\n"}, {"input": "3\n3 1000 1000 1000\n6 1000 1000 1000 1000 1000 1010\n5 1000 1000 0000 1000 1000\n", "output": "7000 6010\n"}, {"input": "3\n3 1000 1000 1000\n6 1000 1000 1000 1000 1000 1011\n5 1000 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\nYou are given two arrays $a$ and $b$ both consisting of $n$ positive (greater than zero) integers. You are al... | [{"input": "5\n2 1\n1 2\n3 4\n5 5\n5 5 6 11 5\n1 2 5 4 3\n5 3\n1 2 3 4 5\n10 9 10 10 9\n4 0\n2 2 4 3\n2 4 2 3\n4 4\n1 2 2 1\n4 4 5 4\n", "output": "6\n32\n39\n11\n17\n"}, {"input": "5\n2 1\n1 2\n3 4\n5 5\n5 10 6 6 5\n1 2 5 4 3\n5 5\n1 2 3 4 5\n10 9 10 10 9\n4 0\n2 2 4 3\n2 4 2 0\n4 4\n1 2 0 1\n4 4 5 4\n", "output": "6\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMake a program that filters a list of strings and returns a list with only your friends name in it.\n\nIf a n... | [{"input": "[\"Jimm\", \"Cari\", \"aret\", \"truehdnviegkwgvke\", \"sixtyiscooooool\"]", "output": "[[\"Jimm\", \"Cari\", \"aret\"]]", "fn_name": "friend"}, {"input": "[\"This\", \"IS\", \"enough\", \"TEst\", \"CaSe\"]", "output": "[[\"This\", \"TEst\", \"CaSe\"]]", "fn_name": "friend"}, {"input": "[\"Hell\", \"Is\", \... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLeha like all kinds of strange things. Recently he liked the function F(n, k). Consider all possible k-elemen... | [{"input": "7\n4 12 5 15 8 2 5\n2 1 2 0 1 1 1\n", "output": "4 12 2 15 8 5 5\n"}, {"input": "7\n4 12 5 8 10 2 3\n2 1 2 1 1 1 2\n", "output": "4 12 3 10 8 5 2\n"}, {"input": "7\n4 12 5 8 10 2 3\n2 2 2 1 1 1 2\n", "output": "5 4 3 12 10 8 2\n"}, {"input": "7\n4 12 5 15 8 2 5\n2 1 2 1 1 1 2\n", "output": "5 15 4 12 8 5 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\nThis is the hard version of the problem. The only difference is that in this version $n \\leq 200000$. You ca... | [{"input": "12\n-3 -3 -7 -1 -1 -7 4 2 -4 -1 0 -11\n", "output": "5\n"}, {"input": "12\n-3 -3 -5 -1 -1 -7 4 2 -4 -1 0 -11\n", "output": "5\n"}, {"input": "12\n-1 -3 -5 -1 -1 -7 4 2 -4 -1 0 -11\n", "output": "5\n"}, {"input": "12\n-1 -3 -5 -1 -1 -7 4 2 -5 -1 0 -11\n", "output": "5\n"}, {"input": "12\n-1 -3 -5 -1 -1 -7 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\nWrite a program which computes the digit number of sum of two integers a and b.\n\nConstraints\n\n* 0 β€ a, b ... | [{"input": "-2 -1\n2 -15\n0110 -1", "output": "2\n3\n3\n"}, {"input": "10 10\n2 36\n1000 25", "output": "2\n2\n4\n"}, {"input": "-1 -1\n0 -1\n0111 14", "output": "2\n2\n3\n"}, {"input": "-2 -1\n0 -1\n0011 14", "output": "2\n2\n2\n"}, {"input": "2 -1\n-6 1\n1001 -14", "output": "1\n2\n3\n"}, {"input": "6 7\n1 99\n1000 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\nTakahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible.\nWhen all the cra... | [{"input": "100 100\n", "output": "0\n"}, {"input": "100 10\n", "output": "0\n"}, {"input": "111 136", "output": "1\n"}, {"input": "110 112", "output": "1\n"}, {"input": "011 127", "output": "1\n"}, {"input": "99 33\n", "output": "0\n"}, {"input": "100 1\n", "output": "0\n"}, {"input": "99 49\n", "output": "1\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer K. Print the string obtained by repeating the string `ACL` K times and concatenating... | [{"input": "451", "output": "ACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACLACL... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one ... | [{"input": "10\n3\n-14 -33 142\n16\n45 -84 35 85 69 -64 93 -70 0 -102 2 -52 -55 38 33 -98\n2\n5 0\n4\n-65 -113 5 6\n5\n82 -66 113 -81 -35\n5\n-125 107 -1 2 -10\n1\n25\n1\n-19\n1\n-8\n12\n32 41 43 -157 57 8 -86 111 -25 96 28 -44\n", "output": "NO\nNO\nNO\nNO\nNO\nNO\nYES\nYES\nYES\nNO\n"}, {"input": "10\n3\n-14 -33 142\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA tatami mat, a Japanese traditional floor cover, has a rectangular form with aspect ratio 1:2. When spreadin... | [{"input": "6 12\n2 18\n0 0", "output": "4\n872\n"}, {"input": "5 18\n18 4\n0 0", "output": "10\n25\n"}, {"input": "14 14\n8 3\n0 0", "output": "2\n10\n"}, {"input": "8 10\n18 4\n0 0", "output": "1\n25\n"}, {"input": "8 9\n18 3\n0 0", "output": "2\n110\n"}, {"input": "7 2\n18 4\n0 0", "output": "13\n25\n"}, {"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\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes con... | [{"input": "4 4\n1 1\n-1 3\n4 0\n3 4", "output": "1\n"}, {"input": "7 4\n-1 2\n1 3\n7 0\n0 0", "output": "1\n"}, {"input": "7 4\n-1 2\n1 6\n7 0\n0 0", "output": "1\n"}, {"input": "10 4\n1 2\n2 3\n4 0\n0 0", "output": "2\n"}, {"input": "4 4\n1 2\n-1 3\n4 0\n3 4", "output": "1\n"}, {"input": "7 4\n-1 0\n1 6\n7 0\n0 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\nBrave Ponta and his best friend, Brave Gonta, have come to Luida's bar in search of friends to embark on an e... | [{"input": "5\n1 4 3 2 20\n19\n1 3 4 10\n0", "output": "10\n2\n"}, {"input": "5\n1 4 3 2 20\n19\n2 3 4 10\n0", "output": "10\n1\n"}, {"input": "5\n2 0 3 4 20\n29\n1 3 4 10\n0", "output": "11\n2\n"}, {"input": "5\n2 0 3 4 20\n29\n1 6 4 10\n0", "output": "11\n1\n"}, {"input": "5\n2 0 3 4 20\n29\n1 6 4 16\n0", "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\nAs meticulous Gerald sets the table, Alexander finished another post on Codeforces and begins to respond to N... | [{"input": "10\n5 1 6 2 8 3 4 10 9 7\n3 1 10 6 8 5 2 7 9 4\n2 9 1 4 10 6 8 7 3 5\n10 1 7 8 3 2 4 6 5 9\n3 2 10 4 7 8 5 6 1 9\n5 6 3 10 8 7 2 9 4 1\n6 5 1 3 2 7 9 10 8 4\n1 10 9 3 7 8 4 2 6 5\n6 8 4 5 9 1 2 10 7 3\n9 6 8 5 10 3 1 7 2 4\n5 7 4 8 9 6 1 10 3 2\n", "output": "5 1 1 1 4 5 5 1 4 5 \n"}, {"input": "10\n5 1 6 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\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many way... | [{"input": "30\n40\n50\n6000\n", "output": "213\n"}, {"input": "30\n40\n77\n6000", "output": "293\n"}, {"input": "30\n47\n77\n6000", "output": "319\n"}, {"input": "30\n112\n134\n6415", "output": "0\n"}, {"input": "30\n112\n134\n8208", "output": "0\n"}, {"input": "30\n112\n134\n3602", "output": "0\n"}, {"input": "30\n16... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky ... | [{"input": "4\n47\n47\n477\n4747477", "output": "2\n2\n3\n23\n"}, {"input": "4\n44\n74\n477\n4747477", "output": "3\n2\n3\n23\n"}, {"input": "4\n47\n44\n477\n4747477", "output": "2\n3\n3\n23\n"}, {"input": "4\n44\n44\n477\n4747477", "output": "3\n3\n3\n23\n"}, {"input": "4\n74\n47\n477\n4747477", "output": "2\n2\n3\n23... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ cities numbered from $1$ to $n$, and city $i$ has beauty $a_i$.\n\nA salesman wants to start at... | [{"input": "30\n13 1\n111 5\n50 5\n61 0\n76 98\n110 1\n17 1\n4 17\n72 28\n75 90\n16 0\n13 12\n57 0\n47 12\n34 13\n61 120\n3 1\n134 100\n89 94\n88 10\n42 3\n93 33\n6 5\n81 48\n31 17\n32 0\n11 5\n69 1\n58 1\n3 21\n", "output": "750\n"}, {"input": "30\n13 1\n59 5\n50 5\n61 0\n76 98\n110 1\n17 1\n4 17\n72 28\n75 90\n16 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\nExample\n\nInput\n\n5 3\n4\n2\n5\n\n\nOutput\n\n5\n2\n4\n1\n3### Format: Read the inputs from stdin solve the... | [{"input": "92 1\n1\n-2\n2", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\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\nThere are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step ev... | [{"input": "100\n61 96 25 10 50 71 38 77 76 75 59 100 89 66 6 99 2 13 3 23 91 93 22 92 4 86 90 44 39 31 9 47 28 95 18 54 1 73 94 78 60 20 42 84 97 83 16 81 67 64 74 46 82 5 88 80 14 48 53 79 30 11 62 21 41 70 63 58 51 56 57 17 87 72 27 85 68 49 52 8 12 98 43 37 35 69 55 32 26 40 29 65 19 24 34 33 15 45 36 7\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a tree consisting exactly of $n$ vertices. Tree is a connected undirected graph with $n-1$ edge... | [{"input": "8\n9 4 1 7 10 1 1 10\n1 2\n2 3\n1 4\n1 5\n5 6\n5 7\n5 8\n", "output": "121\n"}, {"input": "8\n9 4 1 8 10 1 1 10\n1 2\n2 3\n1 4\n1 5\n5 6\n5 7\n5 8\n", "output": "124\n"}, {"input": "8\n9 3 1 8 10 1 1 10\n1 2\n2 3\n1 4\n1 5\n5 6\n5 7\n5 8\n", "output": "123\n"}, {"input": "8\n9 4 1 7 10 1 6 5\n1 2\n2 3\n1 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\nDima worked all day and wrote down on a long paper strip his favorite number $n$ consisting of $l$ digits. Un... | [{"input": "100\n8820100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026601\n", "output": "88201000000000000000000000000000000000000000000000000000000000000000000000000000000000000026601\n"}, {"input": "100\n8820100000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal... | [{"input": "23\n-1 1\n-1 2\n-2 4\n-7 -8\n-3 3\n-9 -14\n-5 3\n-6 2\n-7 11\n-4 4\n-8 5\n1 1\n-1 -1\n-1 -2\n-2 -4\n-7 8\n-3 -3\n-9 14\n-5 -3\n-6 -2\n-7 -11\n-4 -4\n-8 -5\n", "output": "Yes\n"}, {"input": "23\n-1 1\n-1 2\n-2 4\n-7 -8\n-3 3\n-9 -14\n-5 3\n-6 2\n-7 11\n-4 4\n-8 5\n1 1\n-1 -1\n-1 -2\n-2 -4\n-7 8\n-3 -3\n-9 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\nCatherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she sta... | [{"input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 44 23 24 25 26 27 28 29 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 41 56 57 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 115 86 87 88 89 90 91 92 93 94 95 133 97 98 99 100\n", "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\nWe'll call an array of n non-negative integers a[1], a[2], ..., a[n] interesting, if it meets m constraints. ... | [{"input": "3 2\n1 2 536870912\n2 3 536870911\n", "output": "YES\n536870912 1073741823 536870911 "}, {"input": "3 2\n1 2 193688642\n2 3 942984520\n", "output": "YES\n193688642 1002437962 942984520\n"}, {"input": "3 2\n1 2 536870912\n2 3 942984520\n", "output": "YES\n536870912 942984520 942984520\n"}, {"input": "3 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\nRead problems statements in Mandarin Chinese and Russian. \nA new school in Byteland is now in the process... | [{"input": "2\n8\n29", "output": "255\n536870911\n"}, {"input": "2\n8\n49", "output": "255\n949480668\n"}, {"input": "2\n21\n9", "output": "2097151\n511\n"}, {"input": "2\n4\n22", "output": "15\n4194303\n"}, {"input": "2\n0\n20", "output": "0\n1048575\n"}, {"input": "2\n8\n15", "output": "255\n32767\n"}, {"input": "2\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\nWrite a function `getDrinkByProfession`/`get_drink_by_profession()` that receives as input parameter a string... | [{"input": "\"scHOOl counselor\"", "output": "[\"Anything with Alcohol\"]", "fn_name": "get_drink_by_profession"}, {"input": "\"scHOOl COUnselor\"", "output": "[\"Anything with Alcohol\"]", "fn_name": "get_drink_by_profession"}, {"input": "\"prOgramMer\"", "output": "[\"Hipster Craft Beer\"]", "fn_name": "get_drink_by_... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA superhero fights with a monster. The battle consists of rounds, each of which lasts exactly $n$ minutes. Af... | [{"input": "1000000000000 10\n-10 5 -2 -2 -10 -7 -5 -9 -3 -4\n", "output": "212765957448\n"}, {"input": "1000000000000 10\n-10 9 -2 -2 -10 -7 -5 -9 -3 -4\n", "output": "232558139536\n"}, {"input": "1000000000000 10\n-14 9 -2 -2 -10 -7 -5 -9 -3 -4\n", "output": "212765957448\n"}, {"input": "1000000000000 10\n-6 5 -2 -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\nIkta, who hates to lose, has recently been enthusiastic about playing games using the Go board. However, neit... | [{"input": "...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n...............\n....../........\n...............\n...............\n...............\n...............\n...............\n......O........\n..... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.