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 mischievous notice has arrived from the primitive slow-life organization \"Akaruda\". Akaruda is famous for... | [{"input": "4\n03:05\n05:11\n11:54\n10:40", "output": "warning\nwarning\nwarning\nwarning\n"}, {"input": "4\n03:25\n10:61\n11:65\n10:41", "output": "warning\nwarning\nalert\nwarning\n"}, {"input": "4\n12:15\n10:50\n11:44\n10:40", "output": "warning\nalert\nwarning\nwarning\n"}, {"input": "4\n12:05\n00:50\n11:44\n10:40"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards. \nEach... | [{"input": "1 13\n", "output": "Alice\n"}, {"input": "11 11\n", "output": "Draw\n"}, {"input": "-1 -4", "output": "Alice\n"}, {"input": "-2 -3", "output": "Alice\n"}, {"input": "-2 -4", "output": "Alice\n"}, {"input": "-2 -6", "output": "Alice\n"}, {"input": "-2 -8", "output": "Alice\n"}, {"input": "8 6\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\nDuring a break in the buffet of the scientific lyceum of the Kingdom of Kremland, there was formed a queue of... | [{"input": "30\n61 23\n30 93\n4 18\n34 97\n63 77\n45 95\n51 13\n41 8\n86 19\n38 24\n2 67\n20 61\n95 48\n95 1\n28 26\n92 110\n6 78\n64 28\n1 82\n61 37\n77 35\n152 21\n10 24\n52 12\n80 63\n64 61\n16 87\n118 19\n21 34\n54 49\n", "output": "29529\n"}, {"input": "30\n61 23\n30 93\n4 18\n34 97\n63 77\n45 95\n51 13\n41 8\n86 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 that returns a sequence (index begins with 1) of all the even characters from a string. If t... | [{"input": "\"aiqbuwbjqwbckjdwbwkqbefhglqhfjbwqejbcadn.bcaw.jbhwefjbwqkvbweevkj.bwvwbhvjk.dsvbajdv.hwuvghwuvfhgw.vjhwncv.wecnaw.ecnvw.kejvhnw.evjkhweqv.kjhwqeev.kjbhdjk.vbaewkjva\"", "output": "[\"invalid string\"]", "fn_name": "even_chars"}, {"input": "\"abcdefghijklm\"", "output": "[[\"b\", \"d\", \"f\", \"h\", \"j\"... | 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\nB: Parentheses Number\n\nproblem\n\nDefine the correct parenthesis string as follows:\n\n* The empty string i... | [{"input": "2\n2 -107", "output": ":(\n"}, {"input": "2\n2 -187", "output": ":(\n"}, {"input": "2\n2 -155", "output": ":(\n"}, {"input": "2\n2 -142", "output": ":(\n"}, {"input": "2\n2 -100", "output": ":(\n"}, {"input": "2\n2 -125", "output": ":(\n"}, {"input": "2\n2 -149", "output": ":(\n"}, {"input": "2\n2 -131", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an integer $n$, find the maximum value of integer $k$ such that the following condition holds:\n\n$n$ &... | [{"input": "1\n168457447\n", "output": "134217727\n"}, {"input": "1\n276490162\n", "output": "268435455\n"}, {"input": "1\n109011159\n", "output": "67108863\n"}, {"input": "1\n99888383\n", "output": "67108863\n"}, {"input": "1\n99888383\n", "output": "67108863\n"}, {"input": "1\n95529231\n", "output": "67108863\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\nChef has just finished the construction of his new garden. He has sown the garden with patches of the most be... | [{"input": "3\n2 1\naa\nA`\n3 -1\naba\nbab\naab\n-1 1\naabb\nbaba\nbcaa\nbbaa", "output": "0\n0\n0\n"}, {"input": "3\n2 1\n`a\nA`\n3 -1\naba\nbab\naab\n-1 1\naabb\nbaba\nbcaa\nbbaa", "output": "0\n0\n0\n"}, {"input": "3\n2 1\na`\nA`\n3 -1\naba\nbab\naab\n-1 1\naabb\nbaba\nbcaa\nbbaa", "output": "0\n0\n0\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\nYou are given the array $a$ consisting of $n$ positive (greater than zero) integers.\n\nIn one move, you can ... | [{"input": "5\n2\n2 6\n4\n2 2 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"input": "5\n2\n2 6\n4\n2 0 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"input": "5\n2\n2 3\n4\n2 2 8 8\n3\n3 3 3\n4\n5 5 5 5\n4\n1 1 1 1\n", "output": "YES\nNO\nYES\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\nImagine that you are given two sticks. You want to end up with three sticks of equal length. You are allowed ... | [{"input": "5\n17", "output": "[5.666666666666667]", "fn_name": "maxlen"}, {"input": "17\n5", "output": "[5.666666666666667]", "fn_name": "maxlen"}, {"input": "7\n12", "output": "[6.0]", "fn_name": "maxlen"}, {"input": "12\n7", "output": "[6.0]", "fn_name": "maxlen"}, {"input": "5\n12", "output": "[5]", "fn_name": "max... | 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\nProblem Statement\n\nWe found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ru... | [{"input": "4\ncba\ncab\nb\na\n3\nbca\nab\na\n5\nabc\nacb\nb\nc\nc\n5\nabc\nacc\nd\nb\nb\n0", "output": "yes\nno\nyes\nyes\n"}, {"input": "4\nbba\nbab\nc\na\n3\ncba\nba\na\n5\ncba\nacb\nb\nc\nc\n5\nabc\nacc\nd\nb\nb\n0", "output": "yes\nyes\nno\nyes\n"}, {"input": "4\naac\ncab\nb\na\n3\nbca\nca\na\n5\nabc\nacb\nb\nb\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\nYou are given two huge binary integer numbers $a$ and $b$ of lengths $n$ and $m$ respectively. You will repea... | [{"input": "5 5\n11111\n11111\n", "output": "57\n"}, {"input": "5 5\n11111\n11111\n", "output": "57\n"}, {"input": "5 5\n11111\n10111\n", "output": "42\n"}, {"input": "5 5\n11011\n11111\n", "output": "45\n"}, {"input": "5 5\n11001\n11111\n", "output": "37\n"}, {"input": "5 5\n11011\n11110\n", "output": "44\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\nYou are given an array $a$ consisting of $n$ integer numbers.\n\nYou have to color this array in $k$ colors i... | [{"input": "50 20\n1 1 1 1 1 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 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\n", "output": "YES\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 \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\nGiven an array containing only zeros and ones, find the index of the zero that, if converted to one, will mak... | [{"input": "[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1]", "output": "[10]", "fn_name": "replace_zero"}, {"input": "[1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1]", "output": "[10]", "fn_name": "replace_zero"}, {"input": "[1, 1, 1, 0, 1, 1, 0, 1, 1, 1]", "output": "[6]", "fn_name": "replace_zero"}, {"input": "[1, 1,... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema t... | [{"input": "6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30", "output": "11"}, {"input": "4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8", "output": "3"}, {"input": "3\n2 3 7 9 5 4 8 6 1", "output": "0\n"}, {"input": "3\n1 3 7 9 5 8 4 6 2", "output": "1\n"}, {"input": "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\nIvar the Boneless is a great leader. He is trying to capture Kattegat from Lagertha. The war has begun and wa... | [{"input": "100 55\n1 2 4 4 3 5 5 2 3 1 2 2 1 2 4 5 0 5 4 2 5 4 5 3 3 5 4 4 4 5 5 2 3 3 4 4 3 4 5 5 5 5 3 5 1 2 4 3 4 5 3 3 2 0 4 5 3 4 4 1 9 1 5 2 0 1 4 0 3 3 1 4 2 5 4 5 3 2 5 5 2 3 2 3 2 2 3 4 4 4 1 4 2 4 5 3 1 3 3 1\n5 2 1 4 3 4 3 1 4 4 1 2 0 2 1 5 5 4 5 4 2 5 2 1 5 1 4 0 1 5 4 5 1 4 4 2 5 3 0 5 4 4 0 3 3 10 4 2 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\nCreate your own mechanical dartboard that gives back your score based on the coordinates of your dart.\n\nTas... | [{"input": "-133.69\n-147.38", "output": "[\"X\"]", "fn_name": "get_score"}, {"input": "-73.905\n-95.94", "output": "[\"7\"]", "fn_name": "get_score"}, {"input": "-145.19\n86.53", "output": "[\"D9\"]", "fn_name": "get_score"}, {"input": "-5.43\n117.95", "output": "[\"20\"]", "fn_name": "get_score"}, {"input": "55.53\n-... | 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\nCheaterius is a famous in all the Berland astrologist, magician and wizard, and he also is a liar and a cheat... | [{"input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n33\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "1\n"}, {"input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n38\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "2\n"}, {"input": "7\n21\n33\n**\n33\n12\n**\n63\n31\n**\n25\n38\n**\n33\n12\n**\n32\n62\n**\n13\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm shoul... | [{"input": "6\n3 1 -1 2 -1 -1", "output": "-1 -1 -1 1 2 3\n10\n"}, {"input": "6\n2 1 -1 11 -1 0", "output": "-1 -1 0 1 2 11\n9\n"}, {"input": "6\n3 1 -1 4 -1 -1", "output": "-1 -1 -1 1 3 4\n9\n"}, {"input": "6\n3 2 -1 4 -1 -1", "output": "-1 -1 -1 2 3 4\n9\n"}, {"input": "6\n4 1 -1 2 -1 0", "output": "-1 -1 0 1 2 4\n10... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first... | [{"input": "1987\n", "output": "2013\n"}, {"input": "2013\n", "output": "2014\n"}, {"input": "1000\n", "output": "1023\n"}, {"input": "1001\n", "output": "1023\n"}, {"input": "1234\n", "output": "1235\n"}, {"input": "5555\n", "output": "5601\n"}, {"input": "9000\n", "output": "9012\n"}, {"input": "1111\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\nproblem\n\nIn one programming contest, it is customary to play a bingo game at a social gathering after the c... | [{"input": "3 21 80\n3 100 60\n5 50 538\n0 0 0", "output": "3466\n157\n96557\n"}, {"input": "3 21 80\n3 100 60\n5 44 538\n0 0 0", "output": "3466\n157\n25088\n"}, {"input": "3 24 80\n3 000 69\n2 162 487\n0 1 1", "output": "4955\n0\n28431\n"}, {"input": "3 36 80\n3 000 69\n2 162 487\n0 1 1", "output": "6570\n0\n28431\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 have an analog clock whose three hands (the second hand, the minute hand and the hour hand) rotate quite s... | [{"input": "12 0 0 0\n12 11 59 59\n12 1 56 0\n12 1 56 3\n12 1 56 34\n12 3 9 43\n12 3 10 14\n12 2 17 58\n12 7 18 0\n10 7 23 0\n12 7 23 31\n2 0 38 19\n2 0 39 0\n2 0 39 30\n2 1 6 14\n2 1 20 1\n2 1 20 31\n3 2 19 0\n3 2 59 30\n4 0 28 48\n5 1 5 37\n5 1 10 10\n5 1 7 41\n11 0 36 0\n0 0 0 0", "output": "0 0 43200 1427\n0 0 4320... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 you've discovered a new shooter. They say it has realistic game mechanics.\n\nYour character has a g... | [{"input": "10 79\n2 2 70\n2 10 35\n10 10 76\n11 11 66\n12 12 75\n12 14 88\n15 16 76\n17 18 97\n19 20 105\n20 20 46\n", "output": "862\n"}, {"input": "10 79\n2 2 70\n2 10 35\n10 10 76\n11 11 66\n12 12 75\n12 14 88\n15 16 76\n17 18 97\n19 20 105\n20 20 46\n", "output": "862\n"}, {"input": "10 79\n2 2 70\n2 10 35\n10 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\nB: 階層的計算機 (Hierarchical Calculator)\n\nProblem\n\nEbi-chan has N formulae: y = a_i x for i =1, ..., N (inclus... | [{"input": "4\n-1 2 -2 2", "output": "4\n1\n2\n3\n4\n"}, {"input": "4\n2 -1 -2 -1", "output": "3\n1\n2\n3\n"}, {"input": "4\n2 -1 -2 1", "output": "3\n1\n2\n3\n"}, {"input": "4\n-1 -2 0 2", "output": "3\n1\n2\n4\n"}, {"input": "4\n1 2 -2 -1", "output": "3\n2\n3\n4\n"}, {"input": "4\n2 -1 -2 0", "output": "3\n1\n2\n3\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\nThere are $n$ points on a plane. The $i$-th point has coordinates $(x_i, y_i)$. You have two horizontal platf... | [{"input": "4\n7 1\n1 5 0 2 1 10 7\n1 3 6 7 2 5 4\n1 1\n1000000000\n1000001000\n5 10\n10 7 5 15 12\n38 199 192 219 1904\n10 10\n12 19 8 29 20 10 9 2 10 19\n12 4 0 17 1 15 7 18 14 3\n", "output": "4\n1\n5\n10\n"}, {"input": "4\n7 1\n1 5 0 2 1 10 7\n1 3 6 7 0 5 4\n1 1\n1000000000\n1000001000\n5 10\n10 7 5 15 12\n38 199 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\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; ... | [{"input": "3 3\n1 7\n3 2\n1 7\n", "output": "702\n"}, {"input": "3 3\n3 1\n2 1\n1 4\n", "output": "411\n"}, {"input": "3 1\n1 7\n3 2\n0 28", "output": "700\n"}, {"input": "2 3\n2 0\n2 0\n2 0\n", "output": "10\n"}, {"input": "3 3\n1 14\n3 2\n1 7", "output": "-1\n"}, {"input": "3 3\n1 7\n3 4\n1 7", "output": "704\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\nN problems are proposed for an upcoming contest. Problem i has an initial integer score of A_i points.\n\nM j... | [{"input": "10 14 8 5\n13 2 3 11 1 11 5 4 3 7", "output": "10\n"}, {"input": "10 14 8 5\n13 2 3 11 1 11 5 7 3 7", "output": "10\n"}, {"input": "10 14 8 5\n13 2 0 11 1 11 5 4 3 7", "output": "10\n"}, {"input": "10 14 8 9\n13 2 3 11 1 11 5 7 3 7", "output": "10\n"}, {"input": "10 14 8 5\n13 2 0 11 1 11 6 4 3 7", "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\nShaass has n books. He wants to make a bookshelf for all his books. He wants the bookshelf's dimensions to be... | [{"input": "100\n2 2\n1 2\n1 1\n2 1\n1 2\n2 1\n2 2\n2 1\n2 1\n1 2\n1 2\n2 1\n1 2\n2 1\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 1\n2 2\n2 1\n1 1\n1 2\n2 2\n1 1\n2 2\n1 2\n2 1\n2 2\n1 2\n2 2\n1 2\n1 1\n2 2\n2 2\n1 1\n1 2\n2 2\n1 2\n1 1\n1 1\n1 1\n2 1\n2 1\n1 2\n1 2\n2 2\n1 2\n1 2\n1 1\n2 1\n2 1\n2 2\n1 2\n2 1\n1 1\n2 1\n1 2\n2 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\n2N players are running a competitive table tennis training on N tables numbered from 1 to N.\n\nThe training ... | [{"input": "2 -2 269", "output": "-131\n"}, {"input": "-1 2 189", "output": "-96\n"}, {"input": "11 -2 81", "output": "-28\n"}, {"input": "-1 4 189", "output": "-97\n"}, {"input": "0 4 249", "output": "-126\n"}, {"input": "0 -1 104", "output": "-51\n"}, {"input": "0 -1 172", "output": "-85\n"}, {"input": "0 0 459", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every a and b ... | [{"input": "7 21\n3 5\n7 2\n2 3\n6 5\n5 2\n4 7\n2 6\n2 4\n6 7\n5 1\n1 4\n4 5\n5 7\n4 6\n3 1\n1 2\n3 4\n7 1\n3 7\n6 1\n3 6\n", "output": "16\n"}, {"input": "7 21\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n4 5\n4 6\n4 7\n5 6\n5 7\n6 7\n", "output": "16\n"}, {"input": "7 20\n4 7\n1 4\n2 3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarpus loves lucky numbers. Everybody knows that lucky numbers are positive integers, whose decimal repre... | [{"input": "1000000000\n", "output": "40744\n"}, {"input": "1000000000\n", "output": "40744\n"}, {"input": "999999999\n", "output": "40743\n"}, {"input": "999999998\n", "output": "40742\n"}, {"input": "999999997\n", "output": "40741\n"}, {"input": "909090901\n", "output": "38532\n"}, {"input": "142498040\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\nFor a given array whose element values are randomly picked from single-digit integers `0` to `9`, return an a... | [{"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[[0, 0, 0, 0, 0, 0, 0]]", "fn_name": "pair_zeros"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", "output": "[[0, 0, 0, 0, 0, 0]]", "fn_name": "pair_zeros"}, {"input": "[1, 0, 1, 0, 2, 0, 0, 3, 0]", "output": "[[1, 0, 1, 2, 0, 3, 0]]", "fn_name": "pai... | 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 aim of the kata is to decompose `n!` (factorial n) into its prime factors.\n\nExamples:\n```\nn = 12; dec... | [{"input": "3989", "output": "[\"2^3981 * 3^1990 * 5^994 * 7^662 * 11^396 * 13^330 * 17^247 * 19^220 * 23^180 * 29^141 * 31^132 * 37^109 * 41^99 * 43^94 * 47^85 * 53^76 * 59^68 * 61^66 * 67^59 * 71^56 * 73^54 * 79^50 * 83^48 * 89^44 * 97^41 * 101^39 * 103^38 * 107^37 * 109^36 * 113^35 * 127^31 * 131^30 * 137^29 * 139^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\nAfter learning a lot about space exploration, a little girl named Ana wants to change the subject.\n\nAna is ... | [{"input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\n"}, {"input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\n"}, {"input": "20\nhw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\np... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 task Anna and Maria play a game with a very unpleasant rival. Anna and Maria are in the opposite squa... | [{"input": "S..SSS.A\nS.S.SSSS\nSSSSSSSS\n...SS...\nS.SSSSSS\nSS..SS.S\nSS..S.S.\nMSS..SSS\n", "output": "LOSE\n"}, {"input": ".SSSSSSA\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\nSSSSSSS.\nMSSSSSSS\n", "output": "LOSE\n"}, {"input": ".SSSS.SA\n.SS.SSS.\n..S.SS..\nSSSS.SS.\nS.S.....\nS.S.SSSS\nS..SS..S\nMS.SS.TS... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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++++++++++>++++++++++++>+++++++... | [{"input": "1000000\n", "output": "2\n"}, {"input": "1000000\n", "output": "2\n"}, {"input": "1000010\n", "output": "3\n"}, {"input": "1229030\n", "output": "0\n"}, {"input": "1000011\n", "output": "3\n"}, {"input": "1160745\n", "output": "1\n"}, {"input": "1100011\n", "output": "1\n"}, {"input": "1333299\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\nInna likes sweets and a game called the \"Candy Matrix\". Today, she came up with the new game \"Candy Matrix... | [{"input": "10 10\nG********S\n*G*******S\n**G******S\n***G*****S\n****G****S\nS***G*****\n******G**S\n*******G*S\n********GS\nG********S\n", "output": "-1\n"}, {"input": "10 10\nG********S\n*G*******S\n**G******S\n***G*****S\n****S****G\nS***G*****\n******G**S\n*******G*S\n********GS\nG********S\n", "output": "-1\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a positive integer m and a non-negative integer s. Your task is to find the smallest and the largest... | [{"input": "101 298\n", "output": "10000000000000000000000000000000000000000000000000000000000000000000999999999999999999999999999999999 99999999999999999999999999999999910000000000000000000000000000000000000000000000000000000000000000000\n"}, {"input": "101 299\n", "output": "100000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVanya loves playing. He even has a special set of cards to play with. Each card has a single integer. The num... | [{"input": "123 222\n44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 -93 -106 122 -135 58 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\nConsider the infinite sequence $s$ of positive integers, created by repeating the following steps:\n\n Find ... | [{"input": "9\n2\n3\n3\n12\n13\n6\n7\n11\n9\n", "output": "2\n3\n3\n13\n7\n12\n5\n11\n15\n"}, {"input": "9\n2\n3\n3\n12\n10\n6\n3\n22\n6\n", "output": "2\n3\n3\n13\n6\n12\n3\n18\n12\n"}, {"input": "9\n1\n5\n3\n4\n18\n6\n12\n8\n9\n", "output": "1\n8\n3\n4\n48\n12\n13\n10\n15\n"}, {"input": "9\n1\n3\n3\n12\n10\n6\n3\n14\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a permutation P of \\{1, 2, \\ldots, N\\}.\nFor a pair (L, R) (1 \\le L \\lt R \\le N), let X_{L, R}... | [{"input": "95\n41 7 46 26 89 2 78 92 8 16 45 57 17 6 35 62 91 95 63 48 19 79 74 52 1 77 28 93 56 31 25 54 40 64 9 34 53 11 10 55 94 24 67 58 27 60 90 87 18 73 50 80 20 21 61 42 88 14 44 76 39 70 51 66 83 32 30 81 23 82 72 65 15 68 75 71 69 13 4 3 85 84 49 59 22 33 5 47 12 37 29 36 38 86 43\n", "output": "380173\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 are provided with array of positive non-zero ints and int n representing n-th power (n >= 2).\n\nFor the ... | [{"input": "[1, 2, 3, 4, 5]\n3", "output": "[210]", "fn_name": "modified_sum"}, {"input": "[2, 4, 6, 8]\n6", "output": "[312940]", "fn_name": "modified_sum"}, {"input": "[2, 7, 13, 17]\n2", "output": "[472]", "fn_name": "modified_sum"}, {"input": "[3, 6, 9, 12]\n3", "output": "[2670]", "fn_name": "modified_sum"}, {"inp... | 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\nVadim loves decorating the Christmas tree, so he got a beautiful garland as a present. It consists of $n$ lig... | [{"input": "100\n87 32 53 24 60 2 44 15 45 29 69 10 7 95 61 91 86 51 1 30 58 67 49 50 88 23 82 39 14 66 6 19 96 13 12 33 54 41 43 72 21 34 28 59 75 85 65 94 90 80 83 38 62 46 78 81 92 31 35 3 73 4 5 79 98 40 48 8 47 99 20 89 36 77 9 68 11 93 18 100 37 25 22 76 64 55 52 26 71 84 70 97 17 16 74 56 27 42 57 63\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\nBob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he wil... | [{"input": "1000 1000\n", "output": "708964705\n"}, {"input": "1000 1000\n", "output": "708964705\n"}, {"input": "1000 1001\n", "output": "419685057\n"}, {"input": "1000 122\n", "output": "712990290\n"}, {"input": "1000 122\n", "output": "712990290\n"}, {"input": "1000 0001\n", "output": "46452554\n"}, {"input": "432 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\nYou are given an angle $\\text{ang}$. \n\nThe Jury asks You to find such regular $n$-gon (regular polygon wit... | [{"input": "69\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999... | [{"input": "100 100\n", "output": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 55 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence of n integers S and a sequence of different q integers T. Write a program which outp... | [{"input": "5\n-1 -3 -1 4 0\n4\n1 2", "output": "0\n"}, {"input": "5\n-1 -3 -1 4 1\n4\n1 2", "output": "1\n"}, {"input": "5\n-1 -3 -1 4 0\n5\n1 2", "output": "0\n"}, {"input": "5\n-1 -3 -1 4 0\n5\n2 2", "output": "0\n"}, {"input": "5\n-2 -3 -1 4 0\n5\n2 2", "output": "0\n"}, {"input": "5\n1 2 3 4 1\n5\n2 4 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\nHelp a fruit packer sort out the bad apples. \n\nThere are 7 varieties of apples, all packaged as pairs and s... | [{"input": "[[3, 1], [0, 0], [4, 3], [2, 5], [1, 7], [6, 3], [7, 4], [5, 7], [7, 1], [4, 4], [1, 3], [2, 2], [6, 7], [2, 1], [3, 3]]", "output": "[[[3, 1], [4, 3], [2, 5], [1, 7], [6, 3], [7, 4], [5, 7], [7, 1], [4, 4], [1, 3], [2, 2], [6, 7], [2, 1], [3, 3]]]", "fn_name": "bad_apples"}, {"input": "[[0, 1], [7, 7], [7,... | 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\nYou are given a string $s$ of even length $n$. String $s$ is binary, in other words, consists only of 0's and... | [{"input": "3\n2\n10\n4\n0110\n8\n11101000\n", "output": "0\n1\n2\n"}, {"input": "3\n2\n10\n4\n0110\n8\n11100001\n", "output": "0\n1\n3\n"}, {"input": "3\n2\n10\n4\n1010\n8\n11101000\n", "output": "0\n0\n2\n"}, {"input": "3\n2\n10\n4\n0011\n8\n11101000\n", "output": "0\n1\n2\n"}, {"input": "3\n2\n10\n4\n0101\n8\n111000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 positive integers A and B. Compare the magnitudes of these numbers.\n\n-----Constraints----... | [{"input": "123456789012345678901234567890\n54295952540662239241952312402", "output": "GREATER\n"}, {"input": "123456789012345678901234567890\n67478580391614097833417622355", "output": "GREATER\n"}, {"input": "123456789012345678901234567890\n12740860331988085550751547536", "output": "GREATER\n"}, {"input": "12345678901... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function that takes a number as an argument and returns a grade based on that number.\n\nScore ... | [{"input": "1.01", "output": "[\"F\"]", "fn_name": "grader"}, {"input": "0.2", "output": "[\"F\"]", "fn_name": "grader"}, {"input": "0.7", "output": "[\"C\"]", "fn_name": "grader"}, {"input": "0.8", "output": "[\"B\"]", "fn_name": "grader"}, {"input": "0.9", "output": "[\"A\"]", "fn_name": "grader"}, {"input": "0.6", "... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJeff got 2n real numbers a_1, a_2, ..., a_2n as a birthday present. The boy hates non-integer numbers, so he ... | [{"input": "10\n8003.867 4368.000 2243.000 3340.287 5384.000 1036.456 3506.000 4463.000 1477.000 2420.314 9391.000 1696.000 5857.833 244.000 8220.000 5879.000 5424.482 2631.197 7111.000 9157.536\n", "output": "0.028\n"}, {"input": "10\n8003.867 4368.000 2243.298 3340.000 5384.489 1036.000 3506.115 4463.317 1477.000 242... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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've got no test cases. A big olympiad is coming up. But the problemsetters' number one priority should be a... | [{"input": "100 100\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... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\"The zombies are lurking outside. Waiting. Moaning. And when they come...\"\n\n\"When they come?\"\n\n\"I ho... | [{"input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...B...\nB.BB.B.\n", "output": "3\n"}, {"input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...-...\n...B...\nB.BB.B.\n", "output": "3\n"}, {"input": "10 7\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\nKevin and Nicky Sun have invented a new game called Lieges of Legendre. In this game, two players take turns ... | [{"input": "10 2\n3 10 10 8 11 10 9 9 5 7\n", "output": "Nicky\n"}, {"input": "10 2\n3 12 10 8 11 10 9 9 5 7\n", "output": "Nicky\n"}, {"input": "10 2\n3 10 10 8 6 10 9 9 5 7\n", "output": "Kevin\n"}, {"input": "10 2\n3 10 10 8 6 10 9 9 5 7\n", "output": "Kevin\n"}, {"input": "10 2\n3 12 10 8 11 2 9 9 5 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\nComplete the function that returns an array of length `n`, starting with the given number `x` and the squares... | [{"input": "10\n4", "output": "[[10, 100, 10000, 100000000]]", "fn_name": "squares"}, {"input": "2\n5", "output": "[[2, 4, 16, 256, 65536]]", "fn_name": "squares"}, {"input": "5\n3", "output": "[[5, 25, 625]]", "fn_name": "squares"}, {"input": "3\n3", "output": "[[3, 9, 81]]", "fn_name": "squares"}, {"input": "2\n-4", ... | 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\nCarousel Boutique is busy again! Rarity has decided to visit the pony ball and she surely needs a new dress, ... | [{"input": "5 5\nzbacg\nbaaac\naaaaa\neaaad\nweadd\n", "output": "31\n"}, {"input": "5 5\nzbacg\nbaaac\naaaaa\ndaaae\nweadd\n", "output": "31\n"}, {"input": "5 5\nzbacf\nbcaaa\naaaaa\neaaad\nveadd\n", "output": "28\n"}, {"input": "5 5\nabzcg\nbaaac\naaaaa\neaabd\nwdaed\n", "output": "27\n"}, {"input": "5 5\nzbcaf\nbcaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGreg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has ... | [{"input": "9\n0 85236 27579 82251 69479 24737 87917 15149 52311\n59640 0 74687 34711 3685 30121 4961 7552 83399\n33376 68733 0 81357 18042 74297 15466 29476 5865\n7493 5601 3321 0 20263 55901 58229 55361 87633\n26751 17161 76681 58775 0 39745 50717 56887 90055\n18885 76353 47089 43601 21561 0 60571 33551 53753\n103347... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSuppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a c... | [{"input": "5 5 3\n.....\n.....\n*...*\n*....\n.*...\n", "output": "18\n"}, {"input": "5 5 3\n.....\n.....\n*...*\n*....\n.*...\n", "output": "18\n"}, {"input": "5 5 3\n.....\n.....\n*...*\n*....\n...*.\n", "output": "18\n"}, {"input": "5 5 3\n.....\n.....\n*...*\n....*\n...*.\n", "output": "18\n"}, {"input": "5 5 3\n.... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Central Company has an office with a sophisticated security system. There are $10^6$ employees, numbered ... | [{"input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 384933 -384933 319281 407136 804861 -407136 415987 946658 -946658 -415987 -804861 -319281\n", "output": "3\n8 2 10 \n"}, {"input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 384933 -384933 319281 407136 804861 -407136 4159... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBooks are indexed. Write a program which reads a list of pairs of a word and a page number, and prints the wo... | [{"input": "ntzsd 22\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndmucod 2\nstyld 10\nmuee -2", "output": "eevn\n1\nmuee\n-2\nntzsd\n22\nnutrodnctioi\n-1\nse_z\n1\nstyld\n10\nstyle\n32\ntndmucod\n2\n"}, {"input": "ntzsd 10\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndmucod 2\nstyld 10\nmuee -2", "output": "eevn\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\nA country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer t... | [{"input": "6\n1001\n1277\n9999999999999999999999999999999999999999\n8\n406457296153147731569431812193957336633213953097465104312094248394524915238944551\n-2\n65979473807971894016634449726827689065678029413262970240066900026271391930713716\n5\n1010000000001000000000000000000000000000000000000000000000010000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBarney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he ... | [{"input": "2.0629094807595491132306264747042243928486303384791951220362096240931158821630792563855724946791054152e85\n", "output": "20629094807595491132306264747042243928486303384791951220362096240931158821630792563855.724946791054152\n"}, {"input": "1.739019376653594888733439697327057664160248690309535536328717793279... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 square of size $10^6 \\times 10^6$ on the coordinate plane with four points $(0, 0)$, $(0, 10^6)$,... | [{"input": "3 3\n2 3 1000000\n4 0 4\n3 0 1000000\n4 0 1\n2 0 5\n3 2 1000000\n", "output": "7\n"}, {"input": "3 3\n2 3 1000000\n7 0 4\n3 0 1000000\n4 0 1\n2 0 5\n3 2 1000000\n", "output": "6\n"}, {"input": "3 3\n2 3 1000000\n4 0 4\n3 0 1000000\n4 0 1\n2 0 5\n3 1 1000000\n", "output": "7\n"}, {"input": "3 3\n2 3 1000000\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKurohashi has never participated in AtCoder Beginner Contest (ABC).\nThe next ABC to be held is ABC N (the N-... | [{"input": "111\n", "output": "111\n"}, {"input": "112\n", "output": "222\n"}, {"input": "750\n", "output": "777\n"}, {"input": "234\n", "output": "333\n"}, {"input": "999\n", "output": "999\n"}, {"input": "626\n", "output": "666\n"}, {"input": "555\n", "output": "555\n"}, {"input": "554\n", "output": "555\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\nYou are given array consisting of n integers. Your task is to find the maximum length of an increasing subarr... | [{"input": "10\n32372808 517917901 640274071 1836610331 71867556 96204862 120140751 446173607 796619138 1156360703\n", "output": "6\n"}, {"input": "10\n32372808 517917901 156515250 1836610331 71867556 96204862 120140751 446173607 796619138 1156360703\n", "output": "6\n"}, {"input": "10\n802030518 598196518 640274071 98... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 array $a$ of length $2^n$. You should process $q$ queries on it. Each query has one of the f... | [{"input": "3 8\n7 0 3 15 7 1 5 2\n4 3 7\n2 1\n3 2\n4 1 6\n2 3\n1 5 16\n4 8 8\n3 0\n", "output": "31\n22\n1\n"}, {"input": "3 8\n7 0 8 8 7 1 5 2\n4 3 7\n2 1\n3 2\n4 1 6\n2 3\n1 5 16\n4 8 8\n3 0\n", "output": "29\n22\n1\n"}, {"input": "3 8\n4 0 8 8 7 1 5 2\n4 3 7\n2 1\n3 2\n4 1 6\n2 3\n1 5 16\n4 8 8\n3 0\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\nReforms continue entering Berland. For example, during yesterday sitting the Berland Parliament approved as m... | [{"input": "98 24\n52 20 12 75 44 22 22 25 28 100 8 41 31 47 95 87 5 54 7 49 32 46 42 37 45 22 29 11 54 98 46 94 10 47 114 2 15 108 17 82 46 22 32 62 89 37 30 26 92 77 69 11 59 78 24 66 88 10 32 93 46 14 57 20 5 69 53 99 81 94 67 22 54 31 49 52 46 51 49 4 53 31 4 66 28 38 103 5 40 75 15 52 87 16 68 6 36 98\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\nOne tradition of welcoming the New Year is launching fireworks into the sky. Usually a launched firework flie... | [{"input": "30\n1 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\n", "output": "43348\n"}, {"input": "30\n5 5 1 1 4 4 3 1 5 3 5 5 1 2 2 3 4 5 2 1 4 3 1 1 4 5 4 4 2 2\n", "output": "24339\n"}, {"input": "30\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "10479\n"}, {"input": "30\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe new \"Avengers\" movie has just been released! There are a lot of people at the cinema box office standin... | [{"input": "[25, 50, 25, 100, 25, 25, 50, 100, 25, 25, 25, 100, 25, 25, 50, 100, 25, 50, 25, 100, 25, 50, 50, 50]", "output": "[\"NO\"]", "fn_name": "tickets"}, {"input": "[25, 25, 25, 100, 25, 25, 25, 100, 25, 25, 50, 100, 25, 25, 50, 100, 50, 50]", "output": "[\"NO\"]", "fn_name": "tickets"}, {"input": "[25, 25, 25, ... | 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\nYou are given a non-empty string s consisting of lowercase letters. Find the number of pairs of non-overlappi... | [{"input": "bababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababbababbabbababbababbabbababbabbababba... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nComing up with a new problem isn't as easy as many people think. Sometimes it is hard enough to name it. We'l... | [{"input": "30\nwaiphwcqrrinr\no\nqiqehzmgsjdoqd\nkjexeesevrlowxhghq\njudikhzkj\nz\nxo\nlsdzypkfqro\nsshgcxsky\ngecntpcmoojfwp\nsvmytmcfhc\njrsrvsvbaiumlmkptn\ns\nwpcsovfjlyspviflk\nktvyzvddgllht\nszahigtmklglrcocbo\nznligfxkgxzkcfeu\nliryvzmqwhr\nxgrxkgiehxztv\netrjxdczppafly\njrdgajschhwsci\ndoxnxbjwptnimjmsuijx\nzci... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFlash has invited his nemesis The Turtle (He actually was a real villain! ) to play his favourite card game, ... | [{"input": "[\"3\", \"K\", \"5\", \"A\", \"5\", \"6\", \"7\", \"J\", \"7\", \"9\", \"10\", \"Q\", \"Q\", \"6\", \"8\", \"7\", \"4\", \"J\", \"8\", \"9\", \"K\", \"J\", \"10\", \"4\", \"K\", \"4\"]\n[\"2\", \"8\", \"9\", \"Q\", \"A\", \"K\", \"6\", \"3\", \"J\", \"2\", \"4\", \"3\", \"3\", \"8\", \"A\", \"2\", \"6\", \"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n$n$ players are playing a game.\n\nThere are two different maps in the game. For each player, we know his str... | [{"input": "1\n10\n1109412863 911871372 379798020 844017253 852316352 439889133 601615010 999121621 343144247 662484047\n148682006 868690703 149843110 1652026160 587798634 40092006 292693207 256527822 128794711 765771574\n", "output": "1111111111\n"}, {"input": "1\n10\n617560334 1490885171 379798020 844017253 852316352... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke loves working out. He is now exercising N times.\nBefore he starts exercising, his power is 1. After he... | [{"input": "100000\n", "output": "457992974\n"}, {"input": "100001", "output": "755072381\n"}, {"input": "110001", "output": "817497558\n"}, {"input": "110011", "output": "422312314\n"}, {"input": "101001", "output": "249638241\n"}, {"input": "110000", "output": "559938709\n"}, {"input": "111011", "output": "864631379\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMasha lives in a multi-storey building, where floors are numbered with positive integers. Two floors are call... | [{"input": "1000 999 1000 1000 1000 1000\n", "output": "NO\n"}, {"input": "1000 999 1100 1000 1000 1000\n", "output": "NO\n"}, {"input": "1000 999 1000 1000 1000 1000\n", "output": "NO"}, {"input": "188 288 112 595 331 414\n", "output": "YES\n"}, {"input": "837 544 703 808 549 694\n", "output": "YES\n"}, {"input": "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\nLunar New Year is approaching, and Bob is struggling with his homework – a number division problem.\n\nThere ... | [{"input": "100\n28 27 23 6 23 11 25 20 28 15 29 23 20 2 8 24 8 9 30 8 8 1 11 7 6 17 17 27 26 30 12 22 17 22 9 25 4 26 9 26 10 30 13 4 16 12 23 19 10 22 12 20 3 16 10 4 29 11 15 4 5 7 29 16 3 1 7 16 26 14 28 1 15 19 30 28 5 22 14 28 13 12 11 30 3 4 7 10 22 8 4 10 22 12 17 27 23 11 18 7\n", "output": "48573\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\nImagine you have an infinite 2D plane with Cartesian coordinate system. Some of the integral points are block... | [{"input": "30426905\n", "output": "172120564\n"}, {"input": "38450759\n", "output": "217510336\n"}, {"input": "19863843\n", "output": "112366864\n"}, {"input": "24562258\n", "output": "138945112\n"}, {"input": "24483528\n", "output": "138499748\n"}, {"input": "25329968\n", "output": "143287936\n"}, {"input": "31975828... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 strings $s$ and $t$ consisting of lowercase Latin letters. Also you have a string $z$ which... | [{"input": "11\nb\naaaaaaaaaaa\ncba\nabcabcabcabcabcabcabc\nbvdhsdvlbelrivbhxbhie\ny\nabacabadabacaba\nabacabadabacaba\nabacabadabacaba\nbaabaabdaa\nabbab\nbabaabaabcbabaaa\nt\nz\nu\nt\nkiihgfedcba\nabccefghijk\nabcdefghijk\nkjihgfdecba\nbba\nabaabbbb\n", "output": "-1\n15\n-1\n1\n2\n-1\n-1\n-1\n-1\n10\n5\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\nTwo bears are playing tic-tac-toe via mail. It's boring for them to play usual tic-tac-toe game, so they are ... | [{"input": "... ... ...\n... ... ...\n... ... ...\n\n... ... ...\n... ... ...\n... x.. ...\n\n... ... ...\n... ... ...\n... ... ...\n6 4\n", "output": "... ... ... \n... ... ... \n... ... ... \n\n... ... ... \n... ... ... \n... x.. ... \n\n!!! ... ... \n!!! ... ... \n!!! ... ... \n\n"}, {"input": "xoo x.. x..\nooo ... ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string `S` and a character `C`, return an array of integers representing the shortest distance from t... | [{"input": "\"lovecodewars\"\n\"e\"", "output": "[[3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4]]", "fn_name": "shortest_to_char"}, {"input": "\"aabbaabb\"\n\"a\"", "output": "[[0, 0, 1, 1, 0, 0, 1, 2]]", "fn_name": "shortest_to_char"}, {"input": "\"aaaabbbb\"\n\"b\"", "output": "[[4, 3, 2, 1, 0, 0, 0, 0]]", "fn_name": "shortest... | 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\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from ... | [{"input": "60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n", "output": "Yes\n"}, {"input": "60 106 34\n92 41 43\n39 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34", "output": "Yes\n"}, {"input": "60 88 34\n92 41 43\n39 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34", "output": "Yes\n"}... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.\n\nShe is s... | [{"input": "1001 8\n1 0 4 5 6 7 15 11", "output": "2222\n"}, {"input": "1001 8\n1 3 2 5 6 7 15 9", "output": "4000\n"}, {"input": "1001 8\n1 3 4 5 6 7 8 9", "output": "2000\n"}, {"input": "1000 8\n2 3 4 5 6 7 8 9", "output": "1000\n"}, {"input": "1001 8\n1 3 4 5 6 7 8 2", "output": "9000\n"}, {"input": "1000 8\n1 3 4 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEveryone knows that long ago on the territory of present-day Berland there lived Bindian tribes. Their capita... | [{"input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 8097\n", "output": "45\n"}, {"input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 4894\n", "output": "38\n"}, {"input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 9062 4894\n", "output": "26\n"}, {"input": "10\n8097 8097 8097 14160 8097 5098 8097 8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTanya wants to go on a journey across the cities of Berland. There are n cities situated along the main railr... | [{"input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"input": "10\n10 60 12 13 14 15 16 77 18 130\n", "output": "130\n"}, {"input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"input": "9\n4 10 21 7 23 9 15 11 12\n", "output": "44\n"}, {"input": "9\n4 10 21 7 22 9 15 11 12\n", "output": "43\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem\n\nN idols, numbered from 1 to n in order, are lined up in a row.\nIdle i can transmit information to... | [{"input": "39 5\n0 6 10 8 10", "output": "29\n"}, {"input": "27 5\n4 6 6 8 10", "output": "17\n"}, {"input": "39 5\n0 6 7 4 13", "output": "26\n"}, {"input": "10 3\n4 5 6 13 10", "output": "4\n"}, {"input": "100001 1\n1", "output": "100000\n"}, {"input": "110001 1\n1", "output": "110000\n"}, {"input": "10 3\n2 5 6 8 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\nproblem\n\nJOI Pizza sells pizza home delivery along the d-meter-long ring road that runs through the city ce... | [{"input": "8\n3\n2\n3\n2\n4\n6\n20\n4\n4\n33\n16\n15\n15\n12\n5\n8\n0", "output": "3\n15\n"}, {"input": "8\n3\n2\n3\n0\n4\n6\n20\n4\n4\n14\n14\n23\n7\n7\n11\n8\n0", "output": "3\n23\n"}, {"input": "8\n3\n2\n3\n0\n4\n6\n20\n4\n4\n17\n17\n23\n7\n7\n11\n8\n0", "output": "3\n28\n"}, {"input": "8\n3\n2\n4\n0\n4\n6\n20\n4\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\nThis task will exclusively concentrate only on the arrays where all elements equal 1 and/or 2.\n\nArray a is ... | [{"input": "100 20\n2 2 2 1 1 2 1 2 1 2 1 1 2 2 2 2 2 1 2 1 2 2 2 2 1 2 1 2 1 1 1 1 2 2 2 2 1 2 1 1 2 2 2 2 1 2 1 2 1 2 1 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 1 2 1 1 1 1 2 2 2 2 2 1 1 2 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 2 2 1 1 1\n", "output": "13\n"}, {"input": "100 25\n2 2 1 2 2 2 2 2 1 2 2 1 2 1 1 2 1 2 1 2 2 2 1 2 2 2 1 1 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nN hotels are located on a straight line. The coordinate of the i-th hotel (1 \\leq i \\leq N) is x_i.\nTak th... | [{"input": "9\n1 3 6 13 15 18 19 29 31\n10\n4\n1 8\n7 3\n6 7\n8 5\n", "output": "4\n2\n1\n2\n"}, {"input": "9\n1 3 6 13 15 18 19 29 31\n10\n4\n1 8\n7 3\n6 7\n8 3", "output": "4\n2\n1\n3\n"}, {"input": "9\n1 3 6 13 23 18 19 29 31\n12\n4\n1 8\n1 5\n9 7\n8 7", "output": "3\n2\n1\n1\n"}, {"input": "9\n1 3 6 13 23 19 19 29 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPizzaForces is Petya's favorite pizzeria. PizzaForces makes and sells pizzas of three sizes: small pizzas con... | [{"input": "6\n40\n15\n300\n1\n9999999999999999\n2\n", "output": "100\n40\n750\n15\n25000000000000000\n15\n"}, {"input": "6\n12\n15\n300\n1\n9999999999999999\n3\n", "output": "30\n40\n750\n15\n25000000000000000\n15\n"}, {"input": "6\n20\n15\n300\n1\n9999999999999999\n3\n", "output": "50\n40\n750\n15\n25000000000000000\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef and his girlfriend are going to have a promenade. They are walking along the straight road which consist... | [{"input": "2\n5\n11 11 1 4 -1\n5\n6 4 15 0 1", "output": "12\n17\n"}, {"input": "2\n5\n6 15 1 4 -3\n5\n12 4 15 0 1", "output": "16\n17\n"}, {"input": "2\n5\n6 15 1 4 -4\n5\n12 4 28 0 1", "output": "16\n30\n"}, {"input": "2\n5\n6 11 1 4 -1\n5\n3 4 12 1 1", "output": "12\n14\n"}, {"input": "2\n5\n6 11 1 4 -1\n5\n3 4 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\nHaving watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his fath... | [{"input": "156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561\n", "output": "3\n"}, {"input": "103558265279194540919999479104736998591144614354128226385356523500136575934047295164369877371826192807895143756308323575\n", "output": "3\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\nThere were n groups of students which came to write a training contest. A group is either one person who can ... | [{"input": "247\n2 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 2 1 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 1 1 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 1 1 2 2 1 1 1 2 1 1 1 1 2 2 1 2 2 1 1 1 2 1 2 2 1 2 1 1 1 2 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\nYou are given a list/array which contains only integers (positive and negative). Your job is to sum only the ... | [{"input": "[2, 2, -4, 4, 5, 5, 6, 6, 6, 6, 6, 1]", "output": "[[4, -4, 4, 10, 30, 1]]", "fn_name": "sum_consecutives"}, {"input": "[1, -1, -2, 2, 3, -3, 4, -4]", "output": "[[1, -1, -2, 2, 3, -3, 4, -4]]", "fn_name": "sum_consecutives"}, {"input": "[1, 4, 4, 4, 0, 4, 3, 3, 1]", "output": "[[1, 12, 0, 4, 6, 1]]", "fn_n... | 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\n-----Input-----\n\nThe input contains a single integer a (10 ≤ a ≤ 999).\n\n\n-----Output-----\n\nOutput 0 or... | [{"input": "927\n", "output": "1\n"}, {"input": "999\n", "output": "1\n"}, {"input": "142\n", "output": "0\n"}, {"input": "309\n", "output": "1\n"}, {"input": "572\n", "output": "0\n"}, {"input": "835\n", "output": "1\n"}, {"input": "990\n", "output": "0\n"}, {"input": "168\n", "output": "0\n"}, {"input": "431\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\nIn the board game Talisman, when two players enter combat the outcome is decided by a combat score, equal to ... | [{"input": "[7, 2]\n[6, 8]", "output": "[\"Pray for a tie!\"]", "fn_name": "get_required"}, {"input": "[2, 0]\n[8, 1]", "output": "[\"Auto-lose\"]", "fn_name": "get_required"}, {"input": "[1, 10]\n[1, 4]", "output": "[\"Auto-win\"]", "fn_name": "get_required"}, {"input": "[8, 1]\n[3, 0]", "output": "[\"Auto-win\"]", "f... | 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\nIgnoring the air resistance, velocity of a freely falling object $v$ after $t$ seconds and its drop $y$ in $t... | [{"input": "30.680680649968536\n28.560601801329888", "output": "11\n10\n"}, {"input": "31.609624009789687\n28.560601801329888", "output": "12\n10\n"}, {"input": "37.215162984287666\n34.783659160997495", "output": "16\n14\n"}, {"input": "43.458654705246964\n43.015002690398575", "output": "21\n20\n"}, {"input": "50.86628... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNo Story\n\nNo Description\n\nOnly by Thinking and Testing\n\nLook at the results of the testcases, and guess... | [{"input": "9", "output": "[[1, 3, 9]]", "fn_name": "mystery"}, {"input": "10", "output": "[[1, 5]]", "fn_name": "mystery"}, {"input": "3", "output": "[[1, 3]]", "fn_name": "mystery"}, {"input": "5", "output": "[[1, 5]]", "fn_name": "mystery"}, {"input": "6", "output": "[[1, 3]]", "fn_name": "mystery"}, {"input": "7", ... | 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\nNatasha travels around Mars in the Mars rover. But suddenly it broke down, namely — the logical scheme inside... | [{"input": "60\nAND 20 4\nNOT 42\nAND 48 59\nOR 17 7\nIN 0\nAND 36 37\nIN 1\nIN 0\nIN 1\nNOT 47\nAND 52 49\nOR 44 35\nIN 0\nIN 1\nAND 33 56\nIN 0\nIN 0\nIN 0\nAND 31 41\nOR 15 3\nOR 43 46\nIN 1\nXOR 22 28\nIN 1\nIN 1\nIN 1\nAND 34 21\nIN 0\nIN 1\nIN 0\nXOR 51 23\nXOR 10 54\nOR 57 40\nIN 0\nNOT 18\nNOT 25\nIN 1\nAND 5 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\nIt is known that passages in Singer house are complex and intertwined. Let's define a Singer k-house as a gra... | [{"input": "181\n", "output": "421742777\n"}, {"input": "261\n", "output": "952127278\n"}, {"input": "121\n", "output": "631667314\n"}, {"input": "351\n", "output": "625447969\n"}, {"input": "141\n", "output": "551624811\n"}, {"input": "361\n", "output": "465138299\n"}, {"input": "301\n", "output": "484957644\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\nThis morning, Roman woke up and opened the browser with $n$ opened tabs numbered from $1$ to $n$. There are t... | [{"input": "100 47\n-1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1\n", "output": "19\n"}, {"input": "100 47\n... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.