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\nYou are given a set of n points on the plane. A line containing the origin is called good, if projection of t... | [{"input": "50\n-38 -107\n-34 -75\n-200 -143\n-222 -139\n-34 55\n-102 -79\n48 -99\n2 -237\n-118 -167\n-56 -41\n10 17\n68 -89\n-32 41\n-100 -93\n84 -1\n86 -15\n46 -145\n-58 -117\n8 31\n-36 -61\n-12 21\n-116 79\n88 -205\n70 -103\n-78 -37\n106 -5\n-96 -201\n-60 -103\n-54 45\n-138 -177\n-178 -47\n-154 -5\n-138 83\n44 -131\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 teacher at a cram school for elementary school pupils.\n\nOne day, you showed your students how to ... | [{"input": "2 6\n1 16\n3 9\n2 334\n34 79\n0 0", "output": "0 1\n4 0\n0 1\n0 166\n0 13\n"}, {"input": "3 8\n1 5\n3 10\n2 218\n36 198\n0 0", "output": "3 0\n1 0\n1 0\n0 108\n0 2\n"}, {"input": "2 6\n1 16\n3 15\n2 200\n34 62\n0 0", "output": "0 1\n4 0\n1 0\n2 0\n0 15\n"}, {"input": "2 6\n1 16\n2 15\n2 200\n34 62\n0 0", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef has gone shopping with his 5-year old son. They have bought N items so far. The items are numbered from ... | [{"input": "2\n5 4\n12 2 5 0 18\n8 3\n4 -2 1 1 1 0 1 2", "output": "37\n10\n"}, {"input": "2\n5 4\n12 2 5 0 18\n8 3\n2 -1 1 1 1 0 1 1", "output": "37\n6\n"}, {"input": "2\n5 4\n12 2 5 0 18\n8 3\n2 -2 1 1 1 0 1 1", "output": "37\n7\n"}, {"input": "2\n5 1\n6 8 5 1 10\n8 3\n4 1 1 0 2 1 0 -1", "output": "28\n10\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\nThere are 2N squares arranged from left to right. You are given a string of length 2N representing the color ... | [{"input": "5\nWWVWWWWWWW", "output": "0\n"}, {"input": "4\nBWWWBBWB", "output": "288\n"}, {"input": "5\nWWVWWWWWWX", "output": "0\n"}, {"input": "5\nWWVWWWXWWX", "output": "0\n"}, {"input": "5\nWWVVWWXWWX", "output": "0\n"}, {"input": "5\nWXWWWWWWWW", "output": "0\n"}, {"input": "5\nWWVWWXWWWW", "output": "0\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given positive integers A and B.\nFind the K-th largest positive integer that divides both A and B.\n... | [{"input": "100 100 1\n", "output": "100\n"}, {"input": "100 50 4\n", "output": "5\n"}, {"input": "96 96 12\n", "output": "1\n"}, {"input": "60 60 11\n", "output": "2\n"}, {"input": "93 31 1\n", "output": "31\n"}, {"input": "100 50 2", "output": "25\n"}, {"input": "100 50 3", "output": "10\n"}, {"input": "132 36 1", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string... | [{"input": "a\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string and your task is to determine if that string can be a palindrome if ... | [{"input": "\"qponmlkjihgfeeiefghijklmnopqrsttsr\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"432612345665\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"223456776543\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"zazcbaabc\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"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\nYou are given $n$ segments on a coordinate line; each endpoint of every segment has integer coordinates. Some... | [{"input": "1\n0 1000000000000000000\n", "output": "1000000000000000001 \n"}, {"input": "1\n1 1000000000000000000\n", "output": "1000000000000000000 \n"}, {"input": "1\n0 1000000000000000000\n", "output": "1000000000000000001\n"}, {"input": "1\n2 1000000000000000000\n", "output": "999999999999999999 \n"}, {"input": "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\nCreate an OR function, without use of the 'or' keyword, that takes an list of boolean values and runs OR agai... | [{"input": "[false, false, false, false, false, false]", "output": "[false]", "fn_name": "alt_or"}, {"input": "[false, false, false, false, false, true]", "output": "[true]", "fn_name": "alt_or"}, {"input": "[false, false, false, false, true, false]", "output": "[true]", "fn_name": "alt_or"}, {"input": "[false, false, ... | 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\nSnuke has four cookies with deliciousness A, B, C, and D. He will choose one or more from those cookies and e... | [{"input": "45445415 46908390 31865171 30402196\n", "output": "Yes\n"}, {"input": "93407609 30427494 56229544 81174201\n", "output": "No\n"}, {"input": "76041209 81456309 25817729 23366690\n", "output": "No\n"}, {"input": "97957785 12940168 86812983 92704508\n", "output": "No\n"}, {"input": "63214004 4741111 4654151 63... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas ligh... | [{"input": ")?(??((???????()?(?????????)??(????????((?)?????)????)??????(?????)?)?????)??????(??()??????)????????)?)()??????????????())????????(???)??)????????????????????(?????)??)???)??(???????????????)???)??)?\n", "output": "8314\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\nIlya plays a card game by the following rules.\n\nA player has several cards. Each card contains two non-nega... | [{"input": "100\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 0\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\n0 1\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\nIgor is in 11th grade. Tomorrow he will have to write an informatics test by the strictest teacher in the sch... | [{"input": "18\n2 3\n2 3\n2 3\n3 4\n1 4\n3 4\n160570 255604\n3 4\n3 5\n4 5\n1 5\n1 3\n1 2\n1 2\n113836 489816\n1 4\n2 4\n233746 254500\n", "output": "1\n1\n1\n1\n2\n1\n3271\n1\n2\n1\n1\n1\n1\n1\n17237\n2\n2\n3823\n"}, {"input": "14\n1 2\n51649 234369\n3 5\n2 4\n4 5\n2 3\n178731 226389\n1 2\n2 4\n185546 371108\n4 5\n4 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\nFind the longest substring within a string that contains at most 2 unique characters.\n\n```\nsubstring(\"a\"... | [{"input": "\"aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbccccccccccccccccccccddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffgggggggggggggggggggghhhhhhhhhhhhhhhhhhhhiiiiiiiiiiiiiiiiiiiijjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkkkkkkkkkllllllllllllllllllllmmmmmmmmmmmmmmmmmmmmnnnnnnnnnnnnnnnnnnnnoooooooooooooooooooopppppp... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem\n\nThere are n vertices that are not connected to any of the vertices.\nAn undirected side is stretch... | [{"input": "-11 14", "output": "287\n"}, {"input": "-14 17", "output": "449\n"}, {"input": "-11 18", "output": "393\n"}, {"input": "-1 20", "output": "207\n"}, {"input": "-6 11", "output": "128\n"}, {"input": "-3 14", "output": "131\n"}, {"input": "-6 21", "output": "343\n"}, {"input": "-7 21", "output": "369\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is the length of the string.\n\nYou are given a string $s$... | [{"input": "ziurxtzxixmsmewfuffsqdkpphssdcgybwtmzavkosqtmcntspzvftqybaldjllvgttblectspqinfdhhnpvkcbwjlqlquajueqsgymyekuswjctumsbnvvaiinxjlzcnyixfaykolkeogufvzvhnatqtelgjkqfvexghiznwubwihjkznkhepjzrnyzftmimqtlihpn\nzurzximmewfuffskppsdcybwmzavkosqtmctspvftybaljlgtltsqinfdhhpvkcwjlqlqymykusctumsbnvvainxjlcyxfykokeguvvhat... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to v... | [{"input": "26 919241245\n302193 763904252\n302152 990010704\n453347 786598325\n302156 614790744\n151113 552970041\n151053 935503943\n453339 788648514\n453340 819457698\n604398 992471599\n453342 141598754\n302166 998869126\n151098 158907792\n453293 724150038\n604414 436248800\n604434 447578562\n151038 922548042\n302224... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 program that outputs all leap years between the year a and year b.\n\nThe leap year conditions are a... | [{"input": "265 2171\n1686 3636\n2001 2275\n0 0", "output": "268\n272\n276\n280\n284\n288\n292\n296\n304\n308\n312\n316\n320\n324\n328\n332\n336\n340\n344\n348\n352\n356\n360\n364\n368\n372\n376\n380\n384\n388\n392\n396\n400\n404\n408\n412\n416\n420\n424\n428\n432\n436\n440\n444\n448\n452\n456\n460\n464\n468\n472\n476\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSimon has a rectangular table consisting of n rows and m columns. Simon numbered the rows of the table from t... | [{"input": "5 50\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have invented a time-machine which has taken you back to ancient Rome. Caeser is impressed with your prog... | [{"input": "\"This is a message\"\n0", "output": "[\"THIS IS A MESSAGE\"]", "fn_name": "caeser"}, {"input": "\"who are you?\"\n18", "output": "[\"OZG SJW QGM?\"]", "fn_name": "caeser"}, {"input": "\"final one\"\n9", "output": "[\"ORWJU XWN\"]", "fn_name": "caeser"}, {"input": "\"..5tyu..\"\n25", "output": "[\"..5SXT..\... | 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\nIahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor... | [{"input": "30\n2 1\n3 2\n4 3\n5 3\n6 5\n7 3\n8 3\n9 2\n10 3\n11 2\n12 11\n13 6\n14 4\n15 5\n16 11\n17 9\n18 14\n19 6\n20 2\n21 19\n22 9\n23 19\n24 20\n25 14\n26 22\n27 1\n28 6\n29 13\n30 27\n1 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 0\n0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 0\n", "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 string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into s... | [{"input": "9999999999\n", "output": "12656242944\n"}, {"input": "9999999999", "output": "12656242944"}, {"input": "1333", "output": "1952\n"}, {"input": "1455", "output": "2280\n"}, {"input": "1573", "output": "2576\n"}, {"input": "1479", "output": "2400\n"}, {"input": "2515", "output": "3452\n"}, {"input": "125\n", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a set of $n$ discs, the $i$-th disc has radius $i$. Initially, these discs are split among $m$ tower... | [{"input": "10 10\n2 10 8 7 9 3 4 6 5 1\n10 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n8\n7\n6\n6\n4\n2\n0\n"}, {"input": "10 10\n2 10 8 7 9 3 4 6 5 1\n10 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n8\n7\n6\n6\n4\n2\n0\n"}, {"input": "10 10\n2 10 8 7 9 3 4 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\nG: Palindromic Subsequences\n\nproblem\n\nGiven a string S consisting only of lowercase letters, find out how... | [{"input": "ccpa", "output": "4\n"}, {"input": "cnbc", "output": "6\n"}, {"input": "emec", "output": "5\n"}, {"input": "ccoa", "output": "4\n"}, {"input": "aocc", "output": "4\n"}, {"input": "pcca", "output": "4\n"}, {"input": "ccao", "output": "4\n"}, {"input": "pcda", "output": "4\n"}, {"input": "ccbo", "output": "4\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have an N \\times N square grid.\nWe will paint each square in the grid either black or white.\nIf we pain... | [{"input": "19\n100\n", "output": "261\n"}, {"input": "10\n202", "output": "-102\n"}, {"input": "19\n110", "output": "251\n"}, {"input": "10\n-13", "output": "113\n"}, {"input": "10\n-16", "output": "116\n"}, {"input": "10\n145", "output": "-45\n"}, {"input": "10\n174", "output": "-74\n"}, {"input": "10\n199", "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 new pack of n t-shirts came to a shop. Each of the t-shirts is characterized by three integers p_{i}, a_{i}... | [{"input": "20\n414468312 20329584 106106409 584924603 666547477 670032002 726095027 276840253 368277336 940941705 531635095 213813062 440421387 959075599 240727854 495316522 838268432 786936631 586382273 806443734\n3 1 2 3 3 2 2 1 3 2 3 2 3 3 3 2 1 3 1 2\n3 1 2 2 2 2 3 1 2 3 2 1 1 2 3 1 2 3 3 2\n40\n1 1 2 1 3 2 3 1 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\n*Inspired by the [Fold an Array](https://www.codewars.com/kata/fold-an-array) kata. This one is sort of simil... | [{"input": "[3, 234, 25, 345, 45, 34, 234, 235, 345, 34, 534, 45, 645, 645, 645, 4656, 45, 3]\n4", "output": "[[1040, 7712]]", "fn_name": "split_and_add"}, {"input": "[23, 345, 345, 345, 34536, 567, 568, 6, 34536, 54, 7546, 456]\n20", "output": "[[79327]]", "fn_name": "split_and_add"}, {"input": "[32, 45, 43, 23, 54, 2... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA binary matrix is called good if every even length square sub-matrix has an odd number of ones. \n\nGiven a ... | [{"input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n1110110010101111001110010001100010001010100011111110110100\n", "output": "27\n"}, {"input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n1110110010101111001110010001100010001010100011111110110100\n", "output": "27"}, {"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\nWe have two integers: A and B.\nPrint the largest number among A + B, A - B, and A \\times B.\n\n-----Constra... | [{"input": "100 100\n", "output": "10000\n"}, {"input": "-96 -16\n", "output": "1536\n"}, {"input": "36 80\n", "output": "2880\n"}, {"input": "-76 39\n", "output": "-37\n"}, {"input": "-13 3\n", "output": "-10\n"}, {"input": "50 -24\n", "output": "74\n"}, {"input": "1 -33\n", "output": "34\n"}, {"input": "13 3\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\nA tourist is visiting Byteland. The tourist knows English very well. The language of Byteland is rather diffe... | [{"input": "5 qwertyuiopasdfghjklzxcvbnm\nPh\nisscP\nBpke_kdc_epclc_jcijsc_mihyo?\nEpcf_kdc_liswhyo_EIED_hy_Vimcvpcn_Zkdvp_siyo_viyecle.\nIpp!", "output": "Hi\nolleH\nWhat are these people doing?\nThey are solving TOTR in Codechef March long contest.\nOhh!\n"}, {"input": "5 qwertyuiopasdfghjklzxcvbnm\nPh\nisscP\nBpke_k... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# Introduction \n\nA grille cipher was a technique for encrypting a plaintext by writing it onto a sheet of p... | [{"input": "\"tcddoadepwweasresd\"\n77098", "output": "[\"codewars\"]", "fn_name": "grille"}, {"input": "\"abcdef\"\n5", "output": "[\"df\"]", "fn_name": "grille"}, {"input": "\"ab\"\n255", "output": "[\"ab\"]", "fn_name": "grille"}, {"input": "\"abcde\"\n32", "output": "[\"\"]", "fn_name": "grille"}, {"input": "\"abcd... | 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 A. Find a string B, where B is a palindrome and A is a subsequence of B.\n\nA subseque... | [{"input": "fggbyzobbmxtwdajawqdywnppflkkmtxzjvxopqvliwdwhzepcuiwelhbuotlkvesexnwkytonfrpqcxzzqzdvsmbsjcxxeugavekozfjlolrtqgwzqxsfgrnvrgfrqpixhsskbpzghndesvwptpvvkasfalzsetopervpwzmkgpcexqnvtnoulprwnowmsorscecvvvrjfwumcjqyrounqsgdruxttvtmrkivtxauhosokdiahsyrftzsgvgyveqwkzhqstbgywrvmsgfcfyuxpphvmyydzpohgdicoxbtjnsbyhoid... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a non-empty string s=s_1s_2... s_n, which consists only of lowercase Latin letters. Polycarp do... | [{"input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntwooooo\nttttwo\nttwwoo\nooone\nonnne\noneeeee\noneeeeeeetwooooo\n", "output": "6\n2 6 10 13 18 21 \n1\n2 \n1\n2 \n1\n2 \n1\n5 \n0\n\n1\n4 \n0\n\n1\n2 \n2\n2 11 \n"}, {"input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntwooooo\nttttwo\nttwwoo\nooone\nonnne\nonedeee\non... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 postal system in the area where Masa lives has changed a bit. In this area, each post office is numbered ... | [{"input": "4 5\n1 2 10\n1 3 15\n2 3 5\n2 4 3\n3 4 10\n2\n1 4 10 LoveLetter\n2 3 13 Greetings\n3 3\n1 2 1\n2 3 1\n3 1 1\n3\n1 2 1 BusinessMailC\n2 3 1 BusinessMailB\n3 1 1 BusinessMailA\n0 0", "output": "Greetings 18\nLoveLetter 26\n\nBusinessMailA 2\nBusinessMailB 2\nBusinessMailC 2\n"}, {"input": "4 5\n1 2 10\n2 3 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\nYou have been speeding on a motorway and a police car had to stop you. The policeman is a funny guy that like... | [{"input": "[\"72\", \"7\", \"7\", \"78\", \"79\", \"709\", \"94\"]", "output": "[\"7097277787994\"]", "fn_name": "penalty"}, {"input": "[\"71\", \"82\", \"42\", \"34\", \"90\"]", "output": "[\"3442718290\"]", "fn_name": "penalty"}, {"input": "[\"45\", \"30\", \"50\", \"1\"]", "output": "[\"1304550\"]", "fn_name": "pen... | 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 Russian also. \nChef likes shopping, and especially he likes to buy oranges. But ... | [{"input": "2\n2 0\n-1 1\n2 4\n2 6\n-1 10\n1 7", "output": "1\n17\n"}, {"input": "2\n2 0\n-1 2\n2 4\n2 6\n-1 10\n1 7", "output": "2\n17\n"}, {"input": "2\n2 3\n-1 1\n2 4\n2 6\n-1 5\n1 7", "output": "5\n12\n"}, {"input": "2\n2 0\n-1 1\n2 4\n2 6\n-1 5\n1 7", "output": "1\n12\n"}, {"input": "2\n1 1\n1 5\n3 4\n1 -1\n2 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\nShuseki Kingdom is the world's leading nation for innovation and technology. There are n cities in the kingdo... | [{"input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 5\n4 1\n3 1\n1 5\n1 6\n6 2\n2 4\n", "output": "7\n"}, {"input": "8 12\n6 1\n7 5\n2 5\n4 1\n6 3\n4 3\n5 7\n1 3\n5 2\n2 7\n4 6\n7 2\n", "output": "6\n"}, {"input": "8 12\n6 1\n7 5\n2 5\n4 1\n6 3\n4 3\n5 7\n1 3\n5 2\n2 8\n4 6\n7 2\n", "output": "7\n"}, {"input": "8 12\n6 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\nHaving stayed home alone, Petya decided to watch forbidden films on the Net in secret. \"What ungentlemanly b... | [{"input": "000:0010\n", "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 51 52 53 54 55 56 57 58 59 "}, {"input": "001:010\n", "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 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\nPig Latin is an English language game where the goal is to hide the meaning of a word from people not aware o... | [{"input": "\"yaYAya\"", "output": "[\"ayayayay\"]", "fn_name": "pig_latin"}, {"input": "\"YayayA\"", "output": "[\"ayayayay\"]", "fn_name": "pig_latin"}, {"input": "\"Hello\"", "output": "[\"ellohay\"]", "fn_name": "pig_latin"}, {"input": "\"CCCC\"", "output": "[\"ccccay\"]", "fn_name": "pig_latin"}, {"input": "\"tes3... | 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 $n$ rectangles on a plane with coordinates of their bottom left and upper right points. Some $(... | [{"input": "3\n-1000000000 -1000000000 -999999999 -999999999\n-1000000000 -1000000000 1000000000 1000000000\n-1000000000 -1000000000 -999999999 -999999999\n", "output": "-1000000000 -1000000000\n"}, {"input": "3\n-1000000000 -1000000000 -999999999 -999999999\n-1000000000 -1000000000 1000000000 1000000000\n-1000000000 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nDuring this time of winter in Japan, hot days continue in Australia in the Southern Hemisphere. IO... | [{"input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 40", "output": "100\n"}, {"input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 25", "output": "130\n"}, {"input": "3 4\n34\n40\n44\n38 25 30\n24 29 11\n21 69 99\n28 43 40", "output": "118\n"}, {"input": "3 4\n34\n40\n30\n15 25 30\n43 29 11\n21 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\nChef and Roma are playing a game. Rules of the game are quite simple.\nInitially there are N piles of stones ... | [{"input": "2\n3\n1 1 14\n3\n-2 0 1", "output": "15\n-1\n"}, {"input": "2\n3\n-1 2 12\n3\n-1 3 0", "output": "11\n2\n"}, {"input": "2\n3\n0 -1 25\n3\n-1 4 1", "output": "24\n3\n"}, {"input": "2\n3\n-1 2 21\n3\n-1 3 1", "output": "20\n2\n"}, {"input": "2\n3\n-1 2 12\n3\n-1 1 1", "output": "11\n0\n"}, {"input": "2\n3\n0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPrincess'Gamble\n\nPrincess gambling\n\nEnglish text is not available in this practice contest.\n\nOne day, a... | [{"input": "3 2 50\n1\n4\n2\n4 4 65\n1\n0\n3\n-1\n3 1 10\n8\n2\n1\n0 0 0", "output": "87\n-105\n123\n"}, {"input": "3 2 50\n1\n2\n3\n4 4 65\n-1\n2\n5\n1\n3 1 10\n8\n0\n1\n0 0 0", "output": "150\n245\n101\n"}, {"input": "3 2 50\n1\n2\n3\n4 4 65\n-1\n2\n5\n1\n3 1 10\n8\n-1\n1\n0 0 0", "output": "150\n245\n90\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\nYura has been walking for some time already and is planning to return home. He needs to get home as fast as p... | [{"input": "995078784 16\n623812784 347467913 233267735 582455459\n355611107 277980472\n78770458 786182235\n815219022 611815511\n786044046 363376661\n290398527 1777289213\n846155104 388600335\n143085949 155695413\n287078777 918827034\n432395923 126620751\n52941102 329010981\n237509699 571287936\n556130019 602129300\n44... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon likes coloring cells very much.\n\nThere is a row of n cells. Initially, all cells are empty (don't ... | [{"input": "2000 100\n5 128 1368 1679 1265 313 1854 1512 1924 338 38 1971 238 1262 1834 1878 1749 784 770 1617 191 395 303 214 1910 1300 741 1966 1367 24 268 403 1828 1033 1424 218 1146 925 1501 1760 1164 1881 1628 1596 1358 1360 29 1343 922 618 1537 1839 1114 1381 704 464 692 1450 1590 1121 670 300 1053 1730 1024 1292... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Alyona is celebrating Happy Birthday! Her mother has an array of n flowers. Each flower has some mood,... | [{"input": "86 30\n16 -12 11 16 8 14 7 -29 18 30 -32 -10 20 29 -14 -21 23 -19 -15 17 -2 25 -22 2 26 15 -7 -12 -4 -28 21 -4 -2 22 28 -32 9 -20 23 38 -21 21 37 -13 -30 25 31 6 18 29 29 29 27 38 -15 -32 32 -7 -8 -33 -11 24 23 -19 -36 -36 -18 9 -1 32 -34 -26 1 -1 -16 -14 17 -17 15 -24 38 5 -27 -12 8 -38\n60 66\n29 48\n32 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\n# Background\n\n\nMy TV remote control has arrow buttons and an `OK` button.\n\nI can use these to move a \"c... | [{"input": "\"The Quick Brown Fox Jumps Over A Lazy Dog.\"", "output": "[254]", "fn_name": "tv_remote"}, {"input": "\"Pack My Box With Five Dozen Liquor Jugs.\"", "output": "[242]", "fn_name": "tv_remote"}, {"input": "\" x X \"", "output": "[30]", "fn_name": "tv_remote"}, {"input": "\"MISSISSIPPI\"", "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\nMainak has an array $a_1, a_2, \\ldots, a_n$ of $n$ positive integers. He will do the following operation to ... | [{"input": "50\n1\n999\n1\n998\n1\n997\n1\n996\n1\n995\n1\n994\n1\n993\n1\n992\n1\n991\n1\n990\n1\n989\n1\n988\n1\n987\n1\n986\n1\n985\n1\n984\n1\n983\n1\n982\n1\n981\n1\n980\n1\n979\n1\n978\n1\n977\n1\n976\n1\n975\n1\n974\n1\n973\n1\n972\n1\n971\n1\n970\n1\n969\n1\n968\n1\n967\n1\n966\n1\n965\n1\n964\n1\n963\n1\n962\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 has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way ... | [{"input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"input": "2 100 100 00000 10000\n100 100\n", "output": "20000\n"}, {"input": "2 100 100 00001 10000\n000 100\n", "output": "10000\n"}, {"input": "2 100 100 00001 10000\n001 100\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\nIn the spirit of the holidays, Saitama has given Genos two grid paths of length n (a weird gift even by Saita... | [{"input": "200\nNESENEESEESWWWNWWSWSWNWNNWNNESWSWNNWNWNENESENNESSWSESWWSSSEEEESSENNNESSWWSSSSESWSWWNNEESSWWNNWSWSSWWNWNNEENNENWWNESSSENWNESWNESWNESEESSWNESSSSSESESSWNNENENESSWWNNWWSWWNESEENWWWWNWWNWWNENESESSWWSWWSES\nNWNESESSENNNESWNWWSWWWNWSESSSWWNWWNNWSENWSWNENNNWWSWWSWNNNESWWWSSESSWWWSSENWSENWWNENESESWNENNESWNWNNEN... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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": "bddabcdfaccdabcdfadddabcdfabbdabcdfacddabcdfacdbabcdfacbbabcdfacbcabcdfacbdabcdfadbbabcdfabdbabcdfabdcabcdfabbcabcdfabccabcdfabbbabcdfaddcabcdfaccbabcdfadbdabcdfacccabcdfadcdabcdfadcbabcdfabcbabcdfadbcabcdfacdcabcdfabcdabcdfadccabcdfaddb\n", "output": "bd dabc dfacc dabc dfadddabc dfabb dabc dfacd dabc dfac... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a of length m is called antipalindromic iff m is even, and for each i (1 ≤ i ≤ m) a_{i} ≠ a_{m} - i ... | [{"input": "100\nadebebcdacabaadcbcdebcccdaadaeeedecdbcbdeddcbcaeedbecaeeabaabbdccaebdebabbabdcebbbdaabdbddcadaddadad\n52 62 28 18 100 84 16 53 43 52 49 92 10 64 50 95 90 52 21 14 60 3 94 63 31 70 74 62 93 75 100 96 58 36 76 40 62 74 91 77 92 78 65 11 50 18 79 29 10 25 4 24 44 39 4 91 81 63 97 65 50 65 77 51 19 87 43 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\nPermutation p is an ordered set of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive intege... | [{"input": "100\n-77 57 -95 -23 53 -29 82 -83 38 -73 85 28 25 6 -16 4 -10 -30 -9 -92 14 34 -93 61 36 -100 90 -68 28 16 100 -4 49 23 36 -87 62 -62 53 74 -50 -2 102 8 22 -30 -19 83 7 84 43 90 -65 -75 -15 97 90 15 66 2 13 -91 91 -44 62 51 51 -58 95 77 20 45 76 79 91 60 76 2 82 42 -130 94 -70 122 65 -95 -66 100 -11 33 -67 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, eac... | [{"input": "102\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 52 51 54 53 56 55 58 57 60 59 62 61 64 63 66 65 68 67 70 69 72 71 74 73 76 75 78 77 80 79 82 81 84 83 86 85 88 87 90 89 92 91 94 93 96 95 98 97 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\nN friends of Takahashi has come to a theme park.\nTo ride the most popular roller coaster in the park, you mu... | [{"input": "81 358\n59 53 2 54 462 325 435 279 464 327 49 332 95 200 220 158 139 492 130 467 489 458 81 100 466 473 429 275 81 270 455 218 128 307 335 398 52 30 311 69 148 384 454 413 114 315 186 334 382 392 326 8 53 462 457 350 231 61 185 88 305 480 64 390 52 247 443 240 93 469 370 16 443 7 25 299 412 163 199 71 476\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 is choosing a laptop. The shop has n laptops to all tastes.\n\nVasya is interested in the following pro... | [{"input": "27\n1689 1927 40 270\n3833 2570 167 134\n2580 3589 390 300\n1898 2587 407 316\n1841 2772 411 187\n1296 288 407 506\n1215 263 236 307\n2737 1427 84 992\n1107 1879 284 866\n3311 2507 475 147\n2951 2214 209 375\n1352 2582 110 324\n2082 747 289 521\n2226 1617 209 108\n2253 1993 109 835\n2866 2360 29 206\n1431 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\nA programming competition site AtCode regularly holds programming contests.\nThe next contest on AtCode is ca... | [{"input": "1199\n", "output": "ABC\n"}, {"input": "1200\n", "output": "ARC\n"}, {"input": "4208\n", "output": "AGC\n"}, {"input": "1234\n", "output": "ARC\n"}, {"input": "2799\n", "output": "ARC\n"}, {"input": "2800\n", "output": "AGC\n"}, {"input": "3399\n", "output": "AGC\n"}, {"input": "600\n", "output": "ABC\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 integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N su... | [{"input": "150607 162", "output": "1606122089\n"}, {"input": "101525 92", "output": "2687492591\n"}, {"input": "101525 162", "output": "491806259\n"}, {"input": "35897 92", "output": "118638000\n"}, {"input": "62976 92", "output": "641432629\n"}, {"input": "50082 162", "output": "59007258\n"}, {"input": "53556 162", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSquare1001 has seen an electric bulletin board displaying the integer 1.\nHe can perform the following operat... | [{"input": "10\n-32", "output": "-16128\n"}, {"input": "10\n-23", "output": "-11520\n"}, {"input": "10\n-37", "output": "-18688\n"}, {"input": "10\n-42", "output": "-21248\n"}, {"input": "10\n-33", "output": "-16640\n"}, {"input": "10\n-62", "output": "-31488\n"}, {"input": "10\n-41", "output": "-20736\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have two positive integers w and h. Your task is to count the number of rhombi which have the following p... | [{"input": "4000 4000\n", "output": "16000000000000\n"}, {"input": "1913 3980\n", "output": "3623063809200\n"}, {"input": "3727 2044\n", "output": "3627108561888\n"}, {"input": "1499 2172\n", "output": "662525703000\n"}, {"input": "1913 6242\n", "output": "8911634525772"}, {"input": "1499 2871\n", "output": "1157575755... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 binary string of length $n$ (i. e. a string consisting of $n$ characters '0' and '1').\n\nIn ... | [{"input": "3\n8 10\n01011011\n7 6\n0111100\n7 11\n0111100\n", "output": "00011111\n0011011\n0001111\n"}, {"input": "3\n8 10\n01011011\n7 6\n0111100\n7 15\n1111100\n", "output": "00011111\n0011011\n0011111\n"}, {"input": "3\n8 10\n01011011\n7 9\n0111100\n7 11\n0111100\n", "output": "00011111\n0001111\n0001111\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n integers a_1, a_2, ..., a_n, where n is odd. You are allowed to flip the sign of some (possib... | [{"input": "5\n3\n-2 4 3\n5\n1 1 1 1 0\n5\n-2 4 13 -6 4\n9\n9 7 -4 -2 2 -3 9 -4 -2\n9\n-4 1 28 3 1 9 5 1 -15\n", "output": "2 -4 3\n1 -1 1 -1 0\n2 -4 13 -6 4\n9 -7 4 -2 2 -3 9 -4 2\n4 -1 28 -3 1 -9 5 -1 15\n"}, {"input": "5\n3\n-2 4 3\n5\n1 1 1 1 0\n5\n-2 4 13 -6 4\n9\n3 7 -4 -2 2 -3 9 -4 -2\n9\n-4 1 28 3 1 9 5 1 -15\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\nAfter Fox Ciel got off a bus, she found that the bus she was on was a wrong bus and she lost her way in a str... | [{"input": "6CLznedj88834gqTIhMTPjm_3DbkQpuYkBvU3o55h79ntRqjHTOu3WWNNGLyQSZ_o45mK5mMtRJmWUq2twqWP10OlnDAB1EP2rG\n10\n834gqTI\n_o4\nvU2o55h79n\nvLwlk3PY7Z\nk8PnkBpRYB\nqdkB9b_SS2\nkY4mBeAdgK\nb577cjQiSx\nyOFiEkP1sD\noYOqd8uuTt\n", "output": "54 11\n"}, {"input": "6CLznedj88834gqTIhMTPjm_3DbkQpuYkBvU3o55h79ntRqjHTOu3WWNN... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-... | [{"input": "abbbbbbbabbbbbbbbbbbbbbbbbbbbbbbabbabbbbbabbbbbbbbbbbabbbbbbbbabbabbbbbbbbbbbbbbabbabbbaababbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbbabbbbbbbbbbbbbbbabbbbbbbbbaababbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbabbbbbaabbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nToday, Chef woke up to find that he had no clean socks. Doing laundry is such a turn-off for Chef, that in su... | [{"input": "-1 4 14", "output": "Unlucky Chef\n"}, {"input": "1 2 11", "output": "Unlucky Chef\n"}, {"input": "2 1 11", "output": "Unlucky Chef\n"}, {"input": "-1 4 6", "output": "Unlucky Chef\n"}, {"input": "0 2 14", "output": "Unlucky Chef\n"}, {"input": "2 2 16", "output": "Unlucky Chef\n"}, {"input": "-1 1 4", "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\nGiven an D-dimension array, where each axis is of length N, your goal is to find the sum of every index in th... | [{"input": "19\n84", "output": "[2871495452512585452340652014195036913664]", "fn_name": "super_sum"}, {"input": "17\n76", "output": "[60022109925215517405815155929907200]", "fn_name": "super_sum"}, {"input": "15\n8", "output": "[1847179534663680]", "fn_name": "super_sum"}, {"input": "11\n11", "output": "[15692141883605... | 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 Petya often travels to his grandmother in the countryside. The grandmother has a large garden, which c... | [{"input": "100\n1 2 3 7 5 6 10 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 30 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 1 82 83 84 85 86 87 88 89 90 91 92 93 94 100 5 4 3 2 1\n", "output": "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\nWrite a function that accepts a string, and returns true if it is in the form of a phone number. Assume that ... | [{"input": "\"abc(123) 456-7890abc\"", "output": "[false]", "fn_name": "validPhoneNumber"}, {"input": "\"abc(123)456-7890abc\"", "output": "[false]", "fn_name": "validPhoneNumber"}, {"input": "\"abc(123) 456-7890\"", "output": "[false]", "fn_name": "validPhoneNumber"}, {"input": "\"(123) 456-7890abc\"", "output": "[fal... | 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 Happy Farm 5 creators decided to invent the mechanism of cow grazing. The cows in the game are very slow ... | [{"input": "60\n-20 179\n-68 0\n-110 68\n-22 177\n47 140\n-49 -4\n-106 38\n-23 22\n20 193\n47 173\n-23 22\n-100 32\n-97 29\n47 124\n-49 -4\n20 193\n-20 179\n-50 149\n-59 -7\n4 193\n-23 22\n-97 29\n-23 22\n-66 133\n47 167\n-61 138\n-49 -4\n-91 108\n-110 84\n47 166\n-110 77\n-99 100\n-23 22\n-59 -7\n47 128\n46 91\n9 193\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have a... | [{"input": "36\nKqxmtwmsf child\nIze woman\nDlpr child\nK woman\nF captain\nRjwfeuhba rat\nBbv rat\nS rat\nMnmg woman\nSmzyx woman\nSr man\nQmhroracn rat\nSoqpuqock rat\nPibdq man\nIlrkrptx rat\nZaecfyqka man\nMmersfs child\nVvvocqi man\nHjeqxvq rat\nMpmb woman\nWmgu woman\nCerelmhoxi child\nA man\nDylv man\nXrdgmmtcpq... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhen you asked some guy in your class his name, he called himself S, where S is a string of length between 3 ... | [{"input": "sakahashi", "output": "sak\n"}, {"input": "sbkahashi", "output": "sbk\n"}, {"input": "ihsahakbs", "output": "ihs\n"}, {"input": "hhsaiakbr", "output": "hhs\n"}, {"input": "rbkaiashh", "output": "rbk\n"}, {"input": "rkbaiashh", "output": "rkb\n"}, {"input": "skbajashh", "output": "skb\n"}, {"input": "ska^ias... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven a string as input, move all of its vowels to the end of the string, in the same order as they were befo... | [{"input": "\"programming\"", "output": "[\"prgrmmngoai\"]", "fn_name": "move_vowels"}, {"input": "\"javascript\"", "output": "[\"jvscrptaai\"]", "fn_name": "move_vowels"}, {"input": "\"haskell\"", "output": "[\"hskllae\"]", "fn_name": "move_vowels"}, {"input": "\"clojure\"", "output": "[\"cljroue\"]", "fn_name": "move... | 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 Fair Nut found a string $s$. The string consists of lowercase Latin letters. The Nut is a curious guy, so... | [{"input": "babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab\n", "output": "813881762\n"}, {"input": "babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabbaaabaaaaababaaaabaaab\n", "output": "451105408\n"}, {"input": "bbbbabbabaababaaaabaaabb... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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$ persons visited a restaurant. The restaurant is open from 0 to $T$. The $i$-th person entered the restaur... | [{"input": "0 12\n1 -1\n1 4\n0 8\n0 11\n6 19\n7 21", "output": "0\n"}, {"input": "0 12\n0 -1\n1 4\n0 8\n0 11\n6 19\n7 21", "output": "0\n"}, {"input": "0 12\n1 0\n1 14\n0 0\n0 11\n6 19\n7 32", "output": "0\n"}, {"input": "0 10\n1 -1\n1 3\n0 8\n3 11\n3 12\n5 24", "output": "0\n"}, {"input": "0 12\n0 -1\n1 4\n1 8\n0 11\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\nWhen Darth Vader gets bored, he sits down on the sofa, closes his eyes and thinks of an infinite rooted tree ... | [{"input": "97 78153\n2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2\n", "output": "620983468\n"}, {"input": "97 78153\n2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLevko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A ta... | [{"input": "100 1000\n", "output": "1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 of 1,2,...,N: p_1,p_2,...,p_N. Determine if the state where p_i=i for every i can... | [{"input": "7\n3\n2\n1\n6\n5\n4\n7\n", "output": "Yes\n"}, {"input": "7\n4\n2\n1\n6\n5\n4\n14", "output": "No\n"}, {"input": "7\n4\n2\n1\n11\n5\n4\n7", "output": "No\n"}, {"input": "7\n4\n2\n1\n6\n5\n4\n7", "output": "No\n"}, {"input": "7\n3\n2\n1\n6\n5\n4\n7", "output": "Yes"}, {"input": "6\n5\n3\n4\n1\n2\n6\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\nAlice and Bob are playing a fun game of tree tag.\n\nThe game is played on a tree of $n$ vertices numbered fr... | [{"input": "10\n10 9 10 6 6\n6 1\n7 6\n4 2\n6 10\n5 1\n9 5\n6 8\n3 4\n4 10\n2 1 2 1 1\n2 1\n9 7 4 2 3\n5 1\n2 4\n4 8\n8 6\n8 9\n7 8\n1 8\n1 3\n11 1 11 6 8\n1 10\n6 11\n8 2\n11 3\n1 7\n11 4\n5 8\n11 7\n1 9\n1 8\n5 3 2 1 1\n3 1\n2 1\n4 5\n1 5\n2 1 2 1 1\n2 1\n2 2 1 1 1\n2 1\n2 2 1 1 1\n1 2\n2 2 1 1 1\n2 1\n5 4 5 4 2\n2 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 is making a quest for his friends. He has already made n tasks, for each task the boy evaluated how ... | [{"input": "70 4\n1 83\n3 923\n2 627\n4 765\n3 74\n4 797\n4 459\n2 682\n1 840\n2 414\n4 797\n3 832\n3 203\n2 939\n4 694\n1 157\n3 544\n1 169\n3 100\n4 69\n1 851\n3 605\n4 562\n1 718\n3 74\n3 740\n2 655\n2 804\n2 218\n4 186\n4 999\n3 989\n2 407\n4 702\n2 15\n1 509\n4 376\n4 260\n1 533\n2 514\n3 520\n4 737\n2 877\n2 383\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPlease write a function that sums a list, but ignores any duplicate items in the list.\n\nFor instance, for t... | [{"input": "[6, 7, 6, 6, 8, 0, 2, 0, 3, 2, 3, 0, 9, 10, 4, 8, 5, 1, 6, 3, 4, 3, 3, 4, 6, 8, 7, 6, 2, 2, 6, 9, 1, 9, 2, 1, 1, 0, 9, 9, 9, 4, 3, 6, 1, 2, 1, 9, 9, 9, 7, 4, 6, 6, 0, 8, 10, 9, 0, 7, 0, 7, 2, 4, 7, 9, 0, 4, 9, 3, 5, 7, 4, 6, 9, 1, 10, 10, 5, 0, 2, 3, 10, 10, 10, 2, 8, 7, 4, 8, 5, 10, 4, 9, 4, 5, 3, 9, 3, 5,... | 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 an easy version of the problem. The actual problems are different, but the easy version is almost a s... | [{"input": "500\nxwxpgalijfbdbdmluuaubobxztpkfnuparzxczfzchinxdtaevbepdxlouzfzaizkinuaufhckjvydmgnkuaneqohcqocfrsbmmohgpoacnqlgspppfogdkkbrkrhdpdlnknjyeccbqssqtaqmyamtkedlhpbjmchfnmwhxepzfrfmlrxrirbvvlryzmulxqjlthclocmiudxbtqpihlnielggjxjmvqjbeozjpskenampuszybcorplicekprqbsdkidwpgwkrpvbpcsdcngawcgeyxsjimalrrwttjjualmhy... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 write a program related to an unsolved math problem called \"Happy End Problem\". Create a program to f... | [{"input": "5\n2 -1\n3 -1\n5 2\n3 4\n-1 3\n3\n5\n4\n5", "output": "1 2 3 4 5\n1 2 3 4\n1 2 3 4 5\n"}, {"input": "5\n1 -1\n3 -1\n0 2\n1 4\n0 3\n3\n4\n4\n5", "output": "1 4 5 3\n1 4 5 3\n1 2 4 5 3\n"}, {"input": "5\n2 -1\n3 -1\n2 2\n1 4\n0 3\n3\n4\n4\n5", "output": "1 2 3 4\n1 2 3 4\n1 2 3 4 5\n"}, {"input": "5\n2 -1\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\nBizon the Champion is called the Champion for a reason. \n\nBizon the Champion has recently got a present — a... | [{"input": "100 100 100\n100 100 100\n100\n", "output": "YES\n"}, {"input": "100 100 100\n100 100 100\n100\n", "output": "YES\n"}, {"input": "100 100 100\n101 100 100\n100\n", "output": "YES\n"}, {"input": "100 100 000\n101 100 100\n100\n", "output": "YES\n"}, {"input": "000 100 000\n101 100 100\n100\n", "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\nTwo foxes Jiro and Saburo are playing a game called 1D Reversi. This game is played on a board, using black a... | [{"input": "WBWBWBWBWB\n", "output": "9\n"}, {"input": "WBWBWBBBWW", "output": "6\n"}, {"input": "WWBBCWBWBV", "output": "7\n"}, {"input": "XWBBCWBWBV", "output": "8\n"}, {"input": "XWVBCWBWCB", "output": "9\n"}, {"input": "WWBBBWBWBW", "output": "6\n"}, {"input": "WWBBBWBWBV", "output": "6\n"}, {"input": "XWVBCWBWBB",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFind the minimum prime number greater than or equal to X.\n\n-----Notes-----\nA prime number is an integer gr... | [{"input": "100000\n", "output": "100003\n"}, {"input": "99992\n", "output": "100003\n"}, {"input": "64993\n", "output": "64997\n"}, {"input": "90371\n", "output": "90371\n"}, {"input": "92227\n", "output": "92227\n"}, {"input": "59054\n", "output": "59063\n"}, {"input": "56588\n", "output": "56591\n"}, {"input": "1568... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCalculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + ... + n mod m. As the result can be very large,... | [{"input": "10000000000000 10000000000000\n", "output": "869957328\n"}, {"input": "10000000000000 10000000000000\n", "output": "869957328\n"}, {"input": "7244641009859 6300054748096\n", "output": "955368330\n"}, {"input": "3483524125987 5259923264237\n", "output": "953462184\n"}, {"input": "9726702209411 4215496813081\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ of length $n$.\n\nYou are also given a set of distinct positions $p_1, p_2, \\dots... | [{"input": "6\n3 2\n3 2 1\n1 2\n4 2\n4 1 2 3\n3 2\n5 1\n1 2 3 4 5\n1\n4 2\n2 1 4 3\n1 3\n4 2\n4 3 2 1\n1 3\n5 2\n2 1 2 3 3\n1 4\n", "output": "YES\nNO\nYES\nYES\nNO\nYES\n"}, {"input": "6\n3 2\n3 2 1\n1 2\n4 2\n4 1 2 3\n3 2\n5 1\n1 2 3 4 5\n1\n4 2\n2 1 4 3\n1 3\n4 2\n4 3 3 1\n1 3\n5 2\n2 1 2 3 3\n1 4\n", "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\nLittle Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Les... | [{"input": "100000 99999 4\n", "output": "1\n"}, {"input": "100000 1 10000\n", "output": "2\n"}, {"input": "10028 13 10000\n", "output": "1\n"}, {"input": "100000 99999 2\n", "output": "1\n"}, {"input": "100000 99999 3\n", "output": "1\n"}, {"input": "100000 1 10000\n", "output": "2\n"}, {"input": "100000 99999 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\nThere are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys ... | [{"input": "buneohqdgxjsafrmwtzickvlpy\nzblwamjxifyuqtnrgdkchpoves\n4RZf8YivG6414X1GdDfcCbc10GA0Wz8514LI9D647XzPb66UNh7lX1rDQv0hQvJ7aqhyh1Z39yABGKn24g185Y85ER5q9UqPFaQ2JeK97wHZ78CMSuU8Zf091mePl2OX61BLe5KdmUWodt4BXPiseOZkZ4SZ27qtBM4hT499mCirjy6nB0ZqjQie4Wr3uhW2mGqBlHyEZbW7A6QnsNX9d3j5aHQN0H6GF8J0365KWuAmcroutnJD6l6HI3kS... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 students live in a dormitory. A dormitory is a whole new world of funny amusements and possibilities but... | [{"input": "0 14299 32984 96001 30445\n77723 0 75669 14101 55389\n30897 17295 0 52675 29987\n36518 108118 11343 0 64020\n91242 50085 86272 62454 0\n", "output": "747422\n"}, {"input": "0 14299 32984 96001 30445\n77723 0 75669 14101 55389\n30897 17295 0 52675 29987\n36518 108118 92955 0 64020\n91242 50085 86272 62454 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\nLet's solve the puzzle by programming.\n\nThe numbers n x n are arranged in a grid pattern. Some of the numbe... | [{"input": "3\n-3 1 1\n2 -4 1\n2 1 -1\n3\n-2 1 1\n1 0 -6\n1 -5 3\n4\n-8 11 -2 1\n2 -7 -2 2\n1 -1 1 2\n1 1 1 -1\n6\n2 0 3 -7 0 2\n1 -10 1 1 4 2\n2 10 5 2 -6 0\n2 4 -23 2 1 8\n3 3 -8 2 3 7\n-7 2 5 2 -3 -18\n6\n3 2 3 -7 1 2\n1 -10 1 0 3 2\n2 6 5 0 -6 1\n0 4 -23 2 2 5\n4 3 -2 2 3 5\n-7 2 4 1 -5 -12\n0", "output": "YES\nNO\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 check if it is possible to convert a string to a palindrome by changing one character.... | [{"input": "\"abba\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"abbaa\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"abcba\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"abbx\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"aa\"", "output": "[false]", "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\nSasha and Ira are two best friends. But they aren’t just friends, they are software engineers and experts in ... | [{"input": "1000000\n", "output": "627314155\n"}, {"input": "1000000\n", "output": "627314155\n"}, {"input": "999999\n", "output": "192151599\n"}, {"input": "524287\n", "output": "295397547\n"}, {"input": "131071\n", "output": "920253602\n"}, {"input": "178481\n", "output": "845172388\n"}, {"input": "524288\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 two arrays $a$ and $b$, both of length $n$.\n\nLet's define a function $f(l, r) = \\sum\\limits... | [{"input": "5\n1 11 7 6 5\n9 11 2 18 3\n", "output": "1162\n"}, {"input": "5\n1 11 7 6 5\n9 11 2 9 3\n", "output": "1077\n"}, {"input": "5\n1 11 7 6 5\n9 11 3 6 3\n", "output": "1021\n"}, {"input": "5\n1 11 7 2 5\n9 11 3 10 3\n", "output": "893\n"}, {"input": "5\n0 3 2 0 2\n14 1 0 11 13\n", "output": "128\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# Let's watch a parade!\n## Brief\nYou're going to watch a parade, but you only care about one of the groups ... | [{"input": "[\"a\", \"b\", \"c\", \"c\", \"e\", \"c\"]\n7\n1\n\"c\"", "output": "[[10, 11, 13]]", "fn_name": "parade_time"}, {"input": "[\"c\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n3\n2\n\"c\"", "output": "[[2, 3]]", "fn_name": "parade_time"}, {"input": "[\"a\", \"b\", \"c\", \"d\", \"e\", \"b\"]\n1\n2\n\"b\"", "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\nTranspose means is to interchange rows and columns of a two-dimensional array matrix.\n\n[A^(T)]ij=[A]ji\n\ni... | [{"input": "[[true, false, true], [false, true, false]]", "output": "[[[true, false], [false, true], [true, false]]]", "fn_name": "transpose"}, {"input": "[[\"a\", \"b\", \"c\"], [\"d\", \"e\", \"f\"]]", "output": "[[[\"a\", \"d\"], [\"b\", \"e\"], [\"c\", \"f\"]]]", "fn_name": "transpose"}, {"input": "[[1, 2, 3, 4, 5,... | 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\nAlexandra has an even-length array $a$, consisting of $0$s and $1$s. The elements of the array are enumerated... | [{"input": "4\n2\n1 1\n2\n0 0\n4\n0 1 1 1\n4\n1 1 0 0\n", "output": "2\n1 1 \n2\n0 0 \n2\n1 1 \n2\n0 0 \n"}, {"input": "4\n2\n0 0\n2\n0 0\n4\n0 1 1 1\n4\n1 1 0 0\n", "output": "2\n0 0 \n2\n0 0 \n2\n1 1 \n2\n0 0 \n"}, {"input": "4\n2\n1 1\n2\n0 0\n4\n0 1 0 1\n4\n1 1 0 0\n", "output": "2\n1 1 \n2\n0 0 \n2\n0 0 \n2\n0 0 \... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array a_1, a_2, ..., a_{n} consisting of n integers, and an integer k. You have to split the... | [{"input": "39 1\n676941771 -923780377 -163050076 -230110947 -208029500 329620771 13954060 158950156 -252501602 926390671 -678745080 -921892226 -100127643 610420285 602175224 -839193819 471391946 910035173 777969600 -736144413 -489685522 60986249 830784148 278642552 -375298304 197973611 -354482364 187294011 636628282 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\nAs most of you might know already, a prime number is an integer `n` with the following properties:\n\n* it mu... | [{"input": "143", "output": "[false]", "fn_name": "is_prime"}, {"input": "529", "output": "[false]", "fn_name": "is_prime"}, {"input": "-1", "output": "[false]", "fn_name": "is_prime"}, {"input": "1", "output": "[false]", "fn_name": "is_prime"}, {"input": "29", "output": "[true]", "fn_name": "is_prime"}, {"input": "53"... | 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\nIn this Kata, you will count the number of times the first string occurs in the second. \n\n```Haskell\nsolve... | [{"input": "\"defg\"\n\"dvsxvevdvsvfvsvgvsvgg\"", "output": "[3]", "fn_name": "solve"}, {"input": "\"code\"\n\"cozzdezodeczzode\"", "output": "[11]", "fn_name": "solve"}, {"input": "\"kata\"\n\"kataxxxxkatak\"", "output": "[7]", "fn_name": "solve"}, {"input": "\"code\"\n\"codeodecode\"", "output": "[11]", "fn_name": "s... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.