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\nAfter reaching your destination, you want to build a new colony on the new planet. Since this planet has many... | [{"input": "20\n5 166\n11 21 31 41 51\n5 37\n11 21 31 41 51\n5 231\n11 21 31 41 51\n5 58\n11 21 31 41 51\n5 157\n11 21 31 41 51\n5 179\n11 21 31 41 51\n5 150\n11 21 31 41 51\n5 122\n11 20 27 37 47\n5 204\n11 21 31 41 51\n5 62\n3 13 23 8 43\n5 136\n43 58 51 86 34\n5 42\n31 25 62 45 100\n5 36\n20 26 37 5 69\n5 169\n41 99... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $S$, find the smallest sub-array ... | [{"input": "12 5\n0 2 0 3 10 7", "output": "1\n"}, {"input": "12 5\n1 2 0 3 10 7", "output": "1\n"}, {"input": "13 5\n1 2 0 3 10 7", "output": "1\n"}, {"input": "24 5\n1 2 0 3 10 7", "output": "1\n"}, {"input": "24 5\n1 2 1 3 10 7", "output": "1\n"}, {"input": "41 5\n1 2 1 3 10 7", "output": "1\n"}, {"input": "53 5\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\nJenny is 9 years old. She is the youngest detective in North America. Jenny is a 3rd grader student, so when ... | [{"input": "[1, 16, 21]\n\"A purple pig and a green donkey flew a kite in the middle of the night\"", "output": "[\"pen\"]", "fn_name": "missing"}, {"input": "[18, 25, 45]\n\"are you going to have a funnel birthday cake for your next birthday\"", "output": "[\"fix\"]", "fn_name": "missing"}, {"input": "[35, 8, 20]\n\"A... | 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: Periodic Sequence-\n\nproblem\n\nDr. Period, a professor at H University, is studying a property called th... | [{"input": "6\n-1 -14 10 -3 2 -1", "output": "1\n"}, {"input": "6\n-1 -14 18 -3 2 -1", "output": "1\n"}, {"input": "6\n-1 -14 18 -1 2 -1", "output": "1\n"}, {"input": "6\n-1 -10 18 -1 2 -1", "output": "1\n"}, {"input": "6\n0 -10 18 -2 -1 -2", "output": "1\n"}, {"input": "6\n-1 -10 8 -3 2 -1", "output": "1\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\nGenerous sponsors of the olympiad in which Chloe and Vladik took part allowed all the participants to choose ... | [{"input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000\n7 8\n5 10\n8 6\n1 5\n7 9\n3 9\n2 10\n2 6\n4 3\n", "output": "Impossible"}, {"input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -10000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBeroffice text editor has a wide range of features that help working with text. One of the features is an aut... | [{"input": "bababcdfabbcabcdfacbbabcdfacacabcdfacbcabcdfaccbabcdfacaaabcdfabacabcdfabcbabcdfacbaabcdfabaaabcdfabbaabcdfacababcdfabbbabcdfabcaabcdfaaababcdfabccabcdfacccabcdfaacbabcdfaabaabcdfaabcabcdfaaacabcdfaccaabcdfaabbabcdfaaaaabcdfaacaabcdfaacc\n", "output": "bababc dfabb cabc dfacb babc dfacacabc dfacb cabc dfacc... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 which accepts one arbitrary string as an argument, and return a string of length 26.\n\nThe... | [{"input": "\"&%&%/$%$%$%$%GYtf67fg34678hgfdyd\"", "output": "[\"00010111000000000001000010\"]", "fn_name": "change"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[\"11111111111111111111111111\"]", "fn_name": "change"}, {"input": "\"Abc e $$ z\"", "output": "[\"11101000000000000000000001\"]", "fn_name": "c... | 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 translation from the Berland language into the Birland language is not an easy task. Those languages are ... | [{"input": "vxpqullmcbegsdskddortcvxyqlbvxmmkhevovnezubvpvnrcajpxraeaxizgaowtfkzywvhnbgzsxbhkaipcmoumtikkiyyaivg\ngviayyikkitmuomcpiakhbxszgbnhvwyzkftwoagzixaearxpjacrnvpvbuzenvovehkmmxvblqyxvctroddksdsgebcmlluqpxv\n", "output": "YES\n"}, {"input": "dgxmzbqofstzcdgthbaewbwocowvhqpinehpjatnnbrijcolvsatbblsrxabzrpszoiecp... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 you finish this kata, you can try [Insane Coloured Triangles](http://www.codewars.com/kata/insane-coloured... | [{"input": "\"RBRGBRBGGRRRBGBBBGG\"", "output": "[\"G\"]", "fn_name": "triangle"}, {"input": "\"RBRGBRB\"", "output": "[\"G\"]", "fn_name": "triangle"}, {"input": "\"RGBG\"", "output": "[\"B\"]", "fn_name": "triangle"}, {"input": "\"RRR\"", "output": "[\"R\"]", "fn_name": "triangle"}, {"input": "\"GB\"", "output": "[\"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice and Bob decided to eat some fruit. In the kitchen they found a large bag of oranges and apples. Alice i... | [{"input": "420196140727489673 679891637638612258\n", "output": "1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B\n"}, {"input": "420196140727489673 679891637638612258\n", "output": "1B1A1B1A1B1A1B1... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these... | [{"input": "30\n-398 -1774\n313 -6974\n2346 -4657\n8552 -9647\n-5265 1538\n8195 4864\n-5641 -5219\n-1394 8563\n-1190 1992\n-4669 -1156\n7574 256\n9206 -2414\n4140 -549\n-294 2169\n7029 -2871\n3808 -9799\n3141 5690\n4648 -2680\n-5990 9800\n-2299 1697\n6077 -7177\n-400 -9724\n-4644 -2392\n-2198 -9531\n-2105 9386\n-8165 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRemember the movie with David Bowie: 'The Labyrinth'?\n\nYou can remember your childhood here: https://www.yo... | [{"input": "\"not True and False or False or False\"", "output": "[\"Knave! Do not trust.\"]", "fn_name": "knight_or_knave"}, {"input": "\"3 is 3 is 3 is 9\"", "output": "[\"Knave! Do not trust.\"]", "fn_name": "knight_or_knave"}, {"input": "\"4 is \\\"blue\\\"\"", "output": "[\"Knave! Do not trust.\"]", "fn_name": "kn... | 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\nMrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number!\n\nThe only ... | [{"input": "11110\n", "output": "11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 lists of segments $[al_1, ar_1], [al_2, ar_2], \\dots, [al_n, ar_n]$ and $[bl_1, br_1], [bl... | [{"input": "3\n3 5\n1 2\n3 4\n2 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"input": "3\n3 5\n1 2\n3 4\n1 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"input": "3\n3 2\n1 2\n3 4\n1 1000000000\n1 1\n999999999 999999999\n10 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\nVanya decided to walk in the field of size n × n cells. The field contains m apple trees, the i-th apple tree... | [{"input": "2 15 1 1\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 -1\n0 0\n0 0\n0 0\n", "output": "0 0\n"}, {"input": "2 15 1 1\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 -1\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0 0\n"}, {"input": "2 15 1 1\n0 0\n0 1\n0 0\n0 1\n0 0\n0 1\n0 0\n0 1\n0 0\n0 1\n0 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\nNastya received a gift on New Year — a magic wardrobe. It is magic because in the end of each month the numbe... | [{"input": "314647997243943415 107188213956410843\n", "output": "109575135\n"}, {"input": "314647997243943415 107188213956410843\n", "output": "109575135\n"}, {"input": "316313018463929883 108989792589951708\n", "output": "398397727\n"}, {"input": "1497482167524343307 29585639347346605\n", "output": "228961297\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\nYou are given a connected undirected graph consisting of $n$ vertices and $m$ edges. There are no self-loops ... | [{"input": "10 10\n9 2\n6 4\n2 10\n7 8\n8 6\n9 3\n2 6\n7 1\n7 4\n5 4\n", "output": "YES\n0010101000\n"}, {"input": "10 10\n1 3\n9 6\n4 5\n1 9\n8 6\n1 7\n3 2\n5 7\n5 3\n10 5\n", "output": "YES\n1001010110\n"}, {"input": "10 10\n4 3\n6 8\n5 3\n8 1\n2 9\n9 8\n3 6\n10 2\n9 3\n6 3\n", "output": "YES\n1110010111\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\nIt is a balmy spring afternoon, and Farmer John's n cows are ruminating about link-cut cacti in their stalls.... | [{"input": "100000 100000\n", "output": "4999950000\n"}, {"input": "100000 100000\n", "output": "4999950000\n"}, {"input": "100000 40000\n", "output": "4799960000\n"}, {"input": "100000 50000\n", "output": "4999950000\n"}, {"input": "100000 50001\n", "output": "4999950000\n"}, {"input": "100000 50002\n", "output": "499... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a number and your task will be to rearrange the number so that it is divisibl... | [{"input": "5000033333337", "output": "[16]", "fn_name": "solve"}, {"input": "7000033333335", "output": "[8]", "fn_name": "solve"}, {"input": "50011111112", "output": "[12]", "fn_name": "solve"}, {"input": "50001111312", "output": "[13]", "fn_name": "solve"}, {"input": "72046951686", "output": "[12]", "fn_name": "solve... | 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\nAsterix, Obelix and their temporary buddies Suffix and Prefix has finally found the Harmony temple. However, ... | [{"input": "btbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpmvbxbyszdugvmoyjeeqsywcvuqskcjotyhvdijyslgfvyujxthngnonasgnbzzygyikheelirdfsvuicbiazfdeqecbtbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpccdtdteoht... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 task is to write an update for a lottery machine. Its current version produces a sequence of random lett... | [{"input": "\"ffaQtaRFKeGIIBIcSJtg\"", "output": "[\"One more run!\"]", "fn_name": "lottery"}, {"input": "\"wQ8Hy0y5m5oshQPeRCkG\"", "output": "[\"805\"]", "fn_name": "lottery"}, {"input": "\"20191224isXmas\"", "output": "[\"20194\"]", "fn_name": "lottery"}, {"input": "\"HappyNewYear2020\"", "output": "[\"20\"]", "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\nZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contigu... | [{"input": "LLVYUOXHBHUZSAPUMQEKWSQAFRKSMEENXDQYOPQFXNNFXSRBGXFUIRBFJDSDKQIDMCPPTWRJOZCRHZYZPBVUJPQXHNALAOCJDTTBDZWYDBVPMNSQNVMLHHUJAOIWFSEJEJSRBYREOZKHEXTBAXPTISPGIPOYBFFEJNAKKXAEPNGKWYGEJTNEZIXAWRSCEIRTKNEWSKSGKNIKDEOVXGYVEVFRGTNDFNWIFDRZQEJQZYIWNZXCONVZAKKKETPTPPXZMIVDWPGXOFODRNJZBATKGXAPXYHTUUFFASCHOLSMVSWBIJBAENEG... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 permutation is a sequence of integers from 1 to n of length n containing each number exactly once. For exam... | [{"input": "100\n9 6 3 28 10 2 2 11 2 1 25 3 13 5 14 13 4 14 2 16 12 27 8 1 7 9 8 19 33 23 4 1 15 6 7 12 2 8 30 4 1 31 6 1 15 5 18 3 2 24 7 3 1 20 10 8 26 22 3 3 9 6 1 10 1 5 1 3 7 6 11 10 1 16 19 5 9 4 4 4 2 18 12 21 11 5 2 32 17 29 2 4 8 1 7 5 3 2 17 1\n", "output": "12\n1 1 1 1 1 1 2 1 3 1 1 2 1 1 1 2 1 2 4 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\nYou are given a sequence with N integers: A = \\{ A_1, A_2, \\cdots, A_N \\}.\nFor each of these N integers, ... | [{"input": "5\n10\n-1\n1\n13\n3", "output": "2\n"}, {"input": "5\n10\n-1\n6\n13\n3", "output": "3\n"}, {"input": "5\n10\n-1\n1\n13\n2", "output": "2\n"}, {"input": "5\n10\n-1\n6\n13\n5", "output": "3\n"}, {"input": "5\n10\n-1\n1\n13\n5", "output": "2\n"}, {"input": "5\n10\n-1\n6\n13\n6", "output": "3\n"}, {"input": "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\nBarney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1... | [{"input": "10\n2 37526406560905229 37526426361107171\n2 37526424114740747 18763396439955441\n2 300485276957081578 301492476099962199\n1 75035386466351570 441803674395985082 642312512\n2 300197522144700185 220954108245114486\n1 150105696341181576 559187296 100113944\n1 300197522135707767 150242638470761995 170574370\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\nVasya got really tired of these credits (from problem F) and now wants to earn the money himself! He decided ... | [{"input": "22 936\n20 743\n55 46\n83 282\n157 3\n168 979\n241 338\n293 113\n312 292\n333 509\n339 632\n345 149\n347 109\n384 846\n420 151\n619 923\n647 336\n706 935\n726 600\n760 45\n804 126\n810 739\n906 341\n", "output": " 3371\n"}, {"input": "22 936\n20 743... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 permutation p consisting of n integers 1, 2, ..., n (a permutation is an array where each ele... | [{"input": "4\n3\n1 2 1\n6\n1 3 2 6 2 4\n4\n4 1 3 2\n8\n3 2 1 6 7 8 2 4\n", "output": "YES\n-1 -2 1\nYES\n-1 -3 2 6 2 4\nYES\n-4 -1 -3 2\nYES\n-3 -2 1 6 7 -8 2 4\n"}, {"input": "4\n3\n1 2 3\n6\n1 0 2 6 5 4\n4\n4 1 3 2\n8\n3 2 1 6 7 8 5 4\n", "output": "YES\n1 2 3\nYES\n-1 0 2 -6 -5 4\nYES\n-4 -1 -3 2\nYES\n-3 -2 1 6 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\nWe have N cards numbered 1, 2, ..., N. Card i (1 \\leq i \\leq N) has an integer A_i written in red ink on on... | [{"input": "5\n28 15 22 43 30\n20 22 43 33 32", "output": "-1"}, {"input": "5\n28 15 22 43 31\n20 22 43 33 32", "output": "-1"}, {"input": "5\n11 15 22 43 30\n20 22 43 33 32", "output": "1"}, {"input": "5\n4 46 6 31 43\n33 15 18 27 37", "output": "3"}, {"input": "5\n4 26 6 31 43\n33 15 18 27 37", "output": "3"}, {"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\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherw... | [{"input": "2\n10000000 10000000\n", "output": "NO\n"}, {"input": "2\n10000100 10000000", "output": "YES\n"}, {"input": "2\n10000100 10001000", "output": "YES\n"}, {"input": "2\n10000100 10101000", "output": "YES\n"}, {"input": "2\n10010100 10101000", "output": "YES\n"}, {"input": "2\n10010100 10101001", "output": "YES... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIahub got bored, so he invented a game to be played on paper.\n He writes n integers a1, a2, ..., an. Each of... | [{"input": "[0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1]", "output": "[18]", "fn_name": "flipping_game"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]", "output": "[22]", "fn_name": "flipping_game"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... | 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\nTokitsukaze has two colorful tapes. There are $n$ distinct colors, numbered $1$ through $n$, and each color a... | [{"input": "1\n50\n4 50 11 27 15 29 2 9 12 39 31 1 6 17 32 28 7 24 36 3 18 49 37 35 33 21 48 19 26 5 20 45 14 13 34 40 42 16 44 43 41 25 38 23 30 10 22 8 47 46\n10 43 29 5 47 12 39 26 31 15 33 18 13 21 11 22 44 4 38 30 41 25 1 24 14 8 27 36 20 45 23 48 2 42 46 19 32 17 7 50 40 49 37 9 3 35 28 6 16 34\n", "output": "125... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLena is the most economical girl in Moscow. So, when her dad asks her to buy some food for a trip to the coun... | [{"input": "15\n1 18646259228611\n1 76062756486449\n1 5817259716888\n1 22110867828535\n1 100627485465221\n1 40799537235509\n1 56529154503793\n1 56148198559428\n1 77940886559829\n1 74079407528201\n1 6574734766207\n1 79264199999788\n1 19171266033881\n1 38437872037474\n1 34320923862986\n", "output": "30\n"}, {"input": "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\nIn CODE FESTIVAL XXXX, there are N+1 participants from all over the world, including Takahashi.\n\nTakahashi ... | [{"input": "3\n7 12 11", "output": "1\n"}, {"input": "3\n8 12 11", "output": "1\n"}, {"input": "3\n10 12 8", "output": "2\n"}, {"input": "3\n9 12 8", "output": "3\n"}, {"input": "3\n8 12 0", "output": "0\n"}, {"input": "3\n4 12 8", "output": "4\n"}, {"input": "2\n12 12", "output": "0\n"}, {"input": "3\n7 12 8", "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\nSnuke got positive integers s_1,...,s_N from his mother, as a birthday present. There may be duplicate elemen... | [{"input": "10\n1\n11\n100\n1000000007\n10000000100\n1000000009\n999999999\n1416\n999\n999", "output": "10"}, {"input": "10\n1\n11\n100\n1000000007\n10000000100\n1000000009\n999999999\n1416\n922\n999", "output": "10"}, {"input": "10\n1\n11\n100\n1000000007\n10000000100\n1000000009\n999999999\n1416\n922\n613", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power... | [{"input": "1074", "output": "1024\n"}, {"input": "1023", "output": "1000\n"}, {"input": "1298", "output": "1296\n"}, {"input": "1357", "output": "1331\n"}, {"input": "1746", "output": "1728\n"}, {"input": "999\n", "output": "961\n"}, {"input": "610", "output": "576\n"}, {"input": "159", "output": "144\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\nHaving read half of the book called \"Storm and Calm\" on the IT lesson, Innocentius was absolutely determine... | [{"input": "DaABYAOivguEueXufuoUeoiLiuEuEIeZAdoPgaUIIrUtoodAALPESiUaEbqitAphOIIEAogrjUBZLnIALGbazIermGEiAAdDAOFaaizopuUuuEugOHsXTAelFxAyZXWQXiEEKkGiIVdUmwiThDOiEyiuOEaiIAAjEQyaEuOiUGOuuzvaIEUEAhXEuOliOeEkJuJaUaszUKePiQuwXSuoQYEeUOgOeuyvOwhUuitEEKDVOaUaoiaIyiAEkyXeuiEkUorUYCaOXEAiUYPnUMaURebouLUOiOojcOeODaaIeEeuukDvpiIk... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 and Alice are often participating in various programming competitions. Like many competitive programmers,... | [{"input": "372839920 992839201 1000000000\n100293021 1262614379 999999993\n", "output": "619999282\n"}, {"input": "372839920 992839201 1000000000\n100293021 773829394 999999993\n", "output": "619999282\n"}, {"input": "372839920 992839201 1000000000\n100293021 773829394 999999993\n", "output": "619999282\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\nDice Stamp\n\nDice stamp\n\nAt a local fair, you found a game store you've never seen before. This is a game ... | [{"input": "1\n0 0\n1 2 3 4 5 6\nRRRRBBBBLLLLFFFF\n2\n0 0\n1 1 1 1 1 1\nRRR\n2 2\n100 100 100 100 100 101\nFFF\n1\n1010 -1000\n1 2 3 4 5 6\nLFRB\n4\n-3 -4\n1 2 3 4 5 6\nBBBBBBBB\n4 -3\n11 12 13 14 15 16\nLLLLLLLL\n3 4\n21 22 23 24 25 26\nFFFFFFFF\n-4 3\n31 32 33 34 35 36\nRRRRRRRR\n3\n-2 -2\n9 3 1 1 1 1\nRRRRBLLLBRRBLB... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in... | [{"input": "5\n5\n1\n2\n-1\n10", "output": "3\n"}, {"input": "5\n5\n1\n0\n-1\n10", "output": "2\n"}, {"input": "5\n5\n1\n0\n-1\n11", "output": "2\n"}, {"input": "5\n8\n1\n0\n-1\n11", "output": "2\n"}, {"input": "5\n8\n2\n0\n-1\n11", "output": "2\n"}, {"input": "5\n11\n1\n1\n0\n11", "output": "2\n"}, {"input": "5\n14\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\nproblem\n\nHanako is playing with n (4 ≤ n ≤ 10) cards side by side. Each card has one integer between 1 and ... | [{"input": "4\n2\n-1\n3\n10\n1\n6\n2\n133\n1\n15\n6\n0\n-1\n0\n0", "output": "12\n30\n"}, {"input": "4\n2\n1\n3\n22\n2\n6\n4\n11\n3\n12\n10\n2\n1\n0\n0", "output": "11\n308\n"}, {"input": "4\n4\n1\n7\n42\n0\n6\n3\n126\n3\n43\n7\n1\n2\n0\n0", "output": "24\n120\n"}, {"input": "4\n2\n-1\n10\n12\n2\n6\n3\n72\n2\n12\n7\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\nPetya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learni... | [{"input": "150\n48 115 13 9 105 117 41 136 123 32 84 95 62 50 140 106 145 91 57 141 139 35 45 27 129 63 137 10 37 60 44 30 101 119 138 78 22 103 39 134 49 36 25 12 28 67 69 99 148 26 16 87 146 65 8 74 14 38 47 89 81 19 40 11 64 43 110 66 102 3 122 124 100 2 125 42 97 73 121 7 52 23 29 109 1 70 34 108 59 55 127 90 88 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\nOn a certain meeting of a ruling party \"A\" minister Pavel suggested to improve the sewer system and to crea... | [{"input": "9 37\n.......#................#.##...#.....\n..#......................##..........\n..#......#.........#.................\n..........#..#..#..#...........#.....\n...#............#..##.#.....##.......\n......................#..............\n......#........##....#......#........\n........#....................... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort... | [{"input": "1000000000\n", "output": "white\n1 2\n"}, {"input": "1000000000\n", "output": "white\n1 2\n"}, {"input": "1000000010\n", "output": "white\n1 2\n"}, {"input": "1823733270\n", "output": "white\n1 2\n"}, {"input": "1381061568\n", "output": "white\n1 2\n"}, {"input": "1091549244\n", "output": "white\n1 2\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a[0 \\ldots n - 1] = [a_0, a_1, \\ldots, a_{n - 1}]$ of zeroes and ones only. Note th... | [{"input": "5\n2 2\n0 1\n3 2\n1 1 1\n5 2\n1 1 0 0 0\n4 1\n0 0 0 0\n1 1\n1\n", "output": "-1\n-1\n1\n0\n-1\n"}, {"input": "5\n2 1\n1 1\n3 1\n0 1 0\n5 3\n1 1 0 0 0\n4 4\n1 1 0 0\n1 1\n1\n", "output": "-1\n1\n1\n-1\n-1\n"}, {"input": "5\n2 1\n0 1\n3 3\n0 1 0\n5 3\n1 1 1 1 0\n4 4\n0 1 0 0\n1 1\n1\n", "output": "1\n-1\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\nPolycarpus is sure that his life fits the description: \"first there is a white stripe, then a black one, the... | [{"input": "4000 2000 2219\n", "output": " 865711019"}, {"input": "4000 1244 4000\n", "output": " 344837886"}, {"input": "4000 1244 2881\n", "output": " 8905... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 and B are preparing themselves for programming contests.\n\nAfter several years of doing sports programming... | [{"input": "-2 -2 2 1 4 0 -2 4 5 4 -5 -5 2 1 1 -1 0 -5 -2 3 -2 4 5 2 3 -5\nqgzhbkitmqwttdyoyvcbxincwjryzknubpacsngorexaldfurondbednowemnnlphhboycfavsovisrmfaefusoobingjhsmrukx\n", "output": "7\n"}, {"input": "-2 -2 2 1 4 0 -2 4 5 4 -5 -5 2 1 1 -1 0 -5 -2 3 -2 4 5 2 3 -5\nqgzhbkitmqwttdyoyvcbxincwjryzknubpacsngorexaldfu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed fo... | [{"input": "10 300 100\n35 25 110 40 60 7 44 145 23 96\n", "output": "6\n"}, {"input": "10 300 100\n35 42 110 40 60 7 44 145 23 96\n", "output": "6\n"}, {"input": "10 300 100\n35 42 110 40 60 7 26 145 23 96\n", "output": "6\n"}, {"input": "10 300 100\n35 42 110 40 60 7 26 158 23 96\n", "output": "6\n"}, {"input": "10 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\nBerland year consists of $m$ months with $d$ days each. Months are numbered from $1$ to $m$. Berland week con... | [{"input": "5\n6 7 1\n10 12 11\n12 30 6\n1 1 1\n3247834 10298779 625324\n", "output": "15\n45\n6\n0\n116461800\n"}, {"input": "5\n6 7 4\n10 9 16\n12 17 4\n0 1 1\n7341628 25065973 296620\n", "output": "6\n16\n66\n0\n359753922\n"}, {"input": "5\n6 10 1\n10 7 12\n12 30 6\n1 1 1\n3247834 3741802 625324\n", "output": "15\n9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArkady's morning seemed to be straight of his nightmare. He overslept through the whole morning and, still ha... | [{"input": "2\n64 23 81 66 95 91 56 12 48 24 78 36 67 57 75 88 82 98 83 46 100 58 62 80 8 4 28 74 70 50 42 11 68 18 19 6 94 59 13 72 37 31 90 41 60 34 86 55 76 69 32 21 73 84 3 52 92 79 61 63 38 87 17 14 29\n65 89 14 93 58 60 80 64 28 91 70 48 19 55 75 21 100 98 88 69 7 42 41 81 8 76 54 87 16 56 53 29 71 9 37 62 61 73 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the po... | [{"input": "5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n", "output": "6\n"}, {"input": "5 10 10\n2 5\n4 5\n2 3\n5 5\n2 4\n5 4\n5 1\n1 1\n4 5\n1 4", "output": "6\n"}, {"input": "5 10 10\n2 5\n4 5\n2 3\n5 5\n2 4\n5 4\n5 1\n1 1\n4 1\n1 4", "output": "6\n"}, {"input": "5 10 10\n2 5\n4 5\n2 1\n3 5\n2 2\n5 4\n5... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. ... | [{"input": "100 1000000000 42 97\n2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2\n", "output": "590949100\n"}, {"input": "100 1000000000 42 97\n2 5 1 8 8 1 5 2 1 2 5 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\nTransformation\n\n\n\n\nWrite a program which performs a sequence of commands to a given string $str$. The co... | [{"input": "abcde\n3\nreplace 1 0 xy{\nreverse 0 2\nprint 1 6", "output": "xa{bcd\n"}, {"input": "abcde\n3\nreplace 1 0 xy{\nreverse 0 1\nprint 1 6", "output": "ay{bcd\n"}, {"input": "abcde\n3\nreplace 1 3 xyz\nreverse 0 2\nprint 0 4", "output": "yxaze\n"}, {"input": "xy{\n3\nprint 0 2\nreplace 2 2 abb\nprint 0 4", "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\nConsider a sequence made up of the consecutive prime numbers. This infinite sequence would start with: \n```p... | [{"input": "30\n12", "output": "[\"616771737983\"]", "fn_name": "solve"}, {"input": "20\n9", "output": "[\"414347535\"]", "fn_name": "solve"}, {"input": "40\n8", "output": "[\"83899710\"]", "fn_name": "solve"}, {"input": "10000\n5", "output": "[\"02192\"]", "fn_name": "solve"}, {"input": "20000\n5", "output": "[\"09334... | 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 a description of a lever as string s. We'll represent the string length as record |s|, then the leve... | [{"input": "==88=^95==83=45===8====73===7==7====1=29====29=8=85=\n", "output": "right\n"}, {"input": "==88=^95==83=45===8====73===7==7====1=39====29=8=85=\n", "output": "right\n"}, {"input": "==88=^=5==83=45===8====73==97==7====1=39====29=8=85=\n", "output": "right\n"}, {"input": "==88=^95==83=45===8====73===7==7====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\nD: Sunburn-Suntan-\n\nstory\n\nAizunyan is a second-year student who belongs to the programming contest club ... | [{"input": "20\n1\n-1 12", "output": "13\n"}, {"input": "20\n1\n-1 19", "output": "20\n"}, {"input": "20\n1\n0 19", "output": "19\n"}, {"input": "20\n1\n0 12", "output": "12\n"}, {"input": "20\n1\n0 28", "output": "20\n"}, {"input": "20\n1\n1 15", "output": "14\n"}, {"input": "20\n1\n1 19", "output": "18\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\nRead problems statements in Mandarin Chinese and Russian. \nSome chefs go for a tour lasting N days. They ta... | [{"input": "3\n3 4\n12 1 2\n1 1\n2\n2 1\n23 1", "output": "4\n2\n24\n"}, {"input": "3\n3 4\n10 2 -1\n1 1\n1\n2 4\n12 2", "output": "4\n1\n4\n"}, {"input": "3\n3 4\n12 1 2\n1 1\n2\n2 1\n26 1", "output": "4\n2\n27\n"}, {"input": "3\n3 9\n6 -1 4\n1 1\n1\n2 1\n27 0", "output": "2\n1\n27\n"}, {"input": "3\n3 9\n6 -1 4\n1 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\nPolycarp remembered the $2020$-th year, and he is happy with the arrival of the new $2021$-th year. To rememb... | [{"input": "5\n1\n4041\n4042\n8081\n8079\n", "output": "\nNO\nYES\nYES\nYES\nNO\n"}, {"input": "5\n1\n4041\n4042\n8081\n8079\n", "output": "NO\nYES\nYES\nYES\nNO\n"}, {"input": "5\n1\n4041\n4042\n12391\n8079\n", "output": "NO\nYES\nYES\nNO\nNO\n"}, {"input": "5\n1\n4041\n4042\n8081\n4273\n", "output": "NO\nYES\nYES\nYE... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nExample\n\nInput\n\n1+2*3+4\n11\n\n\nOutput\n\nM### Format: Read the inputs from stdin solve the problem and ... | [{"input": "4+1*3+0\n104", "output": "I\n"}, {"input": "4+1*3+0\n102", "output": "I\n"}, {"input": "0+3*1+4\n104", "output": "I\n"}, {"input": "0+3*1+4\n129", "output": "I\n"}, {"input": "3*1+0*4\n12", "output": "L\n"}, {"input": "1+2+3+4\n11", "output": "I\n"}, {"input": "1+2*3+4\n14", "output": "I\n"}, {"input": "4+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\nThere is a country with $n$ citizens. The $i$-th of them initially has $a_{i}$ money. The government strictly... | [{"input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 2 4 7 10 3 7 9 9 \n"}, {"input": "10\n7 9 4 4 7 6 3 7 9 10\n10\n1 4 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 4 2 7 10 3 7 9 9\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\nHongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a ... | [{"input": "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy\n", "output": "25\n"}, {"input": "zyzzzyyzyyyzyyzyzyzyzyzzzyyyzzyzyyzzzzzyyyzzzzyzyy\n", "output": "50\n"}, {"input": "aaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaab\n", "output": "25\n"}, {"input": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx\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\nVasya studies music. \n\nHe has learned lots of interesting stuff. For example, he knows that there are 12 no... | [{"input": "F# F# F#\n", "output": "strange\n"}, {"input": "D# D# F#\n", "output": "strange\n"}, {"input": "G# G# A\n", "output": "strange\n"}, {"input": "G# C# D\n", "output": "strange\n"}, {"input": "F D# G#\n", "output": "strange\n"}, {"input": "B C# C#\n", "output": "strange\n"}, {"input": "F# H F#\n", "output": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMeka-Naruto plays a computer game. His character has the following ability: given an enemy hero, deal $a$ ins... | [{"input": "6\n1411352 712902 579689 383030\n997653 839911 351405 69197\n31160 1580030 281506 245835\n234837 489356 452352 448472\n382561 916024 805514 657373\n287796 831046 710305 568719\n", "output": "1411352\n997653\n31160\n234837\n382561\n287796\n"}, {"input": "6\n1411352 712902 579689 383030\n997653 839911 351405 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 undirected unweighted graph consisting of $n$ vertices and $m$ edges (which represents the m... | [{"input": "2\n4 3 2 3 4\n2 4 3\n1 2\n1 3\n1 4\n7 9 1 5 7\n2 10 4 8 5 6 7 3 3\n1 2\n1 3\n1 4\n3 2\n3 5\n4 2\n5 6\n1 4\n6 7\n", "output": "11\n12\n"}, {"input": "2\n4 3 2 3 4\n1 5 3\n1 2\n1 3\n1 4\n7 9 2 5 7\n3 10 4 8 5 8 7 3 3\n2 2\n2 3\n1 4\n3 2\n3 5\n4 3\n5 6\n1 4\n6 7\n", "output": "10\n13\n"}, {"input": "2\n4 3 2 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 playing a game where your character should overcome different obstacles. The current problem is to co... | [{"input": "28\n8 4\n8 7 6 3\n8 5\n8 7 6 3 1\n8 5\n8 7 6 3 2\n8 6\n8 7 6 3 2 1\n8 4\n8 7 6 4\n8 5\n8 7 6 4 1\n8 5\n8 7 6 4 2\n8 6\n8 7 6 4 2 1\n8 5\n8 7 6 4 3\n8 6\n8 7 6 4 3 1\n8 6\n8 7 6 4 3 2\n8 7\n8 7 6 4 3 2 1\n8 4\n8 7 6 5\n8 5\n8 7 6 5 1\n8 5\n8 7 6 5 2\n8 6\n8 7 6 5 2 1\n8 5\n8 7 6 5 3\n8 6\n8 7 6 5 3 1\n8 6\n8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer sequence of length N. The i-th term in the sequence is a_i. In one operation, you ca... | [{"input": "5\n113 -2 -1 0 -1", "output": "120\n"}, {"input": "5\n113 -2 -1 1 -1", "output": "121\n"}, {"input": "5\n113 -1 -1 1 -2", "output": "119\n"}, {"input": "5\n106 -1 -1 1 -5", "output": "112\n"}, {"input": "6\n9 0 -11 1 -2 -1", "output": "25\n"}, {"input": "6\n-1 2 -40 1 -2 4", "output": "39\n"}, {"input": "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\nLittle Petya has recently started attending a programming club. Naturally he is facing the problem of choosin... | [{"input": "14391752689956519300788497161416904648305096969559656916798920426154191397931561980203179360129309381\n", "output": "BigInteger\n"}, {"input": "11271203439111662452647816080492937379011458047735472400976277474953429583477559167812276320735634783\n", "output": "BigInteger\n"}, {"input": "13710824100893639035... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCount the number of divisors of a positive integer `n`.\n\nRandom tests go up to `n = 500000`.\n\n## Examples... | [{"input": "4096", "output": "[13]", "fn_name": "divisors"}, {"input": "12", "output": "[6]", "fn_name": "divisors"}, {"input": "25", "output": "[3]", "fn_name": "divisors"}, {"input": "30", "output": "[8]", "fn_name": "divisors"}, {"input": "1", "output": "[1]", "fn_name": "divisors"}, {"input": "4", "output": "[3]", ... | 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\nLittle Sofia is in fourth grade. Today in the geometry lesson she learned about segments and squares. On the ... | [{"input": "1000000000\n", "output": "63246\n"}, {"input": "1000000000\n", "output": "63246\n"}, {"input": "1010000000\n", "output": "63561\n"}, {"input": "1550090838\n", "output": "78743\n"}, {"input": "1237445143\n", "output": "70355\n"}, {"input": "1010100000\n", "output": "63565\n"}, {"input": "1214137855\n", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA programming contest is held every year at White Tiger University. When the total number of teams is N, each... | [{"input": "3 4 600\n3 100 5\n1 200 14\n2 400 20\n3 500 20", "output": "1\n"}, {"input": "3 4 600\n3 100 5\n1 200 14\n2 400 20\n3 500 8", "output": "1\n"}, {"input": "3 4 600\n3 100 5\n1 200 11\n2 400 20\n3 500 8", "output": "1\n"}, {"input": "3 4 600\n3 100 5\n1 80 10\n2 400 20\n3 500 20", "output": "1\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\nMany cats live on the campus of a school. Natsume's daily routine is to pet those cats. However, the cats may... | [{"input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n41 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\n"}, {"input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n55 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\n"}, {"input": "2\n1 3 20 10\n4\n15 13\n1 15\n10 10\n25 10\n1 3 20 10\n4\n21 13\n1 15\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\n## The Story\nGreen Lantern's long hours of study and practice with his ring have really paid off -- his skil... | [{"input": "\"pAlEgOlDeNrOd\"", "output": "[\"LightGreen\"]", "fn_name": "yellow_be_gone"}, {"input": "\"lemonchiffon\"", "output": "[\"PaleGreen\"]", "fn_name": "yellow_be_gone"}, {"input": "\"BlueViolet\"", "output": "[\"BlueViolet\"]", "fn_name": "yellow_be_gone"}, {"input": "\"GOLD\"", "output": "[\"ForestGreen\"]"... | 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 a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\nYou will now successive... | [{"input": "2\n1 2\n3\n1 100\n2 100\n100 1000\n", "output": "102\n200\n2000\n"}, {"input": "2\n1 2\n3\n1 100\n2 000\n100 1000", "output": "102\n100\n1000\n"}, {"input": "2\n1 2\n3\n1 100\n2 001\n100 1000", "output": "102\n101\n1001\n"}, {"input": "2\n1 2\n3\n1 100\n1 001\n100 1000", "output": "102\n102\n1002\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\nThere are $ n $ acitivities with start times $ \\\\ {s_i \\\\} $ and finish times $ \\\\ {t_i \\\\} $. Assumi... | [{"input": "5\n1 2\n10 2\n-1 4\n1 2\n3 12", "output": "3\n"}, {"input": "5\n1 2\n10 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"input": "5\n1 2\n12 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"input": "5\n1 2\n10 2\n0 4\n1 2\n3 12", "output": "3\n"}, {"input": "5\n3 2\n5 2\n0 4\n1 7\n6 12", "output": "3\n"}, {"input": "5\n1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's call an array $t$ dominated by value $v$ in the next situation.\n\nAt first, array $t$ should have at l... | [{"input": "4\n1\n1\n6\n1 2 3 4 5 1\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n6\n3\n2\n"}, {"input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n5\n3\n2\n"}, {"input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 4 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n5\n2\n2\n"}, {"input": "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\nZS the Coder and Chris the Baboon are travelling to Udayland! To get there, they have to get on the special I... | [{"input": "61\nOX|XX\nOX|XX\nOX|XX\nXO|XO\nXX|XO\nXX|XX\nXX|XX\nOX|XX\nXO|XO\nOX|XO\nXO|OX\nXX|XX\nXX|XX\nOX|OX\nXX|OX\nOX|XO\nOX|XO\nXO|OX\nXO|XX\nOX|XX\nOX|XX\nXO|OX\nXO|XX\nXO|XX\nOX|XX\nXX|XX\nXX|XO\nXO|XX\nXX|XX\nXO|OX\nXX|XO\nXO|XX\nXO|XO\nXO|OX\nXX|OX\nXO|OX\nOX|XX\nXX|OX\nXX|XX\nOX|XO\nOX|XX\nXO|OX\nOX|XX\nOX|... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 weighted graph G(V, E) and a source r, find the source shortest path to each vertex from the sour... | [{"input": "8 6 1\n0 1 1\n0 2 4\n2 0 1\n0 2 2\n3 1 1\n3 2 5", "output": "INF\n0\nINF\nINF\nINF\nINF\nINF\nINF\n"}, {"input": "8 6 1\n0 1 1\n0 2 4\n0 0 1\n1 2 2\n3 0 2\n3 2 5", "output": "INF\n0\n2\nINF\nINF\nINF\nINF\nINF\n"}, {"input": "8 6 2\n0 2 1\n0 2 2\n2 0 1\n1 0 0\n3 1 1\n3 2 5", "output": "1\nINF\n0\nINF\nINF\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\nToad Pimple has an array of integers $a_1, a_2, \\ldots, a_n$.\n\nWe say that $y$ is reachable from $x$ if $x... | [{"input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 4\n", "output": "Shi\nShi\nShi\n"}, {"input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 5\n", "output": "Shi\nShi\nShi\n"}, {"input": "5 3\n1 3 -1 2 1\n1 3\n2 4\n1 4\n", "output": "Shi\nShi\nShi\n"}, {"input": "5 3\n1 3 -1 2 0\n1 3\n2 5\n1 4\n", "output": "Shi\nFou\nShi\n"}, {"input": "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\nA sequence $a_1, a_2, \\dots, a_k$ is called an arithmetic progression if for each $i$ from $1$ to $k$ elemen... | [{"input": "6\n-658647496 -999999999 -1000000000 -999999996 -999999997 -1117017479\n", "output": "-1\n"}, {"input": "6\n-999999998 -999999999 -1000000000 -999999995 -999999997 -999999995\n", "output": "-1\n"}, {"input": "6\n-999999998 -999999999 -1000000000 -999999996 -999999997 -1117017479\n", "output": "6\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\nYou are given an array $a$ consisting of $n$ integers. For each $i$ ($1 \\le i \\le n$) the following inequal... | [{"input": "1\n100\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 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 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 2 2 2 2 2 2 2 2 0 2 2 2\n", "output": "0 4\n"}, {"input": "5\n4\n1 2 -1 2\n3\n1 1 -2\n5\n2 0 -2 2 -1\n3\n-2 -1 -1\n3\n-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\nTakahashi is playing a board game called Sugoroku.\nOn the board, there are N + 1 squares numbered 0 to N. Ta... | [{"input": "99810 49281\n0000001101101010010101110010010001111110101100000010000011100010010010010011110111000000011101110000000100010000100110110001010100101001000101110010111101110111100011100011110010101000011011100100010101010011010110011011111111100101011000100100110000001110011000010100110011001001111100100101100... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 2050 Conference, some people from the competitive programming community meet together and are going to... | [{"input": "3\n5\n1 2 3 1 2\n4\n11 2 28 5\n1\n998244353\n", "output": "11\n8\n1\n"}, {"input": "3\n5\n1 2 3 0 1\n4\n11 3 28 5\n1\n998244353\n", "output": "10\n8\n1\n"}, {"input": "3\n5\n1 2 3 1 2\n4\n11 2 15 5\n1\n998244353\n", "output": "11\n7\n1\n"}, {"input": "3\n5\n2 1 2 1 1\n4\n11 2 2 2\n1\n1749992475\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\nproblem\n\nTaro bought 10 books. Later, I tried to find out the price based on the receipt, but the receipt w... | [{"input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3134\n980\n0", "output": "-1078\n"}, {"input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3265\n980\n0", "output": "-1209\n"}, {"input": "9850\n1050\n800\n481\n380\n600\n1164\n2400\n3265\n980\n0", "output": "-1270\n"}, {"input": "9850\n1050\n800\n481\n380\n600\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\nMr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Busin... | [{"input": "2\n-100 -20 100 20\n-20 -100 18 100\n2\n-100 -20 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"input": "2\n-100 -20 100 20\n-20 -100 20 100\n2\n-100 -34 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"input": "2\n-100 -20 100 20\n-20 -100 18 100\n2\n-100 -20 -20 -100\n20 100 100 33\n0", "output": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAs usual, Sereja has array a, its elements are integers: a[1], a[2], ..., a[n]. Let's introduce notation:\n\n... | [{"input": "116 10\n477 -765 -756 376 -48 -75 768 -658 263 -207 362 -535 96 -960 630 -686 609 -830 889 57 -239 346 -298 -18 -107 853 -607 -443 -517 371 657 105 479 498 -47 432 503 -917 -656 610 -466 216 -747 -587 -163 -174 493 -882 853 -582 -774 -477 -386 610 -58 557 968 196 69 610 -38 366 -79 574 170 317 332 189 158 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhile playing yet another strategy game, Mans has recruited $n$ Swedish heroes, whose powers which can be rep... | [{"input": "11\n559227829 -118401759 491756598 -50857099 491152214 -500410377 141179566 -414122877 144131087 -460846619 791017750\n", "output": "3779030445\n"}, {"input": "11\n559227829 -118401759 491756598 -50857099 491152214 -500410377 141179566 -723654625 144131087 -460846619 791017750\n", "output": "4088562193\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\nSnuke got an integer sequence of length N from his mother, as a birthday present. The i-th (1 ≦ i ≦ N) elemen... | [{"input": "5\n10\n8\n10\n6\n2", "output": "1\n"}, {"input": "5\n10\n8\n10\n9\n2", "output": "1\n"}, {"input": "5\n10\n8\n10\n7\n2", "output": "1\n"}, {"input": "5\n10\n8\n10\n9\n1", "output": "1\n"}, {"input": "5\n10\n8\n10\n7\n1", "output": "1\n"}, {"input": "5\n20\n8\n10\n6\n2", "output": "1\n"}, {"input": "5\n10\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\n- Input: Integer `n`\n- Output: String\n\nExample:\n\n`a(4)` prints as\n```\n A \n A A \n A A A \nA ... | [{"input": "30", "output": "[\" A \\n A A \\n A A \\n A A \\n A A ... | 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\nWrite a function which takes one parameter representing the dimensions of a checkered board. The board will a... | [{"input": "100", "output": "[\"\\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 \\u25a1 \\u25a0 ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N integers, A_1, A_2, ..., A_N, written on a blackboard.\n\nWe will repeat the following operation ... | [{"input": "3\n8 -4 10", "output": "22\n-4 8\n10 -12\n"}, {"input": "3\n1 -2 10", "output": "13\n-2 1\n10 -3\n"}, {"input": "3\n2 -2 10", "output": "14\n-2 2\n10 -4\n"}, {"input": "3\n2 -4 10", "output": "16\n-4 2\n10 -6\n"}, {"input": "3\n4 -4 10", "output": "18\n-4 4\n10 -8\n"}, {"input": "3\n4 -4 18", "output": "26\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA new Berland businessman Vitaly is going to open a household appliances' store. All he's got to do now is to... | [{"input": "1000 2 1363\n", "output": "2726\n1 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\nIvan wants to play a game with you. He picked some string $s$ of length $n$ consisting only of lowercase Lati... | [{"input": "18\nd\nh\ndj\nxh\ndjs\njxh\ndjsh\nzjxh\ndjshf\nkzjxh\ndjshfk\nhkzjxh\ndjshfkj\nkhkzjxh\ndjshfkje\nskhkzjxh\ndjshfkjeh\ndskhkzjxh\ndjshfkjehd\nhdskhkzjxh\ndjshfkjehds\nehdskhkzjxh\ndjshfkjehdsk\njehdskhkzjxh\ndjshfkjehdskh\nkjehdskhkzjxh\ndjshfkjehdskhk\nfkjehdskhkzjxh\ndjshfkjehdskhkz\nhfkjehdskhkzjxh\ndjsh... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 its argument and returns a Chinese numeral string. You don't need to... | [{"input": "-99999.999", "output": "[\"\\u8d1f\\u4e5d\\u4e07\\u4e5d\\u5343\\u4e5d\\u767e\\u4e5d\\u5341\\u4e5d\\u70b9\\u4e5d\\u4e5d\\u4e5d\"]", "fn_name": "to_chinese_numeral"}, {"input": "99999.999", "output": "[\"\\u4e5d\\u4e07\\u4e5d\\u5343\\u4e5d\\u767e\\u4e5d\\u5341\\u4e5d\\u70b9\\u4e5d\\u4e5d\\u4e5d\"]", "fn_name"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two strings a and b. You have to remove the minimum possible number of consecutive (standing on... | [{"input": "bbbbaabbababbaaaaababbaaabbbbaaabbbababbbbabaabababaabaaabbbabababbbabababaababaaaaa\nbbabaaaabaaaabbaaabbbabaaabaabbbababbbbbbbbbbabbababbaababbbaaabababababbbbaaababaaaaab\n", "output": "bbbbbbbabbababbaababbbaaabababababbbbaaababaaaaab\n"}, {"input": "bbbbaabbababbaaaaababbaaabbbbaaabbbababbbbabaabababaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage conne... | [{"input": "315", "output": "1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n6\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n7\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n6\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\nThe Aizu Wakamatsu city office decided to lay a hot water pipeline covering the whole area of the city to hea... | [{"input": "3 5\n12 15 70 19 44\n16 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\n19 5\n21\n0 0", "output": "43\n"}, {"input": "3 5\n12 15 70 19 44\n30 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\n19 5\n21\n0 0", "output": "43\n"}, {"input": "3 5\n12 15 70 19 44\n9 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\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\nIndian summer is such a beautiful time of the year! A girl named Alyona is walking in the forest and picking ... | [{"input": "17\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbltscqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDZY has a sequence a, consisting of n integers.\n\nWe'll call a sequence ai, ai + 1, ..., aj (1 ≤ i ≤ j ≤ n) ... | [{"input": "50\n804289384 846930887 681692778 714636916 957747794 424238336 719885387 649760493 596516650 189641422 25202363 350490028 783368691 102520060 44897764 967513927 365180541 540383427 304089173 303455737 35005212 521595369 294702568 726956430 336465783 861021531 59961394 89018457 101513930 125898168 131176230... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a top secret mission to Mars has taken place. As a result, scientists managed to obtain some informa... | [{"input": "853332331434235 35 77\nBy\nhs\nzB\njs\nIr\nEa\nHG\nxb\nxG\nFp\nAC\nDt\nwo\nFB\nzh\nim\ntx\nyi\ngC\nkp\njz\ndc\nwE\naa\nsG\nng\ncr\npB\nCg\ncv\nxs\nDn\ndg\nyj\nCd\naC\nIi\ngH\nml\nww\nAD\nir\nti\nEr\nCj\nHt\nAe\nsn\naH\nHv\nan\nDf\nGn\nfC\nay\ngB\nlh\nup\nda\nzs\nbh\nHB\nHd\nmg\nzy\nGi\nzm\nHq\nac\nCB\niE\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\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he ... | [{"input": "cgayikejwockvntzlvpsfjtzlqfhoqoiahcodvinogbpuxhvohhcvhzmidloliztdhrntxqurzqjztjmwpylaknjncowkeuikhgc\n", "output": "30\n"}, {"input": "pgfqwbxjygkpqanpkicpaxfgeembvdgtllvtiyamxfpwtknorxxvonpntkwcffyjtvwlqgvvbzmmgfgkwezkemmxpagyihbkqidk\n", "output": "32\n"}, {"input": "ytmltbhwcqlwaliqyxgowpinxvugmgpzzahkhl... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 rational number n\n\n``` n >= 0, with denominator strictly positive``` \n\n- as a string (example: \... | [{"input": "\"0.66\"", "output": "[[\"1/2\", \"1/7\", \"1/59\", \"1/5163\", \"1/53307975\"]]", "fn_name": "decompose"}, {"input": "\"16/17\"", "output": "[[\"1/2\", \"1/3\", \"1/10\", \"1/128\", \"1/32640\"]]", "fn_name": "decompose"}, {"input": "\"1001/3456\"", "output": "[[\"1/4\", \"1/26\", \"1/848\", \"1/2381184\"]... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.