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\nWrite an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the oth... | [{"input": "[\"a\", 0, 0, \"b\", null, \"c\", \"d\", 0, 1, false, 0, 1, 0, 3, [], 0, 1, 9, 0, 0, {}, 0, 0, 9]", "output": "[[\"a\", \"b\", null, \"c\", \"d\", 1, false, 1, 3, [], 1, 9, {}, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]", "fn_name": "move_zeros"}, {"input": "[\"a\", 0, 0, \"b\", \"c\", \"d\", 0, 1, 0, 1, 0, 3, 0, 1,... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.\n\nHe has a phobia for palindrom... | [{"input": "bacaccbabab", "output": "YES\n"}, {"input": "bacaacbcbab", "output": "YES\n"}, {"input": "babcbcaacab", "output": "YES\n"}, {"input": "bababccacab", "output": "YES\n"}, {"input": "bacaccbabac", "output": "YES\n"}, {"input": "babacccbaab", "output": "YES\n"}, {"input": "bacaacccbab", "output": "YES\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\nCodefortia is a small island country located somewhere in the West Pacific. It consists of $n$ settlements co... | [{"input": "6 7 13 22\n1 2 13\n2 3 13\n1 4 22\n3 4 13\n4 5 13\n5 6 13\n6 1 13\n", "output": "0 13 26 39 26 13\n"}, {"input": "6 7 13 22\n1 2 13\n2 3 13\n1 4 22\n3 4 13\n4 1 13\n5 6 13\n6 1 13\n", "output": "0 13 26 13 26 13 "}, {"input": "6 7 13 22\n2 2 13\n2 3 13\n1 4 22\n3 4 13\n4 1 13\n5 6 13\n6 1 13\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 a string $s$ consisting of lowercase Latin letters \"a\", \"b\" and \"c\" and question marks \"... | [{"input": "300\ncc?aabbb?ba?cbcb??b??ababcabcb???b?bcb?ac??a?acc?cba?aa?a???bc?????ca??ac???cb??caaca???aabbc?cb?bb?a?bbb?a?cbbaccbcaab?a???baab?ac?ab??a?b?ac?acbcbb?cc??bbbcc?c??cab?cac?c???accb???c?cc?bb???b?bca?bbaccca??b?c?bb?b?a??ccb?c?abbc?aaa???bca?ccb?bb?c?b???c???bcac??ca?ba?a?cbabbb??b?aaaba??b??a?bbcbbcb\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a number sequence A of length N.\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) wit... | [{"input": "10\n33 18 45 28 8 19 89 86 2 4\n", "output": "5\n"}, {"input": "10\n33 4 45 28 15 19 123 86 2 4", "output": "5\n"}, {"input": "10\n33 18 45 28 8 19 89 86 2 7", "output": "6\n"}, {"input": "10\n33 4 45 28 15 19 89 86 2 4", "output": "5\n"}, {"input": "10\n33 2 26 28 13 19 89 86 2 4", "output": "4\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\nCreate a program that will take in a string as input and, if there are duplicates of more than two alphabetic... | [{"input": "\"aaaabbcdefffffffg\"", "output": "[\"aa[aa]bbcdeff[fffff]g\"]", "fn_name": "string_parse"}, {"input": "\"aAAabbcdeFFFffffg\"", "output": "[\"aAAabbcdeFF[F]ff[ff]g\"]", "fn_name": "string_parse"}, {"input": "\"aAAabbcdeffFfFffg\"", "output": "[\"aAAabbcdeffFfFffg\"]", "fn_name": "string_parse"}, {"input": "... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a grid with H rows and W columns. The square at the i-th row and the j-th column will be called Squar... | [{"input": "5 5 4\n13 25 7 15 17\n16 22 20 2 9\n14 11 12 1 19\n10 6 23 8 18\n3 21 5 24 4\n3\n13 13\n2 10\n13 13\n", "output": "0\n5\n0\n"}, {"input": "5 5 4\n13 25 7 15 17\n16 22 20 2 9\n14 11 12 1 19\n10 6 23 8 18\n3 21 5 24 4\n3\n13 13\n0 10\n13 13", "output": "0\n5\n0\n"}, {"input": "5 5 7\n13 25 7 15 17\n16 22 20 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 shop sells $n$ kinds of juices. Each juice has its price $c_i$. Each juice includes some set of vitam... | [{"input": "25\n8 CA\n4 AB\n8 CA\n4 CA\n7 CB\n4 CB\n4 CB\n2 AC\n2 CA\n3 BC\n4 AC\n7 AB\n3 CA\n5 BC\n7 CB\n9 CA\n7 AB\n7 CA\n9 BA\n8 AC\n6 BA\n2 AC\n1 CB\n5 AB\n3 AB\n", "output": "3\n"}, {"input": "25\n8 CA\n4 AB\n8 CA\n4 CA\n2 CB\n4 CB\n4 CB\n2 AC\n2 CA\n3 BC\n4 AC\n7 AB\n3 CA\n5 BC\n7 CB\n9 CA\n7 AB\n7 CA\n9 BA\n8 AC... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give h... | [{"input": "100 456\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, a... | [{"input": "1000010010\n", "output": "2\n1000009977 1000010004\n"}, {"input": "1010011010\n", "output": "2\n1010010985 1010011003\n"}, {"input": "1100011010\n", "output": "2\n1100010985 1100011003\n"}, {"input": "999999979\n", "output": "2\n999999899 999999908 "}, {"input": "101011111\n", "output": "2\n101011094 101011... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 number $k$ and a string $s$ of length $n$, consisting of the characters '.' and '*'. You want... | [{"input": "5\n7 3\n***.**.\n5 12\n.*...\n5 2\n*.*.*\n3 2\n*.*\n1 1\n*\n", "output": "3\n1\n3\n2\n1\n"}, {"input": "5\n7 5\n***.**.\n5 12\n.*...\n5 2\n*.*.*\n3 2\n*.*\n1 1\n*\n", "output": "2\n1\n3\n2\n1\n"}, {"input": "5\n7 3\n***.**.\n5 12\n.*...\n5 2\n*.**.\n3 2\n*.*\n1 1\n*\n", "output": "3\n1\n3\n2\n1\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo T-shirt sizes are given: $a$ and $b$. The T-shirt size is either a string M or a string consisting of sev... | [{"input": "15\nM M\nM L\nL M\nS M\nM S\nL L\nXL L\nL XXXXXXL\nS S\nXXXXS XXXS\nXS XXXXXXS\nM XXXS\nM XXXL\nXXXXXS XL\nXL XXXXS\n", "output": "=\n<\n>\n<\n>\n=\n>\n<\n=\n<\n>\n>\n<\n<\n>\n"}, {"input": "1\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXS XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXL\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\nTernary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is u... | [{"input": "..---.-.--.-..-.-.---...--.-------..-.---.-...-.-----...-.-.....-..--.---.-.-.-----.-.-.-..----.-.----.-.---.--.-..-.----..---.-..--..------.-.-.---.-.-...--....-.--.--.-.-.-..-..-...--..---.-.------.\n", "output": "00211201011210020222101211001221001100001020211122111102201220121201012200211020022201121110... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAdapted from here, with less terrible instructions and a couple tweaks.\n\nTwo kangaroos are jumping on a lin... | [{"input": "72893\n11125\n24432\n4202", "output": "[false]", "fn_name": "kangaroo"}, {"input": "-1571\n4240\n9023\n4234", "output": "[false]", "fn_name": "kangaroo"}, {"input": "-7855\n4240\n9023\n4234", "output": "[true]", "fn_name": "kangaroo"}, {"input": "9023\n4240\n1571\n4234", "output": "[false]", "fn_name": "kan... | 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 array $a$ of length $n$ and array $b$ of length $m$ both consisting of only integers $0$ and... | [{"input": "50 50 6\n1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1\n1 1 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0\n", "output": "2153\n"}, {"input": "50 50 6\n1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 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\nSanta Claus has received letters from $n$ different kids throughout this year. Of course, each kid wants to g... | [{"input": "10\n5 48258 84644 992412 548310 132019\n5 132019 556600 548310 94345 992412\n6 132019 771663 523582 548310 463969 556600\n7 556600 132019 992412 523582 548310 70239 84644\n4 504172 548310 523582 286042\n7 548310 84644 771663 556600 132019 463969 48258\n5 556600 771663 463969 523582 84644\n6 131105 548310 84... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 given integer $n$. Find the number of ways to fill all $3 \\times n$ tiles with the shape describe... | [{"input": "60\n", "output": "1073741824"}, {"input": "60\n", "output": "1073741824"}, {"input": "54\n", "output": "134217728\n"}, {"input": "58\n", "output": "536870912\n"}, {"input": "56\n", "output": "268435456"}, {"input": "56\n", "output": "268435456"}, {"input": "50\n", "output": "33554432\n"}, {"input": "52\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\nYoung boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, tha... | [{"input": "19\n15 73\n16 92\n22 97\n13 64\n49 127\n79 79\n66 13\n49 48\n173 75\n64 77\n27 95\n27 156\n29 53\n48 10\n265 151\n26 37\n13 2\n44 13\n85 70\n", "output": "WBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBB... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a... | [{"input": "1\n", "output": "Hello World\n"}, {"input": "2\n-2\n116", "output": "114\n"}, {"input": "2\n-2\n178", "output": "176\n"}, {"input": "2\n-2\n184", "output": "182\n"}, {"input": "2\n-2\n143", "output": "141\n"}, {"input": "2\n-3\n143", "output": "140\n"}, {"input": "2\n-3\n130", "output": "127\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\nRecently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplace... | [{"input": "10 45 8\n1 2 1\n1 3 1\n1 4 1\n1 5 1\n1 6 1\n1 7 1\n1 8 1\n1 9 1\n1 10 1\n2 3 1\n2 4 1\n2 5 1\n2 6 1\n2 7 1\n2 8 1\n2 9 1\n2 10 1\n3 4 1\n3 5 1\n3 6 1\n3 7 1\n3 8 1\n3 9 1\n3 10 1\n4 5 1\n4 6 1\n4 7 1\n4 8 1\n4 9 1\n4 10 1\n5 6 1\n5 7 1\n5 8 1\n5 9 1\n5 10 1\n6 7 1\n6 8 1\n6 9 1\n6 10 1\n7 8 1\n7 9 1\n7 10 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 positive integer $D$. Let's build the following graph from it: each vertex is a divisor of ... | [{"input": "18\n36\n1 1\n1 2\n1 3\n1 6\n1 9\n1 18\n2 1\n2 2\n2 3\n2 6\n2 9\n2 18\n3 1\n3 2\n3 3\n3 6\n3 9\n3 18\n6 1\n6 2\n6 3\n6 6\n6 9\n6 18\n9 1\n9 2\n9 3\n9 6\n9 9\n9 18\n18 1\n18 2\n18 3\n18 6\n18 9\n18 18\n", "output": "1\n1\n1\n2\n1\n3\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n2\n2\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n3\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\nThe Little Elephant has an integer a, written in the binary notation. He wants to write this number on a piec... | [{"input": "11100010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110000101011010101100011100... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 arrived at the entrance of Udayland. There is a n × n magic grid on the ent... | [{"input": "9\n1 1000000000 1 1000000000 1 1000000000 1 1000000000 1\n1000000000 1 1000000000 1 1 1 1000000000 1 1000000000\n1 1000000000 1 1000000000 1 1000000000 1 1000000000 1\n1000000000 1 1000000000 1 1 1 1000000000 1 1000000000\n1 1 1 1 0 1 1 1 1\n1000000000 1 1000000000 1 1 1 1000000000 1 1000000000\n1 100000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sum of divisors of `6` is `12` and the sum of divisors of `28` is `56`. You will notice that `12/6 = 2` a... | [{"input": "200\n1000", "output": "[1104]", "fn_name": "solve"}, {"input": "100\n1000", "output": "[2223]", "fn_name": "solve"}, {"input": "800\n2000", "output": "[2352]", "fn_name": "solve"}, {"input": "1\n1000", "output": "[2619]", "fn_name": "solve"}, {"input": "1\n300", "output": "[252]", "fn_name": "solve"}, {"inp... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA direced graph is strongly connected if every two nodes are reachable from each other. In a strongly connect... | [{"input": "9 6\n1 1\n1 0\n1 4\n2 4\n4 3\n4 2\n4\n1 1\n-1 3\n2 -1\n3 4", "output": "1\n0\n0\n0\n"}, {"input": "5 6\n0 1\n1 0\n1 0\n2 4\n4 1\n3 2\n4\n0 1\n-1 0\n2 0\n3 4", "output": "1\n0\n0\n0\n"}, {"input": "9 6\n0 1\n1 0\n1 2\n2 4\n4 3\n4 2\n4\n1 1\n-1 3\n2 0\n3 4", "output": "1\n0\n0\n0\n"}, {"input": "5 6\n0 1\n1 0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nINTERCAL is the oldest of esoteric programming languages. One of its many weird features is the method of cha... | [{"input": "aMCT]:0hDJ*Up5g_l:O&>>%gjQkZkb(mi&;\\7dL\"nWOGz/;,6h*@Q0R53MS2<}F~+Ms\\\"cF-lgF0>C&y7)72\\.T\"8*#VO=|^OtYs\n", "output": "122\n212\n240\n152\n112\n94\n80\n246\n244\n208\n254\n170\n156\n98\n198\n236\n196\n218\n106\n142\n232\n0\n216\n190\n144\n204\n180\n124\n132\n144\n50\n94\n32\n50\n136\n162\n78\n198\n244\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\nIn AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's ra... | [{"input": "20\n800 2054 820 830 840 850 384 433 1213 259 900 1139 920 1007 92 2243 960 970 1357 990", "output": "5 5\n"}, {"input": "20\n800 2108 443 830 840 2012 116 614 620 92 399 1139 1229 646 92 2243 174 1254 1914 990", "output": "6 6\n"}, {"input": "20\n800 2108 443 830 840 2012 116 614 620 92 399 1139 1229 646 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given $n$ integers $w_i (i = 0, 1, ..., n-1)$ to be sorted in ascending order. You can swap two integ... | [{"input": "5\n0 91 14 2 11", "output": "120\n"}, {"input": "5\n0 91 14 3 11", "output": "122\n"}, {"input": "5\n1 25 13 2 11", "output": "55\n"}, {"input": "5\n0 91 9 2 11", "output": "106\n"}, {"input": "5\n0 26 3 1 10", "output": "38\n"}, {"input": "5\n0 26 3 1 19", "output": "47\n"}, {"input": "5\n0 17 3 1 13", "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\nA [Narcissistic Number](https://en.wikipedia.org/wiki/Narcissistic_number) is a positive number which is the ... | [{"input": "1634", "output": "[true]", "fn_name": "narcissistic"}, {"input": "153", "output": "[true]", "fn_name": "narcissistic"}, {"input": "370", "output": "[true]", "fn_name": "narcissistic"}, {"input": "371", "output": "[true]", "fn_name": "narcissistic"}, {"input": "1", "output": "[true]", "fn_name": "narcissisti... | 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 of brackets of two types: '(', ')', '[' and ']'.\n\nA string is called... | [{"input": "7\n()\n()\n()\n()\n()\n()\n()\n", "output": "1\n1\n1\n1\n1\n1\n1\n"}, {"input": "7\n()\n()\n()\n()\n()\n()\n()\n", "output": "1\n1\n1\n1\n1\n1\n1\n"}, {"input": "7\n((\n()\n()\n()\n()\n()\n()\n", "output": "0\n1\n1\n1\n1\n1\n1\n"}, {"input": "7\n((\n()\n()\n)(\n()\n()\n()\n", "output": "0\n1\n1\n0\n1\n1\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\nPolycarp is preparing the first programming contest for robots. There are $n$ problems in it, and a lot of ro... | [{"input": "100\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 1 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\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 0 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\nMobile phones are equipped with a function that displays input candidates in order to efficiently input texts... | [{"input": "1\nben mikes bananas eht best among many fruits bec`use bananas are sweet and cheao\nb\n1\nwinners get to visit aizu and eht uvinersity of ahuz amd maje amnx friends as wlel\na\n3\nask alex about\nthe answer for the\nassignmdnt pn diordn` `pps\na\n2\ngnimmargorp si both\na sport aod an laitcelletnu puzzle\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\nVova's house is an array consisting of $n$ elements (yeah, this is the first problem, I think, where someone ... | [{"input": "187 64\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 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\nIt is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-de... | [{"input": "100 50 11\n7 15 0 1 6 7 9 2 4 6 7 7 3 9 4 5 0 7 8 19 4 1 3 6 8 10 4 6 6 1 6 6 7 4 10 3 10 1 3 1 10 6 9 9 5 2 9 2 9 8 10 2 10 3 3 2 3 8 6 2 7 10 7 2 7 2 8 9 6 2 5 4 4 5 3 3 9 10 9 4 9 3 9 5 3 11 6 2 3 6 10 3 10 2 6 13 10 10 4 8\n3 3 2 9 4 4 10 2 7 3 3 2 6 3 3 4 7 4 1 2 3 8 1 6 14 7 2 10 1 0 1 5 7 7 5 1 6 8 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\nIn this Kata, you will be given an array of unique elements, and your task is to rerrange the values so that ... | [{"input": "[78, 79, 52, 87, 16, 74, 31, 63, 80]", "output": "[[87, 16, 80, 31, 79, 52, 78, 63, 74]]", "fn_name": "solve"}, {"input": "[52, 77, 72, 44, 74, 76, 40]", "output": "[[77, 40, 76, 44, 74, 52, 72]]", "fn_name": "solve"}, {"input": "[1, 6, 9, 4, 3, 7, 8, 2]", "output": "[[9, 1, 8, 2, 7, 3, 6, 4]]", "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 playing one RPG from the 2010s. You are planning to raise your smithing skill, so you need as many re... | [{"input": "9\n475033014 267058742\n26843 148652\n850113755 279316120\n871120869 885251487\n51363 15651\n220811492 256297120\n473761699 194406678\n38725 23371\n167395720 333327477\n107541472 19164492\n74340 1113\n654389849 224345301\n663158140 437349008\n332 5052\n971865476 538450184\n959712803 461224210\n3821 6144\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 football season has just ended in Berland. According to the rules of Berland football, each match is play... | [{"input": "1000000000000 68088352351238212 100000 99999\n", "output": "680883461725 61788 319116476487\n"}, {"input": "1108577267933 48182461851369906 125899 19927\n", "output": "382707249106 95156 725869923671\n"}, {"input": "1252579684821 11261673116424810 25436 16077\n", "output": "442745437221 10902 809834236698\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 an infinite array with two rows, the numbers in the top row are denoted\n\n`. . . , A[−2], A[−1], A[0], A[... | [{"input": "[0, 4, 6, 13]\n100", "output": "[335254562473098582210532865941148591672699700764231400858]", "fn_name": "find_a"}, {"input": "[1, 2, 3, 5]\n100", "output": "[60560100487003612846322657690093088848428068520476594299]", "fn_name": "find_a"}, {"input": "[-20, 1, -3, 14]\n-5", "output": "[-44402]", "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\nVanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the ... | [{"input": "10000\n", "output": "38\n"}, {"input": "10001\n", "output": "38\n"}, {"input": "4115\n", "output": "28\n"}, {"input": "9894\n", "output": "38\n"}, {"input": "7969\n", "output": "35\n"}, {"input": "6560\n", "output": "33\n"}, {"input": "9880\n", "output": "38\n"}, {"input": "9879\n", "output": "37\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 bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags an... | [{"input": "45 1\n17 55 85 55 74 20 90 67 40 121 39 178 91 50 16 38 14 43 24 68 25 9 89 71 41 16 53 11 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 24 26", "output": "17592186044416\n"}, {"input": "45 1\n17 55 85 55 74 20 90 67 40 121 39 178 91 50 16 38 14 43 24 68 25 9 89 71 41 16 53 11 94 15 85 72 62 67 42 26 36 66 4 8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times an... | [{"input": "1000000\n", "output": "999996000003000000\n"}, {"input": "862795\n", "output": "642275489615199390\n"}, {"input": "763116\n", "output": "444394078546562430\n"}, {"input": "756604\n", "output": "433115377058855412\n"}, {"input": "978187\n", "output": "935975171582120670\n"}, {"input": "642635\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\nGiven a string, return a new string that has transformed based on the input:\n\n* Change case of every charac... | [{"input": "\"To be OR not to be That is the Question\"", "output": "[\"qUESTION THE IS tHAT BE TO NOT or BE tO\"]", "fn_name": "string_transformer"}, {"input": "\"You Know When THAT Hotline Bling\"", "output": "[\"bLING hOTLINE that wHEN kNOW yOU\"]", "fn_name": "string_transformer"}, {"input": "\" A b C d E f G \... | 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 of lowercase English letters. Determine whether all the characters in S a... | [{"input": "uncopyrightable\n", "output": "yes\n"}, {"input": "uncopyrightacle", "output": "no\n"}, {"input": "elcathgirypocnu", "output": "no\n"}, {"input": "elcathgirxpocnu", "output": "no\n"}, {"input": "elcathgiqxpocnu", "output": "no\n"}, {"input": "elcathgiqxcopnu", "output": "no\n"}, {"input": "elcathfiqxcopnu",... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 matrix of size n × n filled with lowercase English letters. You can change no more than k let... | [{"input": "7 6\nypnxnnp\npnxonpm\nnxanpou\nxnnpmud\nnhtdudu\nnpmuduh\npmutsnz\n", "output": "aaaaaaadudsnz\n"}, {"input": "7 6\nypnxnnp\npnxonpm\nnxanpou\nxnnpmud\nnhtdudu\nnpmuduh\npmutzns\n", "output": "aaaaaaaduduhs"}, {"input": "7 6\nypnxnnp\nmpnoxnp\nnxanpou\nxnnpmud\nnhtdudu\nnpmuduh\npmutsnz\n", "output": "aaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 function is not returning the correct values. Can you figure out why?\n\n```python\nget_planet_name(3) # ... | [{"input": "5", "output": "[\"Jupiter\"]", "fn_name": "get_planet_name"}, {"input": "8", "output": "[\"Neptune\"]", "fn_name": "get_planet_name"}, {"input": "1", "output": "[\"Mercury\"]", "fn_name": "get_planet_name"}, {"input": "2", "output": "[\"Venus\"]", "fn_name": "get_planet_name"}, {"input": "3", "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 an array $a$ of $n$ integers. Count the number of pairs of indices $(i, j)$ such that $i < j$ a... | [{"input": "1\n190\n2 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 2 1 0 1 2 1 2 1 1 2 1 1 1 1 1 1 1 0 2 1 1 1 -1 1 1 1 1 2 0 0 1 1 0 1 1 1 3 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 2 1 1 1 1 2 1 1 1 1 1 1 4 1 0 1 1 1 2 1 0 3 4 5 3 0 8 9 16 11 14 10 14 16 16 17 5 19 20 21 18 4 17 42 5 88 41 29 30 31 32 33 34 35 46 10 68 6 25 15 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\nLittle Artem got n stones on his birthday and now wants to give some of them to Masha. He knows that Masha ca... | [{"input": "1000000000\n", "output": "666666667\n"}, {"input": "1001000000\n", "output": "667333333\n"}, {"input": "1001100000\n", "output": "667400000\n"}, {"input": "1001001000\n", "output": "667334000\n"}, {"input": "1001001100\n", "output": "667334067\n"}, {"input": "1000001100\n", "output": "666667400\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\nThe palindrome is a string that can be read the same way from left to right and from right to left. For examp... | [{"input": "2\n12\n12", "output": "12\n12\n"}, {"input": "2\n14\n11", "output": "14\n10\n"}, {"input": "2\n14\n22", "output": "14\n22\n"}, {"input": "2\n119\n1", "output": "118\n0\n"}, {"input": "2\n65\n12", "output": "64\n12\n"}, {"input": "2\n14\n13", "output": "14\n12\n"}, {"input": "2\n65\n11", "output": "64\n10\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\nTo help those contestants who struggle a lot in contests, the headquarters of Codeforces are planning to intr... | [{"input": "4\n6\n1 1 2 3 1 1\n5\n1 1 1 2 2\n8\n7 7 2 7 7 1 4 7\n10\n1 2 3 10 1 1 2 3 4 1\n", "output": "-1\n3\n-1\n2\n"}, {"input": "4\n6\n2 2 2 3 1 2\n5\n1 1 1 2 2\n8\n7 7 2 7 7 1 8 7\n10\n1 2 6 4 1 1 2 4 4 1\n", "output": "-1\n3\n-1\n2\n"}, {"input": "4\n6\n1 1 2 3 1 1\n5\n1 1 1 2 2\n8\n7 7 1 7 7 1 8 7\n10\n1 2 3 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\nMonocarp has been collecting rare magazines for quite a while, and now he has decided to sell them. He distri... | [{"input": "9\n5\n01110\n10 5 8 9 6\n6\n011011\n20 10 9 30 20 19\n4\n0000\n100 100 100 100\n4\n0111\n5 4 5 1\n5\n01110\n10 5 8 9 6\n6\n011011\n20 10 9 30 20 19\n4\n0000\n100 100 100 100\n4\n0111\n5 4 5 1\n4\n0111\n5 4 5 1\n", "output": "27\n80\n0\n14\n27\n80\n0\n14\n14\n"}, {"input": "7\n6\n011011\n20 10 9 30 20 19\n6\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnalyzing the mistakes people make while typing search queries is a complex and an interesting work. As there... | [{"input": "250\niiffiehchidfgigdbcciahdehjjfacbbaaadagaibjjcehjcbjdhaadebaejiicgidbhajfbfejcdicgfbcchgbahfccbefdcddbjjhejigiafhdjbiiehadfficicbebeeegcebideijidbgdecffeaegjfjbbcfiabfbaiddbjgidebdiccfcgfbcbbfhaejaibeicghecchjbiaceaibfgibhgcfgifiedcbhhfadhccfdhejeggcah\njbadcfjffcfabbecfabgcafgfcgfeffjjhhdaajjgcbgbechhia... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 integer n. You have to arrange numbers from 1 to 2n, using each of them exactly once, on the ci... | [{"input": "7015\n", "output": "YES\n1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a city that can be represented as a square grid with corner points in $(0, 0)$ and $(10^6, 10^6)$.\n... | [{"input": "2\n2 2 4\n0 1000000\n0 1000000\n1 0\n1000000 1\n717934 1000000\n0 999999\n5 4 9\n0 1 2 6 1000000\n0 4 8 1000000\n4 4\n1 3\n2 2\n6 3\n1000000 1\n3 8\n2 8\n10 8\n1 15\n", "output": "2\n7\n"}, {"input": "2\n2 2 4\n0 1000000\n0 1000000\n0 0\n1000000 0\n172846 1000000\n0 999999\n5 4 9\n0 1 2 6 1000000\n0 4 8 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\nEverybody knows that opposites attract. That is the key principle of the \"Perfect Matching\" dating agency. ... | [{"input": "10\n1 -1 2 -2 3 -3 4 -4 0 0\n", "output": "5\n"}, {"input": "10\n1 -1 2 -2 3 -3 4 -5 0 0\n", "output": "4\n"}, {"input": "10\n1 -1 2 -1 1 -3 4 -5 0 0\n", "output": "5\n"}, {"input": "10\n1 -1 2 -1 3 -3 4 -5 0 0\n", "output": "4\n"}, {"input": "10\n1 0 3 -1 0 -3 4 -5 0 0\n", "output": "8\n"}, {"input": "10\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a blackboard on which all integers from -10^{18} through 10^{18} are written, each of them appearing... | [{"input": "123 35 678901234", "output": "410672012\n"}, {"input": "123 45 551859605", "output": "541684692\n"}, {"input": "123 37 551859605", "output": "197524002\n"}, {"input": "123 20 678901234", "output": "401663460\n"}, {"input": "34 13 360190222", "output": "235347591\n"}, {"input": "89 37 551859605", "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\nGiven are integers N and K.\nHow many quadruples of integers (a,b,c,d) satisfy both of the following conditio... | [{"input": "100000 -87789\n", "output": "234266710631140\n"}, {"input": "100000 -38560\n", "output": "546646229688720\n"}, {"input": "100000 51090\n", "output": "472325111688955\n"}, {"input": "100000 -8286\n", "output": "660085336344685\n"}, {"input": "97692 12674\n", "output": "606889464360839\n"}, {"input": "66977 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\nIn this Kata, you will be given an array of integers and your task is to return the number of arithmetic prog... | [{"input": "[0, 1, 4, 5, 7, 9, 10, 13, 15, 16, 18, 19]", "output": "[15]", "fn_name": "solve"}, {"input": "[0, 1, 2, 3, 5, 8, 11, 13, 14, 16, 18, 19]", "output": "[13]", "fn_name": "solve"}, {"input": "[0, 1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 19]", "output": "[17]", "fn_name": "solve"}, {"input": "[0, 5, 8, 9, 11, 13, 14,... | 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\nFind the minimum number with the given sum of digits $s$ such that all digits in it are distinct (i.e. all di... | [{"input": "45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n45\n", "output": "123456789\n123456789\n123456789\n123456789\n123456789\n123456789\n123456789\n123456789\n123456789\n123456789\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 Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today ... | [{"input": "100\n73 81 39 85 48 49 37 20 66 41 79 32 54 71 31 50 48 29 10 85 81 20 20 20 48 54 70 40 71 31 49 77 50 33 12 87 19 12 54 39 87 10 20 39 81 18 70 53 86 7 33 37 62 9 77 54 50 30 70 81 66 12 41 12 20 23 87 73 91 75 94 49 18 71 81 32 79 85 30 94 48 10 41 62 73 90 40 70 90 91 33 100 79 99 62 71 53 66 92 70\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\n# Task\nAfter a long night (work, play, study) you find yourself sleeping on a bench in a park. As you wake u... | [{"input": "[50, 408, 50, 50, 50, 50, 408, 408, 408, 680, 408, 680, 50, 408, 680, 50, 50, 680, 408, 680, 50, 680, 680, 408, 408, 50, 50, 408, 50, 50, 50, 50, 680, 408, 680, 50, 680, 408, 680, 408, 680, 50, 50, 50, 680, 50, 680, 408, 680, 680, 680, 408, 408, 408, 408, 680, 680, 50, 408, 408, 408, 50, 408, 408, 50, 680, ... | 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 only difference between easy and hard versions is constraints.\n\nA session has begun at Beland State Uni... | [{"input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is writing the prototype of a graphic editor. He has already made up his mind that the basic image t... | [{"input": "9 20\n**.......\n****.....\n******...\n*******..\n..******.\n....****.\n......***\n*.....***\n*********\n*********\n*********\n*********\n....**...\n...****..\n..******.\n.********\n****..***\n***...***\n**.....**\n*.......*\n", "output": "********......**********........********\n********......**********..... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBeing tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He s... | [{"input": "5\n-1 10 0 3\n1 10 2 0\n900000000 1000000000 1 9999999\n0 2 1 2\n1 3 1 2\n", "output": "-1\n-1\n10\n-1\n-1\n"}, {"input": "5\n-1 1 0 3\n1 13 2 -1\n900000000 1000000000 1 2570333\n0 2 1 2\n1 3 1 2\n", "output": "-1\n12\n-1\n-1\n-1\n"}, {"input": "5\n0 10 -2 3\n1 10 3 2\n463681791 1000000000 1 9999999\n1 2 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are some rabbits in Singapore Zoo. To feed them, Zookeeper bought $n$ carrots with lengths $a_1, a_2, a... | [{"input": "54 42164\n810471 434523 262846 930807 148016 633714 247313 376546 142288 30094 599543 829013 182512 647950 512266 827248 452285 531124 257259 453752 114536 833190 737596 267349 598567 781294 390500 318098 354290 725051 978831 905185 849542 761886 55532 608148 631077 557070 355245 929381 280340 620004 285066... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 all binary strings of length $m$ ($1 \\le m \\le 60$). A binary string is a string that consists of ... | [{"input": "5\n3 3\n010\n001\n111\n4 3\n000\n111\n100\n011\n1 1\n1\n1 1\n0\n3 2\n00\n01\n10\n", "output": "100\n010\n0\n1\n11\n"}, {"input": "5\n3 3\n010\n001\n110\n4 3\n000\n111\n100\n011\n1 1\n1\n1 1\n0\n3 2\n00\n01\n10\n", "output": "100\n010\n0\n1\n11\n"}, {"input": "5\n3 3\n010\n001\n101\n4 3\n000\n111\n100\n011\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 some countries of former Soviet Union there was a belief about lucky tickets. A transport ticket of any so... | [{"input": "\"943294329932\"", "output": "[false]", "fn_name": "luck_check"}, {"input": "\"1233499943\"", "output": "[false]", "fn_name": "luck_check"}, {"input": "\"543970707\"", "output": "[false]", "fn_name": "luck_check"}, {"input": "\"439924\"", "output": "[false]", "fn_name": "luck_check"}, {"input": "\"935336\""... | 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 the official contest this problem has a different statement, for which jury's solution was working incorre... | [{"input": "20\n713900269 224495293 592111899 609607891 585084800 601258511 223103775 876894656 751583891 230837577 971499807 312977833 344314550 397998873 558637732 216574673 913028292 762852863 464376621 61315042\n", "output": "375537226\n"}, {"input": "20\n713900269 224495293 592111899 609607891 585084800 601258511 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 given $n$ segments which are parallel to X-axis or Y-axis, find the number of intersections of them.\n\nC... | [{"input": "6\n2 2 2 5\n1 3 24 3\n4 2 4 4\n1 2 7 2\n1 1 11 1\n11 5 6 7", "output": "4\n"}, {"input": "6\n2 2 2 5\n1 3 24 3\n4 2 4 4\n1 2 7 2\n1 1 11 1\n11 5 5 7", "output": "4\n"}, {"input": "6\n2 2 2 5\n1 3 24 3\n4 2 4 4\n1 2 7 2\n1 1 11 1\n11 5 6 4", "output": "4\n"}, {"input": "6\n2 2 2 10\n1 3 5 3\n4 1 4 4\n2 2 12 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 prime number $p$, $n$ integers $a_1, a_2, \\ldots, a_n$, and an integer $k$. \n\nFind the num... | [{"input": "7 7 3\n4 0 5 3 1 2 6\n", "output": "0\n"}, {"input": "7 7 3\n4 0 5 3 1 2 6\n", "output": "0"}, {"input": "6 7 2\n1 2 3 4 5 6\n", "output": "3\n"}, {"input": "6 7 2\n1 2 3 4 5 6\n", "output": "3"}, {"input": "5 5 3\n3 0 4 1 2\n", "output": "1\n"}, {"input": "5 5 3\n3 0 4 1 2\n", "output": "1"}, {"input": "2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on... | [{"input": "5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n", "output": "0\n"}, {"input": "5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000010 1000000000", "output": "0\n"}, {"input": "5 4 1\n1000000000 1000000001 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\nA soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for th... | [{"input": "1000 61465564 1000\n", "output": "439034436\n"}, {"input": "859 453892 543\n", "output": "126416972\n"}, {"input": "859 453892 889\n", "output": "339370803\n"}, {"input": "859 267939 889\n", "output": "339556756\n"}, {"input": "859 453892 543\n", "output": "126416972"}, {"input": "859 267939 418\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\nVasya is a CEO of a big construction company. And as any other big boss he has a spacious, richly furnished o... | [{"input": "20 101 100\n1 16 20 3 19 10 12 18 4 17 13 6 8 5 2 15 7 16 9 11\n69 53 101 100 41 38 63 84 96 21 57 100 13 43 90 86 7 20 87 88 59 49 80 82 40 18 9 1 2 67 12 15 83 79 16 22 56 35 60 102 85 28 65 8 6 46 39 25 48 65 47 98 37 27 45 12 72 44 52 75 26 31 14 47 81 95 70 34 97 11 34 73 51 89 68 32 74 42 30 4 131 76 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFox Ciel is playing a card game with her friend Jiro.\n\nJiro has n cards, each one has two attributes: posit... | [{"input": "36 30\nATK 116\nATK 120\nATK 122\nATK 120\nATK 116\nATK 118\nATK 123\nDEF 2564\nATK 123\nDEF 1810\nATK 124\nATK 120\nDEF 2598\nATK 119\nDEF 2103\nATK 123\nATK 118\nATK 118\nATK 123\nDEF 1988\nATK 122\nATK 120\nDEF 2494\nATK 122\nATK 124\nATK 117\nATK 121\nATK 118\nATK 117\nATK 122\nATK 119\nATK 122\nDEF 248... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\nSome children are playing rope skipping game. Children skip the rope at roughly the same speed: `once... | [{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[30]", "fn_name": "tiaosheng"}, {"input": "[10, 20, 30, 40, 47, 60]", "output": "[47]", "fn_name": "tiaosheng"}, {"input": "[10, 20, 30, 40, 58]", "output": "[48]", "fn_name": "tiaosheng"}, {"input": "[10, 20, 30, 40]", "output": "[48]", "fn_name": "tiaosheng"}, ... | 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 Russia regular bus tickets usually consist of 6 digits. The ticket is called lucky when the sum of the fir... | [{"input": "\"12341234\"", "output": "[false]", "fn_name": "is_lucky"}, {"input": "\"100200\"", "output": "[false]", "fn_name": "is_lucky"}, {"input": "\"12a12a\"", "output": "[false]", "fn_name": "is_lucky"}, {"input": "\"123321\"", "output": "[true]", "fn_name": "is_lucky"}, {"input": "\"100001\"", "output": "[true]"... | 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\nWhile dad was at work, a little girl Tanya decided to play with dad's password to his secret database. Dad's ... | [{"input": "100\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa\naaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two strings $s$ and $t$. In a single move, you can choose any of two strings and delete the fir... | [{"input": "lxuyspmieeuyxluv\ndfwxqvavzxctblaa\n", "output": "32\n"}, {"input": "lxuyspmieeuyxluv\naalbtcxzvavqxwfd\n", "output": "32\n"}, {"input": "kxuyspmieeuyxluv\naalbtcxzvavqxwfd\n", "output": "32\n"}, {"input": "vulxyueeimpsyuxk\naalbtcxzvavqxwfd\n", "output": "32\n"}, {"input": "vulxyueeimpsyuxk\naalbtcxyvavqxw... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 size of the input.\n\nYou are given a string $s$ co... | [{"input": "3\n5 2\nBGGGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"input": "3\n5 2\nBGGGG\n5 3\nRBRGR\n5 5\nBBRBR\n", "output": "1\n0\n2\n"}, {"input": "3\n5 3\nBGGGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"input": "3\n5 2\nBGGGG\n5 4\nRBRGR\n5 5\nBBRBR\n", "output": "1\n1\n2\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ consisting of $500000$ integers (numbered from $1$ to $500000$). Initially all ele... | [{"input": "5\n1 3 4\n2 3 0\n2 4 3\n1 500000 1\n2 800 0\n", "output": "4\n4\n1\n"}, {"input": "5\n1 3 4\n2 3 0\n2 4 3\n1 500000 1\n2 800 0\n", "output": "4\n4\n1\n"}, {"input": "5\n1 3 4\n2 3 0\n2 4 3\n1 4 -4\n2 1 0\n", "output": "4\n4\n0\n"}, {"input": "5\n1 3 4\n2 3 0\n2 4 3\n1 4 -4\n2 1 0\n", "output": "4\n4\n0\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1... | [{"input": "100 10000\n100 29 69 46 30 75 24 30 98 20 27 23 76 2 3 5 62 52 79 84 28 62 29 23 36 53 66 3 78 63 85 74 37 8 88 34 79 62 54 5 73 56 94 89 36 85 93 81 34 86 39 28 77 99 13 78 59 56 63 9 13 88 38 38 55 76 93 35 48 45 88 59 69 30 66 53 17 84 30 34 78 92 77 38 86 74 7 38 6 93 66 66 14 59 73 14 41 10 27 53\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 is a building consisting of $10~000$ apartments numbered from $1$ to $10~000$, inclusive.\n\nCall an ap... | [{"input": "36\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n", "output": "90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes... | [{"input": "55\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "output": "383381198\n55\n1\n"}, {"input": "55\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n1000 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\nCreate a function that interprets code in the esoteric language **Poohbear**\n\n## The Language\n\nPoohbear i... | [{"input": "\"+LTQII>+WN<P>+E\"", "output": "[\"1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94... | 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\nIf this challenge is too easy for you, check out: \nhttps://www.codewars.com/kata/5cc89c182777b00001b3e6a2\n\... | [{"input": "[101, 57, 29, 13, 6]", "output": "[[1, 3, 9, 7, 6]]", "fn_name": "reverse"}, {"input": "[84, 42, 21, 10, 2]", "output": "[[4, 7, 3, 8, 2]]", "fn_name": "reverse"}, {"input": "[83, 47, 28, 16, 7]", "output": "[[6, 4, 3, 9, 7]]", "fn_name": "reverse"}, {"input": "[66, 39, 25, 15, 7]", "output": "[[7, 2, 2, 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\nATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but **exactly** 4 digits or e... | [{"input": "\"00000000\"", "output": "[false]", "fn_name": "validate_pin"}, {"input": "\"1234567\"", "output": "[false]", "fn_name": "validate_pin"}, {"input": "\"-12345\"", "output": "[false]", "fn_name": "validate_pin"}, {"input": "\"12345\"", "output": "[false]", "fn_name": "validate_pin"}, {"input": "\"-1234\"", "o... | 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 be given an integer `n` and your task will be to return `the largest integer that is <... | [{"input": "999999999992", "output": "[999999999989]", "fn_name": "solve"}, {"input": "79320", "output": "[78999]", "fn_name": "solve"}, {"input": "99004", "output": "[98999]", "fn_name": "solve"}, {"input": "99088", "output": "[98999]", "fn_name": "solve"}, {"input": "99737", "output": "[98999]", "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\nBertown is a city with $n$ buildings in a straight line.\n\nThe city's security service discovered that some ... | [{"input": "2\n1 1\n01000010\n10 1\n01101110\n", "output": "2\n11\n"}, {"input": "2\n2 1\n11000110\n10 1\n01101111\n", "output": "4\n11\n"}, {"input": "2\n1 1\n01010010\n10 1\n01101100\n", "output": "3\n11\n"}, {"input": "2\n2 1\n10000110\n12 1\n01101111\n", "output": "4\n13\n"}, {"input": "2\n4 1\n10000110\n12 1\n0110... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 beacons located at distinct positions on a number line. The i-th beacon has position a_{i} and po... | [{"input": "11\n110 90\n100 70\n148 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\n", "output": "5\n"}, {"input": "11\n110 90\n100 70\n90 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\n", "output": "4\n"}, {"input": "11\n110 61\n100 70\n90 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\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\nPolycarp is playing a new computer game. This game has $n$ stones in a row. The stone on the position $i$ has... | [{"input": "1\n52\n1 3 3 4 5 10 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 48 29 30 31 32 49 34 35 36 37 38 39 40 41 42 43 21 45 46 47 48 49 50 51 52\n", "output": "2\n"}, {"input": "1\n52\n1 3 3 4 5 10 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 48 29 30 31 32 49 34 35 36 37 38 39 40 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\nAnton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik... | [{"input": "1000000000000000000 1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000 1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000 1100000000000000000\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000 999999999999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 people living on a number line.\nThe i-th person lives at coordinate X_i.\nYou are going to hold ... | [{"input": "100\n1 1 1 100 100 1 100 1 100 100 100 1 100 1 1 1 100 1 100 100 100 1 1 100 100 100 100 100 100 1 1 100 100 100 100 100 1 100 1 1 1 100 100 100 1 100 1 100 100 1 1 1 1 1 1 100 1 1 100 1 1 1 100 100 1 1 100 100 100 100 100 1 100 1 1 100 1 1 1 100 1 100 100 100 1 1 1 100 1 1 100 100 100 1 1 100 1 1 1 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\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\nIn how many ways ca... | [{"input": "100\n881431527 881431559 881431575 881431571 881431526 881431580 881431549 881431529 881431564 881431494 881431507 881431558 881431512 881431531 881431553 881431578 881431557 881431581 881431548 881431565 881431587 881431534 881431533 881431542 881431505 881431500 881431525 881431545 881431570 881431519 881... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 four integers $n$, $c_0$, $c_1$ and $h$ and a binary string $s$ of length $n$.\n\nA binary stri... | [{"input": "7\n10 3 1 1\n1000000110\n1 10 1 1000\n0\n1 1 10 2\n1\n4 4 4 1\n1001\n1 1 1 1\n1\n2 1000 500 1000\n11\n3 500 500 1\n101\n", "output": "17\n10\n3\n16\n1\n1000\n1500\n"}, {"input": "7\n10 3 1 1\n1000000110\n1 10 1 1000\n0\n1 1 10 2\n1\n4 4 4 1\n1001\n1 1 1 1\n1\n2 1000 500 1000\n11\n3 500 500 1\n101\n", "outpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nLet's define the eversion operation. Let x = a_n. Then array a is pa... | [{"input": "3\n5\n0 4 1 5 3\n5\n10 3 0 4 1\n2\n1 1 1 1\n", "output": "1\n2\n0\n"}, {"input": "3\n5\n0 4 1 5 3\n5\n10 3 0 5 1\n2\n1 1 1 1\n", "output": "1\n2\n0\n"}, {"input": "3\n5\n2 4 1 5 3\n5\n5 3 2 0 1\n4\n1 1 1 1\n", "output": "1\n3\n0\n"}, {"input": "3\n5\n2 4 1 5 3\n5\n5 3 2 4 1\n2\n1 1 1 1\n", "output": "1\n2\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've got an array, consisting of n integers a_1, a_2, ..., a_{n}. Also, you've got m queries, the i-th quer... | [{"input": "100 10\n53 72 2 58 6 48 65 13 43 9 77 1 58 28 49 95 12 11 7 36 51 25 78 20 6 2 69 76 1 47 17 6 91 54 50 66 69 122 74 31 19 96 35 84 163 15 65 73 66 73 29 53 17 47 3 19 4 16 85 6 49 6 57 70 96 19 66 92 86 61 10 21 11 82 13 98 59 96 85 1 13 65 28 34 143 16 88 32 60 50 33 37 36 57 97 28 18 23 30 70\n25 43\n20 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nGiven the string S, which consists of lowercase letters and numbers. Follow the steps below to com... | [{"input": "0ig3hd12fz99", "output": "10\n"}, {"input": "0hg3hd12fz99", "output": "11\n"}, {"input": "0hg3hd13fz99", "output": "12\n"}, {"input": "0hf3hd12fz99", "output": "11\n"}, {"input": "99zf21dh3fh0", "output": "11\n"}, {"input": "0hfdh312fz99", "output": "11\n"}, {"input": "0gfdh312fz99", "output": "11\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\nBased on [this kata, Connect Four.](https://www.codewars.com/kata/connect-four-1)\n\nIn this kata we play a m... | [{"input": "[\"C_R\", \"p_Y\", \"a_B\", \"Q_T\", \"s_S\", \"I_R\", \"Z_Y\", \"a_B\", \"c_T\", \"d_S\", \"O_R\", \"C_Y\", \"M_B\", \"Q_T\", \"O_S\", \"I_R\", \"U_Y\", \"J_B\", \"K_T\", \"V_S\", \"i_R\", \"o_Y\", \"r_B\", \"H_T\", \"I_S\", \"C_R\", \"n_Y\", \"W_B\", \"G_T\", \"j_S\", \"p_R\", \"m_Y\", \"Y_B\", \"b_T\", \... | 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\nVasya owns three big integers — $a, l, r$. Let's define a partition of $x$ such a sequence of strings $s_1, s... | [{"input": "12212222221212222221221221222222121222222122\n22222111112222222222221221222222121222222122\n22222111112222222222221221222222121222222122\n", "output": "0\n"}, {"input": "12212222221212222221221221222222121222222122\n28110439567417001223290131317494419039608149\n22222111112222222222221221222222121222222122\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\nMemory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with... | [{"input": "87 100 200 80\n", "output": " 913761305\n"}, {"input": "38 38 701 74\n", "output": " 496603581\n"}, {"input": "40 94 510 53\n", "output": " 233079... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef likes strings a lot but he likes palindromic strings more. Today, Chef has two strings A and B, each con... | [{"input": "3\nabc\nabc\nb\nb\nabba\nbaab", "output": "Yes\nYes\nYes\n"}, {"input": "3\nabb\nabc\nb\nb\nabba\nbaab", "output": "Yes\nYes\nYes\n"}, {"input": "3\nabb\ncba\nb\nb\nabba\nbaab", "output": "Yes\nYes\nYes\n"}, {"input": "3\nbba\ncba\nb\nb\nabba\nbaab", "output": "Yes\nYes\nYes\n"}, {"input": "3\nbba\ncba\nb\n... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.