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\nLet's say you are standing on the $XY$-plane at point $(0, 0)$ and you want to reach point $(n, n)$.\n\nYou c... | [{"input": "3\n2\n13 100\n3\n4 3 1\n5\n13 4 1 1 5\n", "output": "226\n15\n25\n"}, {"input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 2 1 5\n", "output": "226\n11\n19\n"}, {"input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 1 1 5\n", "output": "226\n11\n15\n"}, {"input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 0 1 5\n", "output": "226\n11\n11\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 balls in a row. Initially, the i-th ball from the left has the integer A_i written on it.\n\nWhen... | [{"input": "10 10\n8 7 2 9 10 6 6 5 5 4\n8 1\n6 3\n6 2\n7 10\n9 7\n9 9\n2 4\n10 1\n1 8\n7 7", "output": "1\n0\n1\n2\n2\n3\n3\n4\n4\n3\n"}, {"input": "10 10\n8 7 2 9 10 6 6 5 5 4\n8 1\n6 3\n6 2\n7 10\n9 7\n9 4\n2 4\n10 1\n1 8\n7 7", "output": "1\n0\n1\n2\n2\n2\n3\n3\n3\n2\n"}, {"input": "10 10\n8 7 2 9 10 6 6 5 5 4\n8 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 a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. Th... | [{"input": "xxxxxxxxxxfxxxxxxxxxxxxxxxxxxxxxxxxxxxrxtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxexxxxmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxexxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxuxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that... | [{"input": "10000 10000 10000\n", "output": "1200"}, {"input": "10000 1 10000\n", "output": "40008"}, {"input": "9801 9801 9801\n", "output": "1188"}, {"input": "1 10000 10000\n", "output": "40008"}, {"input": "9801 9702 9702\n", "output": "1184"}, {"input": "1656 6900 1350\n", "output": "740"}, {"input": "3623 3623 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\nAlice and Bob are playing a game on a line with n cells. There are n cells labeled from 1 through n. For each... | [{"input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 integer numbers x and y. An array F is called an y-factorization of x iff the foll... | [{"input": "1\n524288 1000000\n", "output": "645043186\n"}, {"input": "1\n524288 1000000\n", "output": "645043186\n"}, {"input": "1\n983675 1000000\n", "output": "661876874\n"}, {"input": "1\n65536 1000000\n", "output": "928522471\n"}, {"input": "1\n65536 1000000\n", "output": "928522471\n"}, {"input": "1\n36157 100000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nShe loves e-mail so much! She sends e-mails by her cellular phone to her friends when she has breakfast, she ... | [{"input": "666660666\n134424306396481246895756\n12784174432754272468162", "output": "No\n'dhagdmdwmgt'agmtwjpjm\n'aptg'phdapjgapagmt'ma\n"}, {"input": "666660666\n113124756735251440964347\n33891614279093528467517", "output": "No\n,d'agpjmpdjaj'hwmgdgp\netw'm'gapwwdjatgmpj'p\n"}, {"input": "666660666\n11850618639893972... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCharacter recognition software is widely used to digitise printed texts. Thus the texts can be edited, search... | [{"input": "\"J. K. R0WL1NG - HARRY P0TTER AND THE PH1L050PHER'5 5T0NE\"", "output": "[\"J. K. ROWLING - HARRY POTTER AND THE PHILOSOPHER'S STONE\"]", "fn_name": "correct"}, {"input": "\"J. K. R0WL1NG - HARRY P0TTER AND THE PR150NER 0F Azkaban\"", "output": "[\"J. K. ROWLING - HARRY POTTER AND THE PRISONER OF Azkaban\"... | 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\nPolycarp and Vasiliy love simple logical games. Today they play a game with infinite chessboard and one pawn ... | [{"input": "100000 100000 100000 123228\n", "output": "Polycarp\n"}, {"input": "100000 99999 100000 100000\n", "output": "Polycarp\n"}, {"input": "100000 99999 100010 100000\n", "output": "Polycarp\n"}, {"input": "100000 100000 100000 99999\n", "output": "Vasiliy\n"}, {"input": "53208 42123 134209 85846\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\nYour job is to write a function which increments a string, to create a new string.\n\n- If the string already... | [{"input": "\"foobar00999\"", "output": "[\"foobar01000\"]", "fn_name": "increment_string"}, {"input": "\"foobar999\"", "output": "[\"foobar1000\"]", "fn_name": "increment_string"}, {"input": "\"foobar001\"", "output": "[\"foobar002\"]", "fn_name": "increment_string"}, {"input": "\"foobar000\"", "output": "[\"foobar001... | 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 begin their day with a quick game. They first choose a starting number X_0 β₯ 3 and try to reach... | [{"input": "1000000\n", "output": "998677\n"}, {"input": "959806\n", "output": "239958\n"}, {"input": "166320\n", "output": "110879\n"}, {"input": "221760\n", "output": "110880\n"}, {"input": "277200\n", "output": "138600\n"}, {"input": "332640\n", "output": "166320\n"}, {"input": "498960\n", "output": "332639\n"}, {"i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Petya has a birthday soon. Due this wonderful event, Petya's friends decided to give him sweets. The t... | [{"input": "50\n", "output": "9539133444790097506800945910496378878609919834178506027953758452154850007466954507364870095\n6359422296526731671200630606997585919073279889452337351969172301436566671644636338243246730\n3815653377916039002720378364198551551443967933671402411181503380861940002986781802945948038\n27254666985... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal r... | [{"input": "86451 754 85 84\n", "output": "4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhat joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himse... | [{"input": "100\n100 100 100 100 100 100 100 100 100 100 100 100\n", "output": "1\n"}, {"input": "100\n100 100 100 100 110 100 100 100 100 100 100 100\n", "output": "1\n"}, {"input": "100\n100 100 100 100 110 100 100 100 100 100 101 100\n", "output": "1\n"}, {"input": "100\n100 100 100 100 110 100 100 100 100 100 101 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\nValerian was captured by Shapur. The victory was such a great one that Shapur decided to carve a scene of Val... | [{"input": "15\n12 1 52\n6 2 10\n4 1 55\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24\n5 3 74\n7 6 157\n", "output": "1039\n"}, {"input": "15\n12 1 52\n3 2 10\n4 1 45\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24\n5 3 74\n7 6 157\n", "output": "921\n"}, {"inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA cricket team consists of 11 players and some are good at batting, others are good at bowling and some of th... | [{"input": "2\n1 2 3 4 5 11 14 11 11 6 11\n3\n0 5 1 2 4 1 4 5 1 2 1\n11", "output": "6\n1\n"}, {"input": "2\n2 1 3 4 5 11 14 11 12 6 12\n3\n0 5 1 2 4 1 4 5 1 2 1\n11", "output": "1\n1\n"}, {"input": "2\n2 1 3 4 5 11 14 11 9 6 11\n3\n-1 5 1 2 4 1 4 5 1 2 1\n11", "output": "3\n1\n"}, {"input": "2\n2 1 3 4 5 11 14 11 9 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\nAlice and Bob are playing a game on a line with $n$ cells. There are $n$ cells labeled from $1$ through $n$. ... | [{"input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 are a prime number p and a sequence of p integers a_0, \\ldots, a_{p-1} consisting of zeros and ones.\n... | [{"input": "2999\n0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1 0 1 1 1 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\nΠΠ°ΡΡ ΠΊΡΠΏΠΈΠ» ΡΡΠΎΠ», Ρ ΠΊΠΎΡΠΎΡΠΎΠ³ΠΎ n Π½ΠΎΠΆΠ΅ΠΊ. ΠΠ°ΠΆΠ΄Π°Ρ Π½ΠΎΠΆΠΊΠ° ΡΠΎΡΡΠΎΠΈΡ ΠΈΠ· Π΄Π²ΡΡ
ΡΠ°ΡΡΠ΅ΠΉ, ΠΊΠΎΡΠΎΡΡΠ΅ ΡΠΎΠ΅Π΄ΠΈΠ½ΡΡΡΡΡ Π΄ΡΡΠ³ Ρ Π΄ΡΡΠ³ΠΎΠΌ. ... | [{"input": "100\n8 7 7 5 2 7 7 5 1 8 6 3 6 7 2 4 4 2 6 8 5 6 5 2 6 1 3 9 5 8 7 6 5 4 8 6 5 5 3 2 6 5 4 9 7 1 5 7 9 5 7 4 1 6 5 8 2 6 6 1 4 2 3 2 3 9 3 8 7 1 2 4 5 7 3 5 5 6 3 8 3 6 1 5 5 3 3 3 8 8 1 4 3 6 7 1 1 2 4 4 7 3 7 7 8 9 5 8 6 6 4 7 4 9 3 4 7 5 2 8 4 1 9 7 9 7 9 6 7 7 9 6 1 1 1 9 9 4 4 1 5 6 6 3 9 3 3 7 4 2 4 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSoroush and Keshi each have a labeled and rooted tree on n vertices. Both of their trees are rooted from vert... | [{"input": "4\n4\n1 2 3\n1 2 3\n5\n1 2 3 4\n1 1 1 1\n6\n1 1 1 1 2\n1 2 1 2 2\n7\n1 1 3 4 4 5\n1 2 1 4 2 5\n", "output": "\n1\n4\n1\n3\n"}, {"input": "4\n4\n1 2 3\n1 2 3\n5\n1 2 3 4\n1 1 1 1\n6\n1 2 1 1 2\n1 2 1 2 2\n7\n1 1 3 4 4 5\n1 2 1 4 2 5\n", "output": "1\n4\n1\n3\n"}, {"input": "4\n4\n1 2 3\n1 2 3\n5\n1 2 3 4\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\nMonocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. Al... | [{"input": "15\n10 15\n12 15\n6 15\n8 15\n2 15\n3 15\n10 15\n13 15\n5 15\n7 15\n11 15\n4 14\n1 15\n14 15\n", "output": "NO\n"}, {"input": "15\n10 15\n12 15\n6 15\n8 15\n2 15\n3 15\n10 15\n13 15\n5 15\n7 15\n11 15\n4 14\n1 15\n14 15\n", "output": "NO\n"}, {"input": "15\n9 15\n6 15\n12 15\n3 14\n14 15\n11 15\n6 15\n7 15\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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's house has only one socket.\nTakahashi wants to extend it with some number of power strips, each w... | [{"input": "13 17\n", "output": "2\n"}, {"input": "10 19\n", "output": "2\n"}, {"input": "20 19\n", "output": "1\n"}, {"input": "2 20\n", "output": "19\n"}, {"input": "4 10\n", "output": "3\n"}, {"input": "4 12\n", "output": "4\n"}, {"input": "9 12\n", "output": "2\n"}, {"input": "3 17\n", "output": "8\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\nTakayuki and Kazuyuki are good twins, but their behavior is exactly the opposite. For example, if Takayuki go... | [{"input": "6 6\n2 4\n6 2\n0 0 0 0 1 0\n0 1 1 0 0 0\n0 1 0 0 0 0\n0 0 0 1 0 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n3 3\n1 1\n3 3\n0 0 0\n0 1 0\n0 0 0\n0 0", "output": "3\nNA\n"}, {"input": "6 6\n2 4\n6 2\n0 0 0 0 1 0\n0 1 0 0 1 0\n0 1 0 0 0 0\n0 1 0 1 1 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n3 3\n1 1\n3 3\n0 0 0\n0 1 0\n0 0 0\n0 0", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and part... | [{"input": "1707 1117\n", "output": "237674323"}, {"input": "1766 1038\n", "output": "435768250"}, {"input": "1229 1315\n", "output": "100240813"}, {"input": "1903 1612\n", "output": "620810276"}, {"input": "1887 1729\n", "output": "730033374"}, {"input": "1153 1823\n", "output": "791493066"}, {"input": "1544 1794\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\nAnd again a misfortune fell on Poor Student. He is being late for an exam.\n\nHaving rushed to a bus stop tha... | [{"input": "94 2 1\n0 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 506... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nUh oh! Ray lost his array yet again! However, Omkar might be able to help because he thinks he has found the ... | [{"input": "5\n8\n-8 2 -6 -5 -4 3 2 2\n7\n1 1 3 1 0 -2 -1\n7\n6 12 8 6 2 6 10\n6\n5 1 2 2 12 7\n5\n1 3 4 3 -1\n", "output": "NO\nYES\nNO\nNO\nNO\n"}, {"input": "5\n8\n-8 3 -6 -5 -4 3 3 2\n7\n1 1 4 1 0 -2 -1\n7\n6 12 8 6 2 6 10\n6\n5 1 2 2 12 7\n5\n1 3 4 3 0\n", "output": "YES\nYES\nNO\nNO\nNO\n"}, {"input": "5\n8\n-8 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 a sequence a_1, a_2, ..., a_{n} of one-dimensional segments numbered 1 through n. Your task is ... | [{"input": "11\n22226 28285\n9095 23314\n19162 25530\n255 13298\n4904 25801\n17914 23501\n13874 28117\n11880 29994\n11123 19874\n21505 27971\n7658 14109\n", "output": "11 5\n"}, {"input": "11\n22226 28285\n9095 23314\n19162 25530\n255 13298\n4904 25801\n17914 23501\n8441 28117\n11880 29994\n11123 19874\n21505 27971\n76... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nZeke loves to spend time with Penny and likes her. Penny is having an issue to solve a mathematics problem an... | [{"input": "1000\n1804289384 846930887 1681692778\n1714636916 1957747794 424238336\n719885387 1649760493 596516650\n1189641422 1025202363 1350490028\n783368691 1102520060 2044897764\n1967513927 1365180541 1540383427\n304089173 1303455737 35005212\n521595369 294702568 1726956430\n336465783 861021531 278722863\n233665124... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHappy PMP is freshman and he is learning about algorithmic problems. He enjoys playing algorithmic games a lo... | [{"input": "20\n1 12 9 6 11 13 2 8 20 7 16 19 4 18 3 15 10 17 14 5\n5 14 17 10 15 3 18 4 19 16 7 20 8 2 13 11 6 9 12 1\n", "output": "19"}, {"input": "10\n1 6 10 3 4 9 2 5 8 7\n7 5 2 6 10 3 4 8 9 1\n", "output": "9\n"}, {"input": "10\n5 8 1 10 3 6 2 9 7 4\n4 2 6 3 1 9 10 5 8 7\n", "output": "8"}, {"input": "10\n1 6 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\nTaro and Hanako decided to play hit-and-blow. The hit-and-blow rules are as follows.\n\n* Separated into ques... | [{"input": "1234 10660\n1234 1354\n1234 1234\n1230 1023\n0123 1234\n0 0", "output": "1 0\n2 1\n4 0\n1 3\n0 3\n"}, {"input": "1234 10660\n1964 1354\n1234 1234\n1230 1023\n0123 1234\n0 0", "output": "1 0\n2 0\n4 0\n1 3\n0 3\n"}, {"input": "1234 10660\n2242 1354\n1234 1234\n1230 1023\n0123 1234\n0 0", "output": "1 0\n0 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\nAnton likes to play chess, and so does his friend Danik.\n\nOnce they have played n games in a row. For each ... | [{"input": "379\nAADAAAAAADDAAAAAADAADADADDAAAAADADDAADAAAADDDADAAAAAAADAADAAAAAAADAAAAAAAAADAAAAAAADAAAAAAAAAAADDDADAAAAAAAADAADADAAAADAAAAAAAAAAAAAAAAADAAAADDDAADAAAAAAADAAADAAADAADDDADDAAADAAAAAADDDADDDAAADAAAADAAAAAAAAADAAADAAAAAAAAADAAAAAAAAAAAAAAAAAADADAAAAAAAAAAADAAAAADAAAADAAAAAAAAAAAAADADAADAAAAAAAADAADAAAAAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 beautiful if no two consecutive characters are equal. For example, \"ababcb\", \"a\" and \... | [{"input": "23\n?\n??\n???\n????\n????\n?a\n?b\n?c\na?\nb?\nc?\n?a?\n?b?\n?c?\na?a\na?b\na?c\nb?a\nb?b\nb?c\nc?a\nc?b\nc?c\n", "output": "a\nab\naba\nabab\nabab\nba\nab\nac\nab\nba\nca\nbab\naba\naca\naba\nacb\nabc\nbca\nbab\nbac\ncba\ncab\ncac\n"}, {"input": "23\n?\n??\n???\n????\n????\n?a\n?b\n?c\na?\nb?\nc?\n?a?\n?b... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 us consider a grid of squares with 10^9 rows and N columns. Let (i, j) be the square at the i-th column (... | [{"input": "9\n17 18 51 18 28 45 112 45 23", "output": "917046249"}, {"input": "9\n17 18 51 18 34 45 112 45 23", "output": "938229436"}, {"input": "9\n17 18 51 18 34 45 190 45 23", "output": "353713429"}, {"input": "9\n17 18 51 18 34 45 190 56 23", "output": "814466445"}, {"input": "9\n17 18 81 18 34 45 190 56 23", "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\nYou are given a digital clock with $n$ digits. Each digit shows an integer from $0$ to $9$, so the whole cloc... | [{"input": "7\n3\n007\n4\n1000\n5\n00000\n3\n153\n4\n1247\n9\n123456789\n30\n001678294039710047203946100020\n", "output": "7\n2\n0\n11\n17\n53\n115\n"}, {"input": "7\n3\n007\n4\n1000\n5\n00000\n3\n153\n4\n1293\n9\n123456789\n30\n001678294039710047203946100020\n", "output": "7\n2\n0\n11\n18\n53\n115\n"}, {"input": "7\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera had two bags of potatoes, the first of these bags contains x (x β₯ 1) potatoes, and the second β y (y β₯... | [{"input": "1 2 27764\n", "output": "1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 16... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string X, which has an even number of characters. Half the characters are `S`, and the other half a... | [{"input": "SSTTTSST", "output": "2\n"}, {"input": "TTTTSSSS", "output": "8\n"}, {"input": "TSSTTSST", "output": "2\n"}, {"input": "TTSTSSST", "output": "4\n"}, {"input": "SSTTSTST", "output": "0\n"}, {"input": "TSSSTSTT", "output": "2\n"}, {"input": "TSTSTTSS", "output": "4\n"}, {"input": "SSSTTTST", "output": "0\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCrazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation a_{i}x +... | [{"input": "841746 527518\n595261 331297\n10\n-946901 129987 670374\n-140388 -684770 309555\n-302589 415564 -387435\n-565799 -72069 -395358\n-523453 -511446 854898\n-846967 -749453 -341866\n-622388 434663 264157\n-638453 625357 344195\n-255265 -676356 -772398\n-824723 -319141 33585\n", "output": "0\n"}, {"input": "8417... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 of n integers a1... an. The cost of a subsegment is the number of unordered pairs of d... | [{"input": "128 5\n116 8 116 116 119 39 116 116 119 116 8 119 119 119 39 116 39 119 39 119 119 39 8 39 14 119 8 116 116 116 119 119 8 39 39 8 116 119 119 119 119 8 11 8 119 39 119 116 119 119 39 39 119 8 116 116 116 116 116 119 116 116 119 116 39 39 119 8 8 119 39 116 39 39 119 119 116 116 119 119 119 119 8 8 116 116 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\nThere is a building with n rooms, numbered 1 to n.\nWe can move from any room to any other room in the buildi... | [{"input": "200000 1000000000\n", "output": "607923868\n"}, {"input": "200000 0000001000", "output": "525127456\n"}, {"input": "200000 0000001001", "output": "578341203\n"}, {"input": "200000 0001001001", "output": "607923868\n"}, {"input": "140753 0011001000", "output": "810481869\n"}, {"input": "135689 0011001000", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# Task\n Yesterday you found some shoes in your room. Each shoe is described by two values:\n```\ntype indica... | [{"input": "[[0, 23], [1, 23], [1, 23], [0, 23], [0, 23], [0, 23]]", "output": "[false]", "fn_name": "pair_of_shoes"}, {"input": "[[0, 23], [1, 21], [1, 23], [0, 21], [1, 22], [0, 22]]", "output": "[true]", "fn_name": "pair_of_shoes"}, {"input": "[[0, 21], [1, 23], [1, 21], [1, 23]]", "output": "[false]", "fn_name": "p... | 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\nHofstadter sequences are a family of related integer sequences, among which the first ones were described by ... | [{"input": "1000", "output": "[502]", "fn_name": "hofstadter_Q"}, {"input": "100", "output": "[56]", "fn_name": "hofstadter_Q"}, {"input": "10", "output": "[6]", "fn_name": "hofstadter_Q"}, {"input": "1", "output": "[1]", "fn_name": "hofstadter_Q"}, {"input": "3", "output": "[2]", "fn_name": "hofstadter_Q"}, {"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\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these card... | [{"input": "4\n20 18 2 18\n", "output": "18\n"}, {"input": "4\n20 18 2 12", "output": "12\n"}, {"input": "4\n139 4 2 5", "output": "136\n"}, {"input": "4\n139 1 2 5", "output": "135\n"}, {"input": "4\n139 0 2 4", "output": "137\n"}, {"input": "4\n20 1 4 12", "output": "11\n"}, {"input": "4\n20 2 0 12", "output": "10\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\nAmong other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was t... | [{"input": "50 77\n24 119\n43 119\n102 22\n117 30\n127 54\n93 19\n120 9\n118 27\n98 16\n17 105\n22 127\n109 52\n115 40\n11 121\n12 120\n113 30\n13 108\n33 124\n31 116\n112 39\n37 108\n127 28\n127 39\n120 29\n19 114\n103 18\n106 16\n24 121\n93 10\n36 112\n104 40\n39 100\n36 97\n83 9\n14 114\n126 12\n85 47\n25 84\n105 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\nAfter bracket sequences Arthur took up number theory. He has got a new favorite sequence of length n (a1, a2,... | [{"input": "39 3\n-5 1 -13 ? 2 -12 ? 3 -11 -2 4 -10 ? 5 -9 0 6 -8 ? 7 -7 ? 8 -6 5 9 -5 ? 10 -4 ? 11 -3 ? 12 -2 10 13 -1\n", "output": "-5 1 -13 -4 2 -12 -3 3 -11 -2 4 -10 -1 5 -9 0 6 -8 1 7 -7 2 8 -6 5 9 -5 6 10 -4 7 11 -3 8 12 -2 10 13 -1\n"}, {"input": "39 3\n-5 1 -13 ? 2 -12 ? 3 -11 -3 4 -10 ? 5 -9 0 6 -8 ? 7 -7 ? 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\nIn this Kata, you will be given two integers `n` and `k` and your task is to remove `k-digits` from `n` and r... | [{"input": "1284569\n1", "output": "[\"124569\"]", "fn_name": "solve"}, {"input": "1284569\n2", "output": "[\"12456\"]", "fn_name": "solve"}, {"input": "123056\n1", "output": "[\"12056\"]", "fn_name": "solve"}, {"input": "1284569\n3", "output": "[\"1245\"]", "fn_name": "solve"}, {"input": "123056\n2", "output": "[\"105... | 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\nMaxim always goes to the supermarket on Sundays. Today the supermarket has a special offer of discount system... | [{"input": "48\n14 2 5 3 10 10 5 6 14 8 19 13 4 4 3 13 18 19 9 16 3 1 14 9 13 10 13 4 12 11 8 2 18 20 14 11 3 11 18 11 4 2 7 2 18 19 2 8\n70\n9497 5103 1001 2399 5701 4053 3557 8481 1736 4139 5829 1107 6461 4089 5936 7961 6017 1416 1191 4635 4288 5605 8857 1822 71 1435 2837 5523 6993 2404 2840 8251 765 5678 7834 8595 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 have a string A = A_1 A_2 ... A_n consisting of lowercase English letters.\n\nYou can choose any two indi... | [{"input": "abracbdabra", "output": "46\n"}, {"input": "aaracbdaarb", "output": "44\n"}, {"input": "aarqabdaacb", "output": "45\n"}, {"input": "abrqabdaacb", "output": "47\n"}, {"input": "arbadbcbrca", "output": "48\n"}, {"input": "arbadbcbsca", "output": "49\n"}, {"input": "aqbadacaraa", "output": "41\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 employee of the \"Blake Techologies\" company uses a special messaging app \"Blake Messenger\". All the ... | [{"input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 1-e 1-f 1-g 1-a 1-b 1-c 1-d 1-e 1-f 2-g\n1-a 1-b 1-c 1-d 1-e 1-f 1-g\n", "output": "2\n"}, {"input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 1-e 1-f 1-g 1-a 1-b 1-c 1-d 1-e 1-f 2-g\n1-a 1-b 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 will be given a fruit which a farmer has harvested, your job is to see if you should buy or sell.\n\nYou ... | [{"input": "[[\"orange\", \"apple\"], [\"pear\", \"orange\"], [\"apple\", \"pear\"]]\n\"apple\"", "output": "[[\"sell\", \"sell\", \"sell\"]]", "fn_name": "buy_or_sell"}, {"input": "[[\"apple\", \"orange\"], [\"pear\", \"orange\"], [\"apple\", \"pear\"]]\n\"apple\"", "output": "[[\"buy\", \"sell\", \"sell\"]]", "fn_nam... | 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 play a game. The game consists of several sets, and each set consists of several rounds. Each r... | [{"input": "12\n???1??????1?\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1 \n"}, {"input": "12\n?1?1????????\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\n"}, {"input": "12\n?1??????1???\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\n"}, {"input": "12\n????????1?1?\n", "output": "12 6 4 3 2 2 1 1 1 1 1 1\n"}, {"input": "12\n???1??????1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to tr... | [{"input": "ttspivgoupgupvgpusvppogsseueusuglpiugssviuutlvgvugtpovuvspvpipggooplgvgugpogvesppulovugsvuougveiivgvslllviogpvtolepglguuellotpvgevspvoiiggiiplppgosuguvtstttpielteuglspgeoeeuivtptggltoltpgliviotsospvitupiopisoetupvvspooilsopslpoloptigstspoiuutiuvvuvlpplvioitsuvlpvtleveslslovolloogsgpvpepgueesslgtosttuupiepps... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string s of length 3 or greater. No two neighboring characters in s are equal.\n\nTakahashi and Ao... | [{"input": "bceab", "output": "Second\n"}, {"input": "bacba", "output": "First\n"}, {"input": "badba", "output": "First\n"}, {"input": "cadba", "output": "First\n"}, {"input": "dadba", "output": "First\n"}, {"input": "ddaba", "output": "First\n"}, {"input": "dd`ba", "output": "First\n"}, {"input": "dd`b`", "output": "F... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya and Vasya are competing with each other in a new interesting game as they always do.\n\nAt the beginnin... | [{"input": "10 20\n", "output": "YES\n2 2 2 2 2 2 2 2 2 2\n1\n"}, {"input": "10 24\n", "output": "YES\n2 2 2 2 2 2 2 2 2 6\n1\n"}, {"input": "8 36\n", "output": "YES\n2 2 2 2 2 2 2 22\n1\n"}, {"input": "8 17\n", "output": "YES\n2 2 2 2 2 2 2 3\n1\n"}, {"input": "8 18\n", "output": "YES\n2 2 2 2 2 2 2 4\n1\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\nSnuke received a positive integer N from Takahashi. A positive integer m is called a favorite number when the... | [{"input": "1000010000000", "output": "2716922731275\n"}, {"input": "1000011000000", "output": "3307289212967\n"}, {"input": "1100011000000", "output": "2999416055122\n"}, {"input": "1110011000000", "output": "3146654438234\n"}, {"input": "1110011100000", "output": "4080876601631\n"}, {"input": "1110011100100", "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 shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectivel... | [{"input": "1000 1000\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 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\nThere is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate t... | [{"input": "[2, 2, 3, 3, 4, 4]\n2", "output": "[9]", "fn_name": "queue_time"}, {"input": "[1, 2, 3, 4, 5]\n100", "output": "[5]", "fn_name": "queue_time"}, {"input": "[1, 2, 3, 4, 5]\n1", "output": "[15]", "fn_name": "queue_time"}, {"input": "[5]\n1", "output": "[5]", "fn_name": "queue_time"}, {"input": "[2]\n5", "outp... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef likes cooking. But more than that, he likes to give gifts. And now he wants to give his girlfriend an un... | [{"input": "2\n3\n3 -2 3\n-1\n10", "output": "-18\n10\n"}, {"input": "2\n3\n3 -4 3\n-2\n10", "output": "-36\n10\n"}, {"input": "2\n3\n3 -4 0\n-2\n10", "output": "-12\n10\n"}, {"input": "2\n3\n3 -5 0\n-2\n10", "output": "-15\n10\n"}, {"input": "2\n3\n3 -5 1\n-2\n10", "output": "-16\n10\n"}, {"input": "2\n3\n5 -4 5\n1\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven few numbers, you need to print out the digits that are not being used.\n\nExample:\n\n```python\nunused... | [{"input": "1\n11\n111\n1111\n11111", "output": "[\"023456789\"]", "fn_name": "unused_digits"}, {"input": "364\n500\n715\n730", "output": "[\"289\"]", "fn_name": "unused_digits"}, {"input": "864\n896\n744", "output": "[\"01235\"]", "fn_name": "unused_digits"}, {"input": "93\n10\n11\n40", "output": "[\"25678\"]", "fn_na... | 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\nEach year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The co... | [{"input": "10 6 1 48\n239 632\n976 315\n797 112\n1 835\n938 862\n531 884\n422 607\n152 331\n413 677\n622 978\n", "output": "5 3788.56\n10 3673.36\n2 3360.12\n6 3289.08\n4 2606.20\n3 2598.64\n9 2525.24\n7 2315.84\n1 2210.84\n8 1184.72\n"}, {"input": "10 6 1 41\n239 632\n976 315\n797 112\n1 835\n938 862\n531 884\n422 60... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 have a twin brother or sister. Having another person that looks exactly like you seems very ... | [{"input": "100\n1 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 99 100\n", "output... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis kata is blatantly copied from inspired by This Kata\nWelcome\n\nthis is the second in the series of th... | [{"input": "\"String for test: incommensurability\"\n1", "output": "[\"ySttirliinbga rfuosrn etmemsotc:n i\"]", "fn_name": "string_func"}, {"input": "\"This is a string exemplification!\"\n0", "output": "[\"This is a string exemplification!\"]", "fn_name": "string_func"}, {"input": "\"this_test_will_hurt_you\"\n1234567... | 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 quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths le... | [{"input": "1000000000 2000000000 2\n", "output": "500000001\n"}, {"input": "200000000 2000000000 1800000011\n", "output": "1\n"}, {"input": "1500000000 2000000000 11\n", "output": "10389612\n"}, {"input": "1100000000 2000000000 2\n", "output": "450000001\n"}, {"input": "316274526 2000000000 1800000011\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\nServal is fighting with a monster.\nThe health of the monster is H.\nIn one attack, Serval can decrease the m... | [{"input": "10000 1\n", "output": "10000\n"}, {"input": "10000 10000\n", "output": "1\n"}, {"input": "11000 1", "output": "11000\n"}, {"input": "10010 1", "output": "10010\n"}, {"input": "10001 1", "output": "10001\n"}, {"input": "11010 1", "output": "11010\n"}, {"input": "10101 1", "output": "10101\n"}, {"input": "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\nMonocarp has arranged $n$ colored marbles in a row. The color of the $i$-th marble is $a_i$. Monocarp likes o... | [{"input": "100\n11 16 16 11 16 11 16 16 11 16 16 16 16 16 16 16 16 16 11 16 16 16 16 16 16 11 16 11 16 11 16 16 16 11 5 16 16 11 16 16 16 16 16 11 16 11 5 16 16 16 16 5 16 16 11 11 16 16 5 16 11 11 16 16 16 11 11 16 11 16 16 16 16 16 16 11 11 16 16 5 16 5 20 5 16 16 16 11 16 16 16 16 16 16 11 16 20 11 16 5\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 an array of n integer numbers a_0, a_1, ..., a_{n} - 1. Find the distance between two closest (... | [{"input": "85\n1 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 72 67 68 69 70 71 72 73 74 119 76 77 78 79 80 81 82 83 84 1\n", "output": "84\n"}, {"input": "85\n1 2 3 4 5 6 7 8 9 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\nAlice and Bob play ping-pong with simplified rules.\n\nDuring the game, the player serving the ball commences... | [{"input": "12\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n", "output": "0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n"}, {"input": "12\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n", "output": "0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n"}, {"input": "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\nAnton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that... | [{"input": "20\n-321 454\nQ 1369 -89\nR -811 454\nQ -404 454\nR -734 454\nQ -804 454\nQ -316 77\nQ -802 468\nB -499 602\nQ 401 -663\nQ -601 454\nQ -974 454\nB 710 298\nB -917 454\nB -555 -924\nQ -337 950\nR 501 40\nR 355 310\nB 1163 -374\nR -860 454\nR 839 -10\n", "output": "YES\n"}, {"input": "20\n-321 454\nQ 1369 -89... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 stores called Store 1, Store 2, \\cdots, Store N. Takahashi, who is at his house at time 0, is pl... | [{"input": "7 149\n0 25\n3 10\n2 4\n2 20\n3 22\n2 23\n1 2", "output": "4\n"}, {"input": "7 85\n0 25\n3 10\n2 4\n5 20\n3 22\n2 23\n1 18", "output": "3\n"}, {"input": "7 99\n0 25\n3 10\n2 4\n5 20\n3 22\n2 23\n1 18", "output": "3\n"}, {"input": "7 99\n0 25\n3 10\n2 4\n2 20\n3 22\n2 23\n1 18", "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\nProgrammer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the ... | [{"input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\ntypedef &&&&xzgzsamjdufuyx... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 cats. We number them from 1 through N.\n\nEach of the cats wears a hat. Cat i says: \"there are e... | [{"input": "5\n3 4 3 4 3", "output": "Yes\n"}, {"input": "5\n3 4 3 3 3", "output": "No\n"}, {"input": "4\n1 0 -1 2", "output": "No\n"}, {"input": "4\n1 0 -1 3", "output": "No\n"}, {"input": "4\n1 1 -1 3", "output": "No\n"}, {"input": "4\n1 2 -1 3", "output": "No\n"}, {"input": "4\n2 2 -1 3", "output": "No\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\n# Task\n Consider a `bishop`, a `knight` and a `rook` on an `n Γ m` chessboard. They are said to form a `tria... | [{"input": "40\n40", "output": "[92400]", "fn_name": "chess_triangle"}, {"input": "1\n30", "output": "[0]", "fn_name": "chess_triangle"}, {"input": "3\n3", "output": "[48]", "fn_name": "chess_triangle"}, {"input": "5\n2", "output": "[40]", "fn_name": "chess_triangle"}, {"input": "2\n3", "output": "[8]", "fn_name": "che... | 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\nThis is the easy version of the problem. The difference between the versions is in the constraints on the arr... | [{"input": "100\n92 42 58 62 24 59 62 100 92 62 54 100 62 82 91 62 100 100 62 100 100 62 92 92 92 62 92 92 62 92 62 92 88 100 100 36 62 92 16 92 62 100 62 92 35 62 100 92 92 62 93 100 100 62 76 100 62 62 92 62 92 50 100 8 7 62 100 18 92 62 92 92 100 62 32 92 92 62 37 76 100 39 62 92 62 41 62 62 19 57 100 37 92 99 100 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\nYou are given a string s consisting of lowercase English letters and a number k. Let's call a string consisti... | [{"input": "12\n12 3\nzazasqzqsasq\n1 2\ny\n1 1\na\n15 5\nabccbaabccbazaa\n16 8\ncadjfdsljfdkljds\n6 2\nbaazaa\n6 3\nbosszb\n6 1\nqwerty\n7 7\ndaaaaaa\n14 2\nacabcbdeffewzc\n18 6\nzzzzzzzzzzzzyyyyyz\n9 4\naabaabbbc\n", "output": "zazasqzqsasq\n-1\na\nabccbaabccbbaac\ncbbbbbbbbccccccc\nbaazbz\nbpbbpp\nqwerty\nddddddd\na... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 easy version of the problem. The only difference is that in this version q = 1. You can make hack... | [{"input": "100\n45 21 34 56 15 0 46 59 40 39 78 83 29 77 19 30 60 39 90 64 11 47 10 47 35 79 30 13 21 31 26 68 0 67 52 43 29 94 100 76 16 61 74 34 62 63 4 41 78 31 77 21 90 2 43 70 53 15 53 29 47 87 33 20 23 30 55 57 13 25 19 89 10 17 92 24 47 6 4 91 52 9 11 25 81 14 82 75 46 49 66 62 28 84 88 101 0 19 34 94\n0 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\nPolycarp must pay exactly $n$ burles at the checkout. He has coins of two nominal values: $1$ burle and $2$ b... | [{"input": "6\n1001\n42\n0\n131\n1000101010\n12\n", "output": "333 334\n14 14\n0 0\n43 44\n333367004 333367003\n4 4\n"}, {"input": "6\n1001\n42\n0\n131\n1000101010\n0\n", "output": "333 334\n14 14\n0 0\n43 44\n333367004 333367003\n0 0\n"}, {"input": "6\n1000\n30\n1\n32\n1000000000\n5\n", "output": "334 333\n10 10\n1 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\nGaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the army had n1 footmen and n2 ... | [{"input": "100 99 10 10\n", "output": "65210983\n"}, {"input": "100 100 9 10\n", "output": "67740290\n"}, {"input": "99 100 10 10\n", "output": "65210983\n"}, {"input": "100 100 10 10\n", "output": "950492\n"}, {"input": "100 99 10 4\n", "output": "41571840\n"}, {"input": "78 21 10 1\n", "output": "96098560\n"}, {"inp... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 integer coordinates x, y in the Cartesian plan and three functions f, g, h\ndefined by:\n```\nf: 1 <... | [{"input": "4000", "output": "[21341334000]", "fn_name": "sumin"}, {"input": "730", "output": "[129938905]", "fn_name": "sumin"}, {"input": "365", "output": "[16275715]", "fn_name": "sumin"}, {"input": "100", "output": "[338350]", "fn_name": "sumin"}, {"input": "15", "output": "[1240]", "fn_name": "sumin"}, {"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\nYou have been blessed as a child of Omkar. To express your gratitude, please solve this problem for Omkar!\n\... | [{"input": "2\n1412\n721\n", "output": "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 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 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVova decided to clean his room. The room can be represented as the coordinate axis $OX$. There are $n$ piles ... | [{"input": "5 8\n5 1 2 4 3\n0 1\n0 2\n0 3\n0 4\n0 5\n1 1000000000\n1 1\n1 500000000\n", "output": "3\n2\n1\n0\n0\n0\n0\n0\n499999999\n"}, {"input": "5 8\n5 1 2 4 3\n0 1\n0 2\n0 3\n0 4\n0 5\n1 1000000000\n1 1\n1 500000000\n", "output": "3\n2\n1\n0\n0\n0\n0\n0\n499999999\n"}, {"input": "5 4\n5 1 2 4 3\n0 1\n0 2\n0 3\n0 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\nYou are a coach of a group consisting of $n$ students. The $i$-th student has programming skill $a_i$. All st... | [{"input": "10\n5\n3 4 1 5 2\n2\n2 1\n4\n4 1 3 2\n5\n2 3 1 5 4\n2\n1 2\n4\n1 2 3 4\n2\n1 2\n4\n3 4 2 1\n3\n3 2 1\n1\n1\n", "output": "2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n"}, {"input": "10\n5\n3 4 1 5 2\n2\n2 1\n4\n4 1 3 2\n5\n2 3 1 5 4\n2\n1 2\n4\n1 2 3 4\n2\n1 2\n4\n3 4 2 1\n3\n3 2 1\n1\n1\n", "output": "2\n2\n2\n2\n2\n2\n2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is an easier version of the next problem. In this version, $q = 0$.\n\nA sequence of integers is called ... | [{"input": "100 0\n6 7 100 8 5 61 5 75 59 65 51 47 83 37 34 54 87 46 4 26 21 87 12 97 86 68 60 11 62 76 14 83 29 31 91 62 57 80 47 75 85 97 62 77 91 86 14 25 48 77 83 65 39 61 78 77 45 46 90 74 100 91 86 98 55 5 84 42 91 69 100 4 74 98 60 37 75 44 41 12 15 34 36 1 99 16 7 87 36 26 79 42 41 84 17 98 72 16 38 55\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\nVasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the sy... | [{"input": "100 10\n3 114 77 78 105 87 6 122 141 100 75 118 64 18 88 37 109 72 31 101 36 10 62 18 52 17 149 115 22 150 138 48 46 42 104 8 63 21 117 58 87 80 7 131 125 118 67 13 144 43 59 67 74 13 124 77 86 148 107 11 51 9 87 52 147 22 7 22 143 12 121 123 17 35 33 87 91 140 92 38 106 10 66 26 40 100 121 42 134 127 116 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\nThe game of Berland poker is played with a deck of $n$ cards, $m$ of which are jokers. $k$ players play this ... | [{"input": "4\n8 3 2\n4 2 4\n12 6 3\n42 0 7\n", "output": "3\n0\n3\n0\n"}, {"input": "4\n12 3 2\n4 2 4\n9 6 3\n42 0 7\n", "output": "3\n0\n1\n0\n"}, {"input": "4\n8 1 2\n4 2 4\n12 6 3\n66 0 7\n", "output": "1\n0\n3\n0\n"}, {"input": "4\n8 5 2\n4 2 4\n12 11 3\n7 0 9\n", "output": "3\n0\n0\n0\n"}, {"input": "4\n8 3 2\n4 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJou and Yae are a good couple. Jou is collecting prizes for capsule toy vending machines (Gachapon), and even... | [{"input": "2\n1 0\n3\n1 1 0\n1\n0000\n0", "output": "NA\nNA\nNA\n"}, {"input": "2\n3 2\n3\n0 1 1\n1\n0000\n0", "output": "3\nNA\nNA\n"}, {"input": "2\n1 0\n3\n0 1 1\n1\n1000\n0", "output": "NA\nNA\n2\n"}, {"input": "2\n1 0\n3\n0 4 0\n1\n0000\n0", "output": "NA\n2\nNA\n"}, {"input": "2\n1 0\n3\n2 1 0\n1\n0000\n0", "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\nThere is a long plate s containing n digits. Iahub wants to delete some digits (possibly none, but he is not ... | [{"input": "27755776656210607832788619414635535178188775623838313967013958143619017005079991285469853503718562504927535176713879737569375166451462839457844835806559098448980069427607\n151\n", "output": "319271478\n"}, {"input": "2775577665621060783278861941463553517818877562383831396701395814361901700507999128546985350... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 day, Chef prepared D brand new dishes. He named the i-th dish by a string Si. After the cooking, he decid... | [{"input": "3\ncdd\n_a_a\n_ed[", "output": "YES\nYES\nNO\n"}, {"input": "3\naba\nabac\naacd", "output": "YES\nNO\nNO\n"}, {"input": "3\nfda\n`a`a\nb`Ze", "output": "NO\nYES\nNO\n"}, {"input": "3\naba\nabac\ndaca", "output": "YES\nNO\nNO\n"}, {"input": "3\naba\nabac\ndaac", "output": "YES\nNO\nNO\n"}, {"input": "3\naba\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence of square brackets is regular if by inserting symbols \"+\" and \"1\" into it, you can get a regul... | [{"input": "100\n[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\n", "output": "+- -+\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\nGiven is a string S consisting of L and R.\nLet N be the length of S. There are N squares arranged from left ... | [{"input": "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don... | [{"input": "50 70\n3 3\n80 80\n23 23\n11 11\n87 87\n7 7\n63 63\n61 61\n67 67\n53 53\n9 9\n43 43\n55 55\n27 27\n5 5\n1 1\n99 99\n65 65\n37 37\n60 60\n32 32\n38 38\n81 81\n2 2\n34 34\n17 17\n82 82\n26 26\n71 71\n4 4\n16 16\n19 19\n39 39\n51 51\n6 6\n49 49\n64 64\n83 83\n10 10\n56 56\n30 30\n76 76\n90 90\n42 42\n47 47\n91... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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**This Kata is intended as a small challenge for my students**\n\nCreate a function, called ``removeVowels`` ... | [{"input": "\"scholarstem\"", "output": "[\"schlrstm\"]", "fn_name": "remove_vowels"}, {"input": "\"high fives!\"", "output": "[\"hgh fvs!\"]", "fn_name": "remove_vowels"}, {"input": "\"codewars\"", "output": "[\"cdwrs\"]", "fn_name": "remove_vowels"}, {"input": "\"drake\"", "output": "[\"drk\"]", "fn_name": "remove_vo... | 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\nAn isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that... | [{"input": "\"abcdefghijklmnopqrstuwwxyz\"", "output": "[false]", "fn_name": "is_isogram"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"thumbscrewjapingly\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"Dermatoglyphics\"", "output": "[true]", "fn... | 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\nRead problems statements in Mandarin Chinese and Russian. \n\nYesterday Chef had a great party and doesn't r... | [{"input": "10 3\n0324152397\n2\n3\n10", "output": "3\n3\n38\n"}, {"input": "10 3\n0324152397\n4\n3\n10", "output": "7\n3\n38\n"}, {"input": "10 3\n0324152397\n1\n3\n10", "output": "0\n3\n38\n"}, {"input": "10 3\n0324152397\n1\n4\n10", "output": "0\n7\n38\n"}, {"input": "10 3\n0324152397\n7\n3\n10", "output": "9\n3\n38... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 situated along the main road of Berland. Cities are represented by their coordinates β int... | [{"input": "20\n105619866 106083760 106090730 105809555 106115212 105155938 105979518 106075627 106145216 105637844 105925719 105498536 105927000 106155938 106134226 106125969 106130588 105464813 106145509 106114971\n", "output": "241 1\n"}, {"input": "20\n105619866 106083760 106090730 105809555 106115212 105155938 105... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 correct expression of the form a+b=c was written; a, b and c are non-negative integers without leading zero... | [{"input": "100277221476489181970323375139380435110027722147648918197032337513938043511002772214764891819703233751393804351100277221476489181970323375139380435120055444295297836394064675027876087022005544429529783639406467502787608702\n", "output": "1002772214764891819703233751393804351100277221476489181970323375139380... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 lives on a coordinate line at the point $x = 0$. He goes to his friend that lives at the point $x = ... | [{"input": "100 50 1\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20\n21 22\n23 24\n25 26\n27 28\n29 30\n31 32\n33 34\n35 36\n37 38\n39 40\n41 42\n43 44\n45 46\n47 48\n49 50\n51 52\n53 54\n55 56\n57 58\n59 60\n61 62\n63 64\n65 66\n67 68\n69 70\n71 72\n73 74\n75 76\n77 78\n79 80\n81 82\n83 84\n85 86\n87 88\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDaruma Otoshi\n\nYou are playing a variant of a game called \"Daruma Otoshi (Dharma Block Striking)\".\n\nAt ... | [{"input": "4\n1 2 3 4\n4\n1 2 3 1\n5\n5 0 3 3 6\n14\n11 7 1 4 3 5 0 1 6 13 10 4 11 5\n5\n1 3 5 2 3\n0", "output": "4\n4\n2\n6\n2\n"}, {"input": "4\n1 2 3 4\n4\n1 2 3 1\n5\n5 0 3 3 6\n14\n11 7 1 4 3 5 4 1 6 13 10 4 6 5\n5\n1 3 5 2 3\n0", "output": "4\n4\n2\n10\n2\n"}, {"input": "4\n1 2 3 4\n4\n1 2 3 1\n5\n5 0 3 3 6\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\nMethodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a k... | [{"input": "10\naaaa\naaaab\naaaa\nbaaaa\na\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\na\nb\naaaaa\naaaa\nabcdefghijklmnopqrstuvwxyz\nzabcdefghijklmnopqrstuvwxyz\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaba\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSunuke received a d-dimensional hypercube with a side length of l1 Γ ... Γ ld as a birthday present. Sunuke p... | [{"input": "5\n12\n27\n15\n17\n149\n123", "output": "867510000\n"}, {"input": "5\n12\n34\n15\n17\n149\n119", "output": "998784000\n"}, {"input": "5\n12\n34\n15\n23\n149\n119", "output": "300622393\n"}, {"input": "5\n12\n27\n15\n22\n149\n151", "output": "449835161\n"}, {"input": "5\n12\n34\n56\n17\n90\n123", "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 you have noticed, there are lovely girls in Arpaβs land.\n\nPeople in Arpa's land are numbered from 1 to n... | [{"input": "100\n84 94 72 32 61 90 61 2 76 42 35 82 90 29 51 27 65 99 38 41 44 73 100 58 56 64 54 31 14 58 57 64 90 49 73 80 74 19 31 86 73 44 39 43 28 95 23 5 85 5 74 81 34 44 86 30 50 57 94 56 53 42 53 87 92 78 53 49 78 60 37 63 41 19 15 68 25 77 87 48 23 100 54 27 68 84 43 92 76 55 2 94 100 20 92 18 76 83 100 99\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\nYuki made a sugoroku so that everyone can play at the children's association event. In this sugoroku, squares... | [{"input": "8\n2 -1 3 -1 1 4 -1 0", "output": "5\n"}, {"input": "8\n3 -1 3 -1 1 4 -1 0", "output": "6\n"}, {"input": "8\n3 -1 3 -1 2 4 -1 0", "output": "6\n"}, {"input": "8\n3 -1 3 -1 0 4 -1 0", "output": "7\n"}, {"input": "8\n3 -1 3 -1 0 4 -1 1", "output": "6\n"}, {"input": "8\n1 1 1 2 11 1 -2 1", "output": "8\n"}, {"... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.