Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
1
1
ground_truth
stringlengths
82
619k
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\nThere are three cards with letters $\\texttt{a}$, $\\texttt{b}$, $\\texttt{c}$ placed in a row in some order....
[{"input": "6\nabc\nabc\nabc\nabc\nabc\nabc\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\n", "testtype": "stdin"}, {"input": "6\nabc\nacb\nbac\nbca\ncab\ncba\n", "output": "YES\nYES\nYES\nNO\nNO\nYES\n", "testtype": "stdin"}, {"input": "5\ncab\nacb\ncba\nbac\nbca\n", "output": "NO\nYES\nYES\nYES\nNO\n", "testtype": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSlavic is preparing a present for a friend's birthday. He has an array $a$ of $n$ digits and the present will...
[{"input": "9\n9\n1 3 1 2 3 6 5 9 4\n8\n4 9 0 5 5 0 6 6\n7\n9 0 6 3 2 5 0\n6\n6 0 1 3 1 6\n2\n8 2\n9\n5 8 5 9 7 8 9 8 5\n5\n8 0 1 2 3\n9\n0 0 2 2 5 8 2 8 7\n7\n9 8 1 6 5 2 5\n", "output": "38880\n0\n0\n108\n24\n43545600\n48\n0\n43200", "testtype": "stdin"}, {"input": "9\n6\n6 1 8 4 9 1\n4\n4 6 9 4\n1\n5\n2\n7 6\n6\n4 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a strip of paper $s$ that is $n$ cells long. Each cell is either black or white. In an operatio...
[{"input": "8\n6 3\nWBWWWB\n7 3\nWWBWBWW\n5 4\nBWBWB\n5 5\nBBBBB\n8 2\nBWBWBBBB\n10 2\nWBBWBBWBBW\n4 1\nBBBB\n3 2\nWWW\n", "output": "2\n1\n2\n1\n4\n3\n4\n0\n", "testtype": "stdin"}, {"input": "9\n2 2\nBW\n4 3\nWBBB\n7 2\nWBBWWBB\n5 5\nBBWBW\n6 2\nBWWWBW\n2 1\nBB\n2 1\nBW\n8 2\nBBBWWWBB\n2 1\nWB\n", "output": "1\n1\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\nYou are given an array of integers $a_1, a_2, \\ldots, a_n$ and a number $k$ ($2 \\leq k \\leq 5$). In one op...
[{"input": "15\n2 5\n7 3\n3 3\n7 4 1\n5 2\n9 7 7 3 9\n5 5\n5 4 1 2 3\n7 4\n9 5 1 5 9 5 1\n3 4\n6 3 6\n3 4\n6 1 5\n3 4\n1 5 9\n4 4\n1 4 1 1\n3 4\n3 5 3\n4 5\n8 9 9 3\n2 5\n1 6\n2 5\n10 10\n4 5\n1 6 1 1\n2 5\n7 7\n", "output": "2\n2\n1\n0\n2\n0\n1\n2\n0\n1\n1\n4\n0\n4\n3\n", "testtype": "stdin"}, {"input": "4\n10 5\n7 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\nVanya and Vova are playing a game. Players are given an integer $n$. On their turn, the player can add $1$ to...
[{"input": "100\n201\n202\n203\n204\n205\n206\n207\n208\n209\n210\n211\n212\n213\n214\n215\n216\n217\n218\n219\n220\n221\n222\n223\n224\n225\n226\n227\n228\n229\n230\n231\n232\n233\n234\n235\n236\n237\n238\n239\n240\n241\n242\n243\n244\n245\n246\n247\n248\n249\n250\n251\n252\n253\n254\n255\n256\n257\n258\n259\n260\n261...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlex is participating in the filming of another video of BrMeast, and BrMeast asked Alex to prepare 250 thous...
[{"input": "6\n6\n18671599 50973273 23725187 3824814 84745199 57521244\n4\n20571575 73545751 34416072 14351717\n6\n90850673 78650040 83258092 20508774 3086408 28307030\n6\n57339113 81072852 983952 94978897 27205027 20367934\n8\n91658582 42067089 85344456 18324259 27881026 89323807 16089314 35448469\n9\n84246488 6056139...
code_stdio
[ { "content": "You are an expert Python programmer. 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 subarray is a continuous part of array.\n\nYarik recently found an array $a$ of $n$ elements and became ver...
[{"input": "7\n5\n1 2 3 4 5\n4\n9 9 8 8\n6\n-1 4 -1 0 5 -4\n4\n-1 2 4 -3\n1\n-1000\n3\n101 -99 101\n20\n-10 5 -8 10 6 -10 7 9 -2 -6 7 2 -4 6 -1 7 -6 -7 4 1\n", "output": "15\n17\n8\n4\n-1000\n101\n10\n", "testtype": "stdin"}, {"input": "1\n1\n-737\n", "output": "-737", "testtype": "stdin"}, {"input": "1\n2\n-1 -1\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYarik is a big fan of many kinds of music. But Yarik loves not only listening to music but also writing it. H...
[{"input": "7\n74\n56845840 239859052 608123628 818147659 366869143 254413226 84194707 581092257 233243305 634857375 69134050 611489097 866450455 884740174 217455827 593699679 806299390 439574432 113071647 983870667 879599133 97043809 417543274 684931483 115428280 729099918 648157935 929806685 571779040 996008917 59265...
code_stdio
[ { "content": "You are an expert Python programmer. 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 0-indexed array of strings details. Each element of details provides information about a give...
[{"input": "[\"9675739045O7352\", \"0069321315F3934\", \"7675616641F8567\", \"1752234081O7913\", \"5381188774F8123\", \"5677958465M4051\", \"1503144167O5214\", \"4455687417M8204\", \"4575862561M2136\", \"3091744924F6282\", \"0165853975M8805\", \"6519153173F4583\", \"9928356944O3843\", \"5817381775F5256\", \"0720375692M...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations...
[{"input": "[[677, 457, 892], [483, 110, 349], [283, 449, 683], [21, 888, 700], [478, 33, 211], [966, 236, 834]]", "output": "2257", "testtype": "functional", "fn_name": "matrixSum"}, {"input": "[[234, 492, 348, 635, 971, 194, 505], [889, 873, 244, 938, 737, 6, 488]]", "output": "4396", "testtype": "functional", "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\nYou are given a 0-indexed integer array nums of length n and an integer k. In an operation, you can choose an...
[{"input": "[3761]\n12", "output": "15405056", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[95041]\n6", "output": "6082624", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[8, 1, 2]\n2", "output": "35", "testtype": "functional", "fn_name": "maximumOr"}, {"input": "[1217]\n5", "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\nYou are given a 0-indexed integer array nums representing the score of students in an exam. The teacher would...
[{"input": "[-9, -9, -6, -7, -3, -7, -6, -4, -1, -9, -2, -2, -3]", "output": "185177664", "testtype": "functional", "fn_name": "maxStrength"}, {"input": "[3, -1, -5, 2, 5, -9]", "output": "1350", "testtype": "functional", "fn_name": "maxStrength"}, {"input": "[-9, 1, 1, 0, -1, 9]", "output": "81", "testtype": "function...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed string s and a dictionary of words dictionary. You have to break s into one or more...
[{"input": "\"frickzggjkpukhvnxcobqspnnaalkjvpnmrhmzikjupzldsxb\"\n[\"gupaoxiattxtctlpcbylcdxfhflzatdmhtcyqzlwop\", \"snuzxkpxvfixrcubmlnjpnhxdeaypnlldwhcynwojktkb\", \"ahugmldkaeqxzdwpblcnbxuxfzrockdqlkepmbivvpwzpsjgj\", \"ssudvtzsdlxgucfc\", \"zlropnfwuk\", \"smalwustqjpmqlrcebiywjybpxvrbbzppudyzsuxy\", \"xhzeprgszla...
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 an integer array prices representing the prices of various chocolates in a store. You are also ...
[{"input": "[100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51]\n100", "output": "100", "testtype": "functional", "fn_name": "buyChoco"}, {"input": "[45, 48, 16, 23, 42, ...
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 numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x ...
[{"input": "\"3046150261507503990489\"\n\"7775829181095068737136\"\n127\n169", "output": "157138097", "testtype": "functional", "fn_name": "count"}, {"input": "\"738081037827515190649\"\n\"2197300974439040693603\"\n147\n196", "output": "258362773", "testtype": "functional", "fn_name": "count"}, {"input": "\"96748399701...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed array nums of length n.\nThe distinct difference array of nums is an array diff of ...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]", "output": "[-48, -46, -44, -42, -40, -38, -36, -34, -32, -30, -28, -26, -24, -22, -20, -18, -16, -14, -12, -10, -8...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).\nYou a...
[{"input": "10000\n[[3955, 88699], [425, 41496], [5146, 66827], [768, 16401], [6832, 21568], [1164, 19519], [7325, 39099], [8396, 67868], [8443, 52996], [3696, 64920], [6818, 98709], [2107, 92863], [9727, 58141], [2454, 21739], [4149, 55484], [683, 3763], [900, 46124], [6302, 88794], [6884, 43443], [9207, 19490], [5419...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group o...
[{"input": "[10, 22, 39, 51]", "output": "592263", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[565291574]", "output": "380741766", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[1, 3, 9, 3, 6]", "output": "4114", "testtype": "functional", "fn_name": "sumOfPower"}, {"input": "[50, 7,...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed permutation of n integers nums.\nA permutation is called semi-ordered if the first ...
[{"input": "[1, 28, 39, 12, 14, 6, 15, 27, 17, 38, 45, 16, 25, 37, 26, 44, 46, 10, 33, 40, 35, 4, 32, 34, 11, 9, 21, 43, 41, 48, 22, 30, 42, 50, 8, 29, 23, 5, 49, 13, 7, 3, 24, 20, 2, 31, 19, 36, 18, 47]", "output": "16", "testtype": "functional", "fn_name": "semiOrderedPermutation"}, {"input": "[50, 49, 48, 47, 46, 45...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a 0-indexed string s that consists of digits from 0 to 9.\nA string t is called a semi-repetiti...
[{"input": "\"58957479549437162345618928832412218355982224525842\"", "output": "32", "testtype": "functional", "fn_name": "longestSemiRepetitiveSubstring"}, {"input": "\"19431832444439006895006189596466887181869887222990\"", "output": "16", "testtype": "functional", "fn_name": "longestSemiRepetitiveSubstring"}, {"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\nThere are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n...
[{"input": "50\n50", "output": "[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]", "testtype": "functional", "fn_name": "circularGameLosers"}, {"input": "50\n25", "output": "[2, 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\nA 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a b...
[{"input": "[1, 0, 1, 1, 0]", "output": "false", "testtype": "functional", "fn_name": "doesValidArrayExist"}, {"input": "[1, 1, 0, 1]", "output": "false", "testtype": "functional", "fn_name": "doesValidArrayExist"}, {"input": "[0, 1, 1, 0]", "output": "true", "testtype": "functional", "fn_name": "doesValidArrayExist"},...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string s consisting only of uppercase English letters.\nYou can apply some operations to this...
[{"input": "\"GKLUQTVRWNPSLJBXHNHKNWOGKIYQFUEAYGXWZURCTJLUVQJFIOLIYQVIIKKSTOKDQMIWQBUCEOCQYEGNIVRORJLZJUUUXTPVUUPG\"", "output": "100", "testtype": "functional", "fn_name": "minLength"}, {"input": "\"ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD\"", "output": "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\nGiven a positive integer n, return the punishment number of n.\nThe punishment number of n is defined as the ...
[{"input": "948", "output": "5915179", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "879", "output": "3353149", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "898", "output": "3353149", "testtype": "functional", "fn_name": "punishmentNumber"}, {"input": "661", "output": "120...
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 0-indexed integer arrays, cost and time, of size n representing the costs and the time take...
[{"input": "[527025, 765058, 423943, 625196, 905794, 791238, 33620, 548527, 52955, 609172, 441089, 623435, 629019, 257321, 113490, 551514, 788738, 978232, 816919, 882244, 524373, 202224, 779743, 627369, 756404, 838411, 255361, 187958, 875474, 370743, 403807, 767851, 478850, 414691, 258717, 940413, 214019, 439422, 73569...
code_functional
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
36