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 N points on a plane. Write a program which will find the sum of squares of distances between al... | [{"input": "30\n-7 -23\n-2 5\n13 8\n12 17\n15 -18\n20 6\n21 8\n-13 12\n-4 -20\n-11 -16\n-6 16\n1 -1\n5 -12\n13 -17\n11 10\n8 -9\n-13 3\n19 -13\n-19 -8\n-14 10\n10 3\n-16 -8\n-17 16\n-14 -15\n5 1\n-13 -14\n13 17\n-12 -8\n2 1\n18 5\n", "output": "279169\n"}, {"input": "30\n-7 -23\n-2 5\n13 8\n12 17\n15 -18\n11 6\n21 8\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\nImplement `String#to_cents`, which should parse prices expressed as `$1.23` and return number of cents, or in... | [{"input": "\"$12345678.90\"", "output": "[1234567890]", "fn_name": "to_cents"}, {"input": "\"$9.69$4.3.7\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"$1.23\\n\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"\\n$1.23\"", "output": "[null]", "fn_name": "to_cents"}, {"input": "\"$99.99\"", "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\nLet's call a sequence $b_1, b_2, b_3 \\dots, b_{k - 1}, b_k$ almost increasing if $$\\min(b_1, b_2) \\le \\mi... | [{"input": "3\n8\n1 2 7 3 2 1 2 3\n2\n2 1\n7\n4 1 5 2 6 3 7\n", "output": "\n6\n2\n7\n"}, {"input": "3\n8\n1 2 7 3 2 1 2 3\n2\n2 1\n7\n4 1 5 2 6 3 7\n", "output": "6\n2\n7\n"}, {"input": "3\n8\n1 2 7 3 2 1 2 5\n2\n2 1\n7\n4 1 5 2 6 3 7\n", "output": "6\n2\n7\n"}, {"input": "3\n8\n1 2 7 6 2 1 1 3\n2\n2 1\n7\n4 1 5 2 6 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\nMany years ago Berland was a small country where only $n$ people lived. Each person had some savings: the $i$... | [{"input": "4\n4 3\n6 1 2 1\n4 10\n11 9 11 18\n2 5\n4 3\n3 7\n9 4 11\n", "output": "3\n4\n0\n3\n"}, {"input": "4\n4 3\n10 1 2 1\n4 10\n11 7 11 9\n2 5\n4 3\n3 7\n9 2 9\n", "output": "4\n3\n0\n2\n"}, {"input": "4\n4 3\n10 1 3 1\n4 10\n11 7 11 9\n2 5\n4 3\n3 6\n9 2 9\n", "output": "4\n3\n0\n3\n"}, {"input": "4\n4 3\n6 1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA subsequence of length |x| of string s = s1s2... s|s| (where |s| is the length of string s) is a string x = ... | [{"input": "ctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqegvwtbxlvvjhebshqaicsovtkcdovytimjggglyxlvglgunbohnkxargymbqvzgsnvjzgxivdgnaesgxqcruaopjuqsyyorrobnelehjnxcetveehlbmeskptivsuhuqupbieumycwczxyqjtwfofehfkpqmjngygwxkaviuyouiippgvlxjgtkxmhcwtzacbllsybgiujyryngapfwjkkyapfgxtcdpc\nctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqe... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLord Omkar would like to have a tree with n nodes (3 β€ n β€ 10^5) and has asked his disciples to construct the... | [{"input": "2\n27 4\n1 3 3\n4 2 2\n5 7 10\n4 9 4\n6 0\n1 2 -1\n2 6 4\n4 1 8\n", "output": "1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n1 25\n1 26\n1 27\n1 2\n1 3\n1 4\n1 5\n1 6\n"}, {"input": "2\n26 4\n1 3 3\n4 4 7\n5 1 17\n4 9 4\n6 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\nEvi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.\nH... | [{"input": "4\n-100 -45 -100 -100", "output": "2269\n"}, {"input": "4\n-100 -100 -100 -100\n", "output": "0\n"}, {"input": "4\n-100 -100 -100 -100", "output": "0"}, {"input": "3\n-3 -1 23", "output": "419\n"}, {"input": "3\n-3 -1 21", "output": "355\n"}, {"input": "3\n-4 -1 21", "output": "373\n"}, {"input": "3\n1 -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\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N su... | [{"input": "200000 1\n", "output": "8000000000000000\n"}, {"input": "200000 2\n", "output": "2000000000000000\n"}, {"input": "200000 3\n", "output": "296287407496296\n"}, {"input": "100004 8\n", "output": "3906718787501\n"}, {"input": "100000 7\n", "output": "2915014599125\n"}, {"input": "10003 8\n", "output": "3906250... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasily has a number a, which he wants to turn into a number b. For this purpose, he can do two types of opera... | [{"input": "1 536870912\n", "output": "YES\n30\n1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 \n"}, {"input": "1 536870912\n", "output": "YES\n30\n1 2 4 8 16 32 64 128 256 512 1024 2048 409... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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<image>\n\nInput\n\nThe input contains two integers a, b (1 β€ a β€ 10, 0 β€ b β€ 22Β·a - 1) separated by a single... | [{"input": "10 165056\n", "output": "391 431\n"}, {"input": "10 595169\n", "output": "619 770\n"}, {"input": "10 156555\n", "output": "468 325\n"}, {"input": "10 140634\n", "output": "323 383"}, {"input": "10 1048575\n", "output": "1023 0"}, {"input": "10 921462\n", "output": "757 203"}, {"input": "10 850222\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\nThe Little Elephant loves Ukraine very much. Most of all he loves town Rozdol (ukr. \"Rozdil\").\n\nHowever, ... | [{"input": "100\n922 938 103 689 526 118 314 496 373 47 224 544 495 656 804 754 269 356 354 536 817 597 787 178 516 659 790 993 786 169 866 779 997 350 674 310 219 546 564 893 402 449 751 628 329 686 392 951 716 439 332 563 215 146 746 311 866 773 548 1100 731 183 890 802 488 944 473 25 662 559 732 534 777 144 502 593 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 `A`, `B` and `C`.\n\nSnuke wants to perform the following operation on... | [{"input": "ABBACCBACCBCAABCB", "output": "2\n"}, {"input": "ACBAACBCCABCCBBBA", "output": "1\n"}, {"input": "ABCAACBCAABCCBBBC", "output": "3\n"}, {"input": "ACCAAABCAABCCBBBC", "output": "8\n"}, {"input": "ABBBCCBACCBCAABCB", "output": "2\n"}, {"input": "ABBBCCBACCBCAABCA", "output": "2\n"}, {"input": "ACBAACBCAABCCB... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarpus is the director of a large corporation. There are n secretaries working for the corporation, each ... | [{"input": "123\n0 6361 8903 10428 0 258 0 10422 0 0 2642 1958 0 0 0 0 0 8249 1958 0 0 2642 0 0 0 11566 4709 1847 3998 0 1331 0 0 10289 2739 6135 3450 0 0 10994 6069 4337 5854 1331 5854 0 630 630 11244 5928 2706 0 683 214 0 9080 0 0 0 10422 683 11566 10994 0 0 3450 11244 11542 3998 1847 2708 9871 2739 2001 0 12216 6069... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 doing some spring cleaning, Daniel found an old calculator that he loves so much. However, it seems lik... | [{"input": "3\n1 8\n378 590\n0 1001000\n", "output": "26\n3586\n3444149719\n"}, {"input": "3\n0 4\n378 590\n1 1000000\n", "output": "17\n3586\n3439863766\n"}, {"input": "3\n1 4\n323 590\n1 1000000\n", "output": "8\n4758\n3439863766\n"}, {"input": "3\n0 4\n217 323\n1 1000000\n", "output": "17\n562\n3439863766\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\nLately, Mr. Chanek frequently plays the game Arena of Greed. As the name implies, the game's goal is to find ... | [{"input": "2\n18\n122\n", "output": "14\n114\n"}, {"input": "2\n20\n122\n", "output": "15\n114\n"}, {"input": "2\n12\n122\n", "output": "9\n114\n"}, {"input": "2\n10\n122\n", "output": "8\n114\n"}, {"input": "2\n3\n122\n", "output": "2\n114\n"}, {"input": "2\n6\n122\n", "output": "4\n114\n"}, {"input": "2\n4\n122\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\nNezzar has a binary string s of length n that he wants to share with his best friend, Nanako. Nanako will spe... | [{"input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\n0110001110\n1 10\n5 9\n7 10\n1 7\n3 5\n6 10\n5 2\n10000\n11000\n2 5\n1 3\n", "output": "\nYES\nNO\nYES\nNO\n"}, {"input": "4\n5 2\n00000\n00111\n1 5\n1 3\n2 1\n00\n01\n1 2\n10 6\n1111111111\n0110000110\n1 10\n5 9\n7 10\n1 7\n3 5\n6 10\n5 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a sequence a_1, a_2, ..., a_n, consisting of integers.\n\nYou can apply the following operation... | [{"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 7 8 8\n7\n2 2 5 2 6 2 7\n", "output": "2\n0\n1\n"}, {"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 7 8 2\n7\n2 2 5 2 6 2 7\n", "output": "2\n2\n1\n"}, {"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 3 8 2\n7\n2 2 5 2 6 2 7\n", "output": "2\n3\n1\n"}, {"input": "3\n7\n3 1 6 6 3 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\nFor a positive integer n, let us define f(n) as the number of digits in base 10.\nYou are given an integer S.... | [{"input": "100000000\n", "output": "914705724\n"}, {"input": "91304885\n", "output": "555850206\n"}, {"input": "89317875\n", "output": "494668252\n"}, {"input": "78876118\n", "output": "915018436\n"}, {"input": "18434582\n", "output": "752917978\n"}, {"input": "15764866\n", "output": "563424334\n"}, {"input": "7952872... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 chessboard consisting of $n$ rows and $n$ columns. Rows are numbered from bottom to top from ... | [{"input": "5 3 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n1\n2\n2\n1\n"}, {"input": "5 5 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n2\n3\n3\n2\n"}, {"input": "5 5 5\n4 4\n3 5\n2 3\n3 3\n3 5\n", "output": "0\n2\n2\n3\n2\n"}, {"input": "5 5 5\n1 4\n3 5\n2 3\n3 3\n3 5\n", "output": "3\n3\n3\n3\n3\n"}, {"input": "5 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\nPlease notice the unusual memory limit of this problem.\n\nOrac likes games. Recently he came up with the new... | [{"input": "5 5 3\n01011\n10110\n01101\n11010\n10101\n1 1 4\n1 2 3\n5 5 3\n", "output": "1\n0\n1\n"}, {"input": "5 5 3\n01011\n10110\n01101\n11010\n10001\n1 1 4\n1 2 3\n5 5 3\n", "output": "1\n0\n1\n"}, {"input": "5 5 3\n01011\n10110\n01101\n11010\n10001\n1 1 4\n1 2 2\n5 5 3\n", "output": "1\n1\n1\n"}, {"input": "5 5 3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n games in a football tournament. Three teams are participating in it. Currently k games had alread... | [{"input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 6 0 0\n3 3 3 2\n", "output": "yes\nyes\nyes\nyes\nno\n"}, {"input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 3 3 -1\n3 3 3 2\n", "output": "yes\nyes\nyes\nno\nno\n"}, {"input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 3 3 -1\n3 3 4 2\n", "output": "yes\nyes\nyes\nno\nno\n"}, {"input": "5\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\nAmugae has a hotel consisting of $10$ rooms. The rooms are numbered from $0$ to $9$ from left to right.\n\nTh... | [{"input": "100\nLLLLLLLLLL0L2L48LL6L7L7L0L3L0L63LL3L4L9L2L7L6L3L8L2L5L9L0L3L3L9L3L3L3L5L2L2L2L1L8L5L7L9L2L05L0LL6L2L\n", "output": "1111111111\n"}, {"input": "100\nRRLLLLLLRR1R7R3L2R0L52RR2R4L1L7L6R4R0R4L5L4L5R2R8L7R0R6R4R8L6L8L4R5R7R3L9R7L64RR8L0R6R4R9L0R9R7R7R0L\n", "output": "1111111111\n"}, {"input": "100\nL0L0R9R... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Menger Sponge is a three-dimensional fractal, first described by Karl Menger in 1926.\n\n![Mengers Sponge... | [{"input": "6", "output": "[64000000]", "fn_name": "calc_ms"}, {"input": "5", "output": "[3200000]", "fn_name": "calc_ms"}, {"input": "4", "output": "[160000]", "fn_name": "calc_ms"}, {"input": "3", "output": "[8000]", "fn_name": "calc_ms"}, {"input": "2", "output": "[400]", "fn_name": "calc_ms"}, {"input": "1", "outpu... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so t... | [{"input": "101\n1 50 170 269 214 153 132 234 181 188 180 225 226 200 197 122 181 168 160 220 223 160 235 94 257 145 199 235 102 146 119 60 109 134 209 260 210 191 180 271 236 195 155 169 166 143 106 102 208 137 278 269 156 251 198 165 111 198 151 213 256 121 276 163 179 285 104 99 139 122 188 184 215 242 244 115 304 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\nProblem H: Squid Multiplication\n\nSquid Eiko loves mathematics. Especially she loves to think about integer.... | [{"input": "3\n6 10 26 15 27 35\n2\n30 42 35\n0", "output": "2\n3 5 13\n6\n5 7\n"}, {"input": "3\n6 10 28 15 31 35\n2\n30 42 35\n0", "output": "2\n3 5 14\n6\n5 7\n"}, {"input": "3\n6 10 26 15 27 43\n2\n30 42 35\n0", "output": "2\n3 5 13\n6\n5 7\n"}, {"input": "3\n6 10 14 15 27 35\n2\n30 42 35\n0", "output": "2\n3 5 7\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\nThis is a story of a world somewhere far from the earth. In this world, the land is parted into a number of c... | [{"input": "3 3\n3 4 1 1\n2 1 5\n2 3 3\n3 6\n3 2 5 1\n2 1 5\n2 3 3\n0 0", "output": "Yes\nYes\n"}, {"input": "3 6\n3 8 1 1\n2 2 6\n2 2 3\n3 3\n3 2 5 1\n2 1 11\n2 3 3\n0 0", "output": "Yes\nNo\n"}, {"input": "3 2\n3 11 1 1\n2 2 8\n2 2 3\n3 5\n3 4 5 1\n2 0 11\n2 3 3\n0 0", "output": "No\nNo\n"}, {"input": "3 3\n3 4 1 1\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBecause of budget cuts one IT company established new non-financial reward system instead of bonuses.\n\nTwo ... | [{"input": "444\n", "output": "2159776046970635520\n"}, {"input": "498\n", "output": "5392730685240975000"}, {"input": "500\n", "output": "5567867859752100000"}, {"input": "500\n", "output": "5567867859752100000"}, {"input": "498\n", "output": "5392730685240975000"}, {"input": "308\n", "output": "117307091246785440\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\nRoma is playing a new expansion for his favorite game World of Darkraft. He made a new character and is going... | [{"input": "10 10 10\n51 87\n68 743\n82 1284\n73 936\n55 242\n89 1554\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 386\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 84 386\n97 4 386\n45 56 386\n", "output": "212\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 guessed some integer number $x$. You are given a list of almost all its divisors. Almost all means that th... | [{"input": "25\n2\n999389 999917\n2\n999307 999613\n2\n999529 999611\n2\n999221 999853\n2\n999683 999433\n2\n999907 999749\n2\n999653 999499\n2\n999769 999931\n2\n999809 999287\n2\n999233 999239\n2\n999553 999599\n2\n999371 999763\n2\n999491 999623\n2\n999961 999773\n2\n999671 999269\n2\n999883 999437\n2\n999953 999331... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAccording to the regulations of Berland's army, a reconnaissance unit should consist of exactly two soldiers.... | [{"input": "100 100\n51 93 101 960 2 477 213 129 663 925 254 78 1486 274 160 481 132 156 589 372 3 57 210 298 1771 7 359 468 254 406 202 929 221 366 552 97 555 29 634 118 539 140 992 854 7 163 134 103 940 30 409 1003 564 43 555 79 107 40 23 103 643 171 310 382 770 288 18 189 570 177 29 54 855 171 451 291 563 935 620 18... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven are a sequence of N integers A_1, A_2, \\ldots, A_N and a positive integer S.\n\nFor a pair of integers... | [{"input": "2896 1518\n498 2010 1723 2089 76 1224 1972 612 465 880 283 143 1538 372 841 1998 292 2096 423 728 2199 807 2325 1185 1664 2349 531 40 1039 2006 2179 1842 2954 2847 2540 1045 2697 2112 1625 2062 631 2136 544 2420 1199 2592 2820 802 1157 383 1164 617 1513 2876 2625 947 1720 1640 1772 2137 282 754 1325 2663 27... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. ... | [{"input": "15 10\n1 9\n4 8\n4 8\n5 9\n1 9\n3 5\n1 6\n1 9\n2 6\n6 9\n", "output": "3\n0 1 2 0 1 2 0 1 2 0 1 2 0 1 2\n"}, {"input": "15 10\n1 9\n4 8\n4 8\n5 9\n1 9\n3 5\n1 6\n1 9\n4 6\n6 9\n", "output": "3\n0 1 2 0 1 2 0 1 2 0 1 2 0 1 2\n"}, {"input": "15 10\n1 9\n4 8\n4 8\n5 9\n1 9\n3 5\n1 6\n1 9\n1 6\n6 9\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\nPolycarpus has postcards and photos hung in a row on the wall. He decided to put them away to the closet and ... | [{"input": "CPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCP\n", "output": "100\n"}, {"input": "PPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPPPPPCCCPPPPCCCCCPCC\n", "output": "23\n"}, {"input": "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 square painted on a piece of paper, the square's side equals n meters. John Doe draws crosses on t... | [{"input": "8\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 13\n", "output": "4000000001\n4000000001\n4000000001\n4000000001\n4000000001\n4000000001\n4000000001\n27\n"}, {"input": "8\n1000000000 1000000000 1000000000 1000000100 1000000000 1000000000 1000000000 13\n", "output": "400000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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[INSPION FullBand Master - INSPION](https://www.youtube.com/watch?v=kwsciXm_7sA)\n\n[INSPION - IOLITE-SUNSTON... | [{"input": "50\n21 10\n30 22\n3 37\n37 32\n4 27\n18 10\n2 30\n29 19\n6 37\n12 39\n47 25\n41 49\n45 9\n25 48\n16 14\n10 7\n33 28\n3 31\n34 16\n35 37\n27 40\n45 16\n29 44\n16 15\n26 3\n1 12\n2 13\n15 21\n43 14\n9 33\n44 15\n46 1\n38 5\n15 5\n1 32\n42 35\n20 27\n23 12\n1 16\n15 17\n36 50\n13 8\n49 45\n11 2\n24 4\n36 15\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ of $n$ integers and an integer $s$. It is guaranteed that $n$ is odd.\n\nIn one op... | [{"input": "7 33\n21 15 12 11 20 19 12\n", "output": "57\n"}, {"input": "7 20\n2 15 12 11 20 19 12\n", "output": "14\n"}, {"input": "7 20\n1 15 12 11 29 20 12\n", "output": "13\n"}, {"input": "7 20\n1 13 12 11 29 20 12\n", "output": "15\n"}, {"input": "7 20\n1 13 10 15 29 20 12\n", "output": "12\n"}, {"input": "7 20\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\nFor a given weighted graph $G = (V, E)$, find the shortest path from a source to each vertex. For each vertex... | [{"input": "5\n0 3 2 4 3 1 1 2\n1 2 3 3 3 4\n2 3 0 3 3 2 4 1\n3 4 0 1 0 -1 1 0 3 3\n4 2 0 1 3 3", "output": "0 0\n1 1\n2 4\n3 1\n4 5\n"}, {"input": "5\n0 3 2 4 3 1 1 2\n1 2 1 4 3 4\n2 3 0 10 3 0 4 1\n3 4 0 1 0 1 1 1 1 3\n4 2 2 1 3 3", "output": "0 0\n1 2\n2 4\n3 1\n4 5\n"}, {"input": "5\n0 3 2 3 3 2 1 0\n1 2 0 5 4 4\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\nDima is a beginner programmer. During his working process, he regularly has to repeat the following operation... | [{"input": "15 12\n2\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "12\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\n"}, {"input": "15 12\n9\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "5\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\n"}, {"input": "15 12\n9\n10\n5\n2\n7\n2\n8\n6\n4\n10\n12\n1\n", "output": "5\n13\n3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a three-digit integer N. Does N contain the digit 7?\nIf so, print Yes; otherwise, print No.\n\n----... | [{"input": "117\n", "output": "Yes\n"}, {"input": "777\n", "output": "Yes\n"}, {"input": "974\n", "output": "Yes\n"}, {"input": "477\n", "output": "Yes\n"}, {"input": "758\n", "output": "Yes\n"}, {"input": "767\n", "output": "Yes\n"}, {"input": "779\n", "output": "Yes\n"}, {"input": "1760", "output": "Yes\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 two binary strings $x$ and $y$, which are binary representations of some two integers (let's de... | [{"input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010101\n11110000\n", "output": "1\n3\n0\n0\n"}, {"input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010100\n11110000\n", "output": "1\n3\n0\n0\n"}, {"input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010100\n11100000\n", "output": "1\n3\n0\n1\n"}, {"input": "4\n1010\n11\n1000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 image, that can be represented with a 2-d n by m grid of pixels. Each pixel of the image is ... | [{"input": "3 5\n00100\n10110\n11001\n", "output": "5\n"}, {"input": "3 5\n00100\n00110\n11001\n", "output": "4\n"}, {"input": "3 5\n00100\n00110\n11011\n", "output": "5\n"}, {"input": "3 5\n00100\n00110\n01001\n", "output": "3\n"}, {"input": "3 5\n00100\n00110\n11111\n", "output": "6\n"}, {"input": "3 5\n00110\n00110\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 assume that v(n) is the largest prime number, that does not exceed n;\n\n u(n) is the smallest prime ... | [{"input": "6\n885\n419\n821\n635\n63\n480\n", "output": "781453/1566442\n175559/352798\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n"}, {"input": "6\n885\n419\n821\n635\n63\n480\n", "output": "781453/1566442\n175559/352798\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n"}, {"input": "6\n1656\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is little time left before the release of the first national operating system BerlOS. Some of its compo... | [{"input": "47 43\nerase 1\nalloc 95\nalloc 53\nerase 2\ndefragment\nalloc 100\nerase 4\nerase 2\nerase -849472053\ndefragment\nerase -638355221\nalloc 90\nerase 3\nerase 2\ndefragment\nalloc 17\nerase 5\ndefragment\nerase 6\ndefragment\nerase 3\ndefragment\ndefragment\nalloc 99\nalloc 69\nalloc 80\nerase 9\nerase 5\nd... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forw... | [{"input": "141221001", "output": "[[22, 141, 1001, 1221]]", "fn_name": "palindrome"}, {"input": "34322122", "output": "[[22, 212, 343, 22122]]", "fn_name": "palindrome"}, {"input": "13598", "output": "[\"No palindromes found\"]", "fn_name": "palindrome"}, {"input": "10015885", "output": "[[88, 1001, 5885]]", "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\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nArrays have fallen out of C... | [{"input": "3\n2\n1 1\n2\n1 1\n3\n1 2 -1", "output": "2\n2\n2\n"}, {"input": "3\n2\n1 1\n2\n1 2\n3\n1 2 -1", "output": "2\n1\n2\n"}, {"input": "3\n2\n1 2\n2\n1 1\n3\n1 2 -1", "output": "1\n2\n2\n"}, {"input": "3\n2\n2 2\n2\n1 1\n3\n1 2 -1", "output": "2\n2\n2\n"}, {"input": "3\n2\n1 1\n2\n0 2\n3\n1 2 -1", "output": "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\nThanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap you... | [{"input": "16\n12 17 18 51 49 54 107 59 68 74 88 91 98 100 66 49\n", "output": "4\n"}, {"input": "16\n12 17 18 51 52 54 56 59 68 74 88 91 98 100 66 49\n", "output": "8\n"}, {"input": "16\n12 17 18 51 52 54 56 59 68 74 88 91 98 100 66 49\n", "output": "8\n"}, {"input": "16\n12 17 18 51 49 54 56 59 68 74 88 91 98 100 66... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 program that takes in a letterclass ID of a ship and display the equivalent string class description ... | [{"input": "3 \nB\nb\nB", "output": "BattleShip\nBattleShip\nBattleShip\n"}, {"input": "3 \nD\nb\nB", "output": "Destroyer\nBattleShip\nBattleShip\n"}, {"input": "3 \nB\nb\nD", "output": "BattleShip\nBattleShip\nDestroyer\n"}, {"input": "3 \nB\nd\nB", "output": "BattleShip\nDestroyer\nBattleShip\n"}, {"input": "3 \nB\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 a text of single-space separated words, consisting of small and capital Latin letters.\n\nVolum... | [{"input": "200\nLBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz\n", "output": "105\n"}, {"input": "200\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n Changu and Mangu are great buddies. Once they found an infinite paper which had 1,2,3,4,5,6,7,8,....... | [{"input": "134", "output": "[false]", "fn_name": "survivor"}, {"input": "15", "output": "[false]", "fn_name": "survivor"}, {"input": "289", "output": "[true]", "fn_name": "survivor"}, {"input": "5", "output": "[false]", "fn_name": "survivor"}, {"input": "8", "output": "[false]", "fn_name": "survivor"}, {"input": "9", ... | 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\nDima loves Inna very much. He decided to write a song for her. Dima has a magic guitar with n strings and m f... | [{"input": "11 11 9 11\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 2 2 1\n1 1 1 1 1 1 1 1 3 1 1\n1 1 1 1 1 1 1 3 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1 1 2 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1\n3 3 3 3 3 3 3 3 3 2 2\n", "output": "14\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# Kata Task\n\nGiven a list of random integers, return the Three Amigos.\n\nThese are 3 numbers that live nex... | [{"input": "[2, 4, 6, 8, 10, 2, 2, 2, 1, 1, 1, 5, 3]", "output": "[[2, 2, 2]]", "fn_name": "three_amigos"}, {"input": "[1, 2, 34, 2, 1, 5, 3, 5, 7, 234, 2, 1]", "output": "[[5, 3, 5]]", "fn_name": "three_amigos"}, {"input": "[6, 9, -18, -19, -14, -10, -24]", "output": "[[-14, -10, -24]]", "fn_name": "three_amigos"}, {"... | 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 decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two n... | [{"input": "999999999999990\n", "output": "181818181818180\n"}, {"input": "999999999999991\n", "output": "181818181818181\n"}, {"input": "999999999999996\n", "output": "181818181818181\n"}, {"input": "999999999999997\n", "output": "181818181818182\n"}, {"input": "49247635594153\n", "output": "8954115562574\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\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the squar... | [{"input": "19 -1 0\n2 3 6\n4 -4 -1", "output": "No\n"}, {"input": "12 -1 3\n2 2 3\n2 -4 2", "output": "No\n"}, {"input": "12 -1 0\n2 2 3\n2 -4 2", "output": "No\n"}, {"input": "12 -1 0\n2 2 3\n4 -4 2", "output": "No\n"}, {"input": "12 -1 0\n2 2 3\n4 -4 0", "output": "No\n"}, {"input": "12 -1 0\n2 2 3\n4 -4 1", "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\n> In information theory and computer science, the Levenshtein distance is a string metric for measuring the d... | [{"input": "\"qlzcfayxiz\"\n\"vezkvgejzb\"", "output": "[9]", "fn_name": "levenshtein"}, {"input": "\"nayvyedosf\"\n\"sjxen\"", "output": "[9]", "fn_name": "levenshtein"}, {"input": "\"kitten\"\n\"sitting\"", "output": "[3]", "fn_name": "levenshtein"}, {"input": "\"sjxen\"\n\"sjxen\"", "output": "[0]", "fn_name": "leve... | 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\nMr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert... | [{"input": "lsdijfjisl\n", "output": "lsdijfjidsl\n"}, {"input": "lsdijfjisl\n", "output": "lsdijfjidsl\n"}, {"input": "lsdijfjisl\n", "output": "lsdijfjidsl\n"}, {"input": "lsdijgjisl\n", "output": "lsdijgjidsl\n"}, {"input": "nqwcvcwqn\n", "output": "nqwcvvcwqn\n"}, {"input": "jewiiwefj\n", "output": "jfewiiwefj\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\nPrize\n\nSegtree entered a programming contest with a team of $ N $ and won a $ K $ yen prize! I'm trying to ... | [{"input": "48 109", "output": "56\n"}, {"input": "12 100", "output": "51\n"}, {"input": "1 100", "output": "100\n"}, {"input": "8 203", "output": "103\n"}, {"input": "1 110", "output": "110\n"}, {"input": "11 152", "output": "78\n"}, {"input": "1 173", "output": "173\n"}, {"input": "8 253", "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\nThere was a powerful school where powerful people gathered. At the athletic meet of the powerful school, powe... | [{"input": "3\n156 120\n100 50\n80 100", "output": "1\n"}, {"input": "3\n156 120\n100 50\n80 000", "output": "1\n"}, {"input": "3\n156 159\n100 50\n80 000", "output": "1\n"}, {"input": "3\n156 22\n100 50\n152 000", "output": "1\n"}, {"input": "3\n156 11\n100 50\n80 000", "output": "1\n"}, {"input": "3\n156 22\n100 50\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\nPetya is a big fan of mathematics, especially its part related to fractions. Recently he learned that a fract... | [{"input": "1000\n", "output": "499 501\n"}, {"input": "1000\n", "output": "499 501\n"}, {"input": "1120\n", "output": "559 561\n"}, {"input": "1010\n", "output": "503 507\n"}, {"input": "1200\n", "output": "599 601\n"}, {"input": "1764\n", "output": "881 883\n"}, {"input": "1729\n", "output": "864 865\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke, who loves animals, built a zoo.\nThere are N animals in this zoo. They are conveniently numbered 1 thr... | [{"input": "10\noxooxoxoox\n", "output": "SSWWSSSWWS\n"}, {"input": "10\nxooxoxooxo", "output": "SWWSSSWWSS\n"}, {"input": "10\nxxooxoxooo", "output": "SWSWWWSSSS\n"}, {"input": "10\noxooooxxox", "output": "SSWWSWWWWS\n"}, {"input": "10\nxoxxooooxo", "output": "SWWWWSWWSS\n"}, {"input": "10\noooxoxooxx", "output": "SSS... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# Longest Palindromic Substring (Linear)\n\nA palindrome is a word, phrase, or sequence that reads the same b... | [{"input": "\"ttaaftffftfaafatf\"", "output": "[\"aaftffftfaa\"]", "fn_name": "longest_palindrome"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[\"a\"]", "fn_name": "longest_palindrome"}, {"input": "\"abababa\"", "output": "[\"abababa\"]", "fn_name": "longest_palindrome"}, {"input": "\"ababbab\"", "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\nTo make a paper airplane, one has to use a rectangular piece of paper. From a sheet of standard size you can ... | [{"input": "10000 10000 1 1\n", "output": "100000000\n"}, {"input": "10000 10000 1 1\n", "output": "100000000\n"}, {"input": "10000 10000 3 2\n", "output": "16670000\n"}, {"input": "10000 10000 3 2\n", "output": "16670000\n"}, {"input": "10000 10000 2 4\n", "output": "12500000\n"}, {"input": "10000 10000 1 4\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\nFox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (posit... | [{"input": "35\n512 268435456 8 128 134217728 8192 33554432 33554432 536870912 512 65536 1048576 32768 512 524288 1024 536870912 536870912 16 32 33554432 134217728 2 16 16777216 8192 262144 65536 33554432 128 4096 2097152 33554432 2097152 2\n36157 67877 79710 63062 12683 36255 61053 83828 93590 74236 5281 28143 7350 45... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nProblem B\n\n-->\n\nOn-Screen Keyboard\n\nYou are to input a string with an OSK (on-screen keyboard).... | [{"input": "3 9\nABCDEFGHI\nJKLMNOPQR\nSTUVWXYZ_\nICPC\n5 11\n___________\n____A______\n________M__\n___________\n_C_________\nACM\n4 21\n1_2_3_4_5_6_7_8_9_0_-\nQqWwEeRrTtYyUuIiOoPp@\nAaSsDdFfGgHhJjKkLl;^:\nZzXxCcVvBbNnMm,_._/__\nICPC2019,AsiaYokohamaRegional,QualificationRound\n0 0", "output": "28\n23\n493\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\n# Task\nGiven a number `n`, return a string representing it as a sum of distinct powers of three, or return `... | [{"input": "87754", "output": "[\"3^10+3^9+3^8+3^7+3^5+3^3+3^1+3^0\"]", "fn_name": "sum_of_threes"}, {"input": "5559060566575209", "output": "[\"3^33+3^9+3^1\"]", "fn_name": "sum_of_threes"}, {"input": "8312964441463288", "output": "[\"Impossible\"]", "fn_name": "sum_of_threes"}, {"input": "1418194818", "output": "[\"I... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a house with $n$ flats situated on the main street of Berlatov. Vova is watching this house every ni... | [{"input": "100\n0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 -1 1 0\n", "output": "24\n"}, {"input": "100\n0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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\n10^{10^{10}} participants, including Takahashi, competed in two programming contests. In each contest, all pa... | [{"input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 11\n8 36\n314159265 358979323", "output": "1\n12\n4\n11\n14\n29\n31\n671644785\n"}, {"input": "8\n1 4\n10 5\n3 3\n4 20\n8 9\n22 40\n8 36\n314159265 358979323", "output": "1\n12\n4\n15\n14\n57\n31\n671644785\n"}, {"input": "8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 11\n8 18\n314159265... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know E... | [{"input": "2\n110111100000101101101011001110100111011001000000000000000000\n", "output": "1000000000000000000"}, {"input": "2\n110111100000101101101011001110100111011001000000000000000000\n", "output": "1000000000000000000"}, {"input": "2\n1110110101111000010001011110101001011001110000000010110010\n", "output": "26736... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each h... | [{"input": "1000 8\n", "output": "339760446\n"}, {"input": "1000 6\n", "output": "834332109\n"}, {"input": "1000 1\n", "output": "760074701\n"}, {"input": "1000 5\n", "output": "583047503\n"}, {"input": "1000 2\n", "output": "675678679\n"}, {"input": "1000 4\n", "output": "660270610\n"}, {"input": "1000 3\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\nSome dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses, have be... | [{"input": "aaaabcccca\naaaadccccb\n", "output": "NO\n"}, {"input": "aaaabcccca\naaaadccdcb\n", "output": "NO\n"}, {"input": "accccbaaaa\naaaadccdcb\n", "output": "NO\n"}, {"input": "rtfabanpc\natfabrnpc\n", "output": "YES\n"}, {"input": "rtfabanpc\natfrbanpc\n", "output": "YES\n"}, {"input": "qxolmbkkt\naovlajmlf\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\nTakahashi is hosting an sports meet. There are N people who will participate. These people are conveniently n... | [{"input": "2 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 10 10\n2 5 4 3 1", "output": "1\n"}, {"input": "2 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 6 10\n2 5 4 3 1", "output": "1\n"}, {"input": "2 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 6 10\n2 5 4 2 1", "output": "1\n"}, {"input": "2 5\n5 1 3 4 2\n2 5 3 1 4\n2 3 1 6 10\n2 5 3 3 1", "output": "1\n"}... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Russia, there is an army-purposed station named UVB-76 or \"Buzzer\" (see also https://en.wikipedia.org/wi... | [{"input": "\"MDZHBMDZHB 855 56 KLASA 81 00 02 91\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MD2HB 60 1S0 AKKRETSIA 58 89 54 54\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MDZHB 12 733 EDIN ENIE 67 79 66 32\"", "output": "[false]", "fn_name": "validate"}, {"input": "\"MDZHB 12 733 6... | 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 need to build a function to return either `true/True` or `false/False` if a string can be se... | [{"input": "\"123A123a123a\"", "output": "[false]", "fn_name": "has_subpattern"}, {"input": "\"123a123a123a\"", "output": "[true]", "fn_name": "has_subpattern"}, {"input": "\"abbaabbaabba\"", "output": "[true]", "fn_name": "has_subpattern"}, {"input": "\"abcdabcabcd\"", "output": "[false]", "fn_name": "has_subpattern"}... | 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 Bubble Cup hypothesis stood unsolved for $130$ years. Who ever proves the hypothesis will be regarded as ... | [{"input": "100\n891 894 462 899 163 868 418 903 31 333 670 32 705 561 505 920 414 81 723 603 513 25 896 879 703 415 799 271 440 8 596 207 296 116 458 646 781 842 963 174 157 747 207 996 361 371 721 447 566 438 566 449 522 176 79 740 757 156 436 296 23 704 542 572 455 886 962 194 219 301 437 315 122 513 299 468 760 133... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Susie listens to fairy tales before bed every day. Today's fairy tale was about wood cutters and the l... | [{"input": "67\n1 1\n3 8\n4 10\n7 8\n9 2\n10 1\n11 5\n12 8\n13 4\n16 6\n18 3\n19 3\n22 5\n24 6\n27 5\n28 3\n29 3\n30 5\n32 5\n33 10\n34 7\n35 8\n36 5\n41 3\n42 2\n43 5\n46 4\n48 4\n49 9\n52 4\n53 9\n55 1\n56 4\n59 7\n68 7\n69 4\n71 9\n72 10\n74 5\n76 4\n77 9\n80 7\n81 9\n82 5\n83 5\n84 9\n85 7\n86 9\n87 4\n88 7\n89 10\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKaavi, the mysterious fortune teller, deeply believes that one's fate is inevitable and unavoidable. Of cours... | [{"input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294\n"}, {"input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaab... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 n dices each one having s sides numbered from 1 to s.\nHow many outcomes add up to a specified numbe... | [{"input": "3\n100\n100", "output": "[4851]", "fn_name": "outcome"}, {"input": "6\n10\n27", "output": "[39662]", "fn_name": "outcome"}, {"input": "5\n10\n27", "output": "[6000]", "fn_name": "outcome"}, {"input": "4\n10\n27", "output": "[480]", "fn_name": "outcome"}, {"input": "10\n5\n13", "output": "[220]", "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\n# Right in the Center\n\n_This is inspired by one of Nick Parlante's exercises on the [CodingBat](https://cod... | [{"input": "\"abcabcabcabc\"", "output": "[false]", "fn_name": "is_in_middle"}, {"input": "\"AAabcabcBB\"", "output": "[false]", "fn_name": "is_in_middle"}, {"input": "\"AAAAabcBB\"", "output": "[false]", "fn_name": "is_in_middle"}, {"input": "\"abcabcabc\"", "output": "[true]", "fn_name": "is_in_middle"}, {"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\nYour task is to create a function called ```sum_arrays()``` in Python or ```addArrays``` in Javascript, which... | [{"input": "[-4, 5, 7, 3, 6]\n[5, 3, 4, 5]", "output": "[[-4, 0, 3, 9, 1]]", "fn_name": "sum_arrays"}, {"input": "[3, 2, 6, 6]\n[-7, 2, 2, 8]", "output": "[[-3, 9, 6, 2]]", "fn_name": "sum_arrays"}, {"input": "[4, 7, 3]\n[1, 2, 3]", "output": "[[5, 9, 6]]", "fn_name": "sum_arrays"}, {"input": "[3, 2, 9]\n[1, 2]", "outp... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called \"Take... | [{"input": "115 1000 1000 1000 1000 1000 17 15\n", "output": "0\n"}, {"input": "1 1000 1000 1000 1000 1000 1 1\n", "output": "1000\n"}, {"input": "1 1000 1001 1000 1000 1000 1 1\n", "output": "1000\n"}, {"input": "82 1000 1000 1000 1000 1000 17 15\n", "output": "0\n"}, {"input": "82 1010 1000 1000 1000 1000 17 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\nTwo chess pieces, a rook and a knight, stand on a standard chessboard 8 Γ 8 in size. The positions in which t... | [{"input": "c1\nd2\n", "output": "42\n"}, {"input": "g1\ne6\n", "output": "39\n"}, {"input": "h8\ng2\n", "output": "43\n"}, {"input": "a8\nf1\n", "output": "42\n"}, {"input": "e4\nc1\n", "output": "37\n"}, {"input": "b6\ng7\n", "output": "39\n"}, {"input": "a4\nd1\n", "output": "42\n"}, {"input": "h6\na1\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\nExample\n\nInput\n\n1\n\n\nOutput\n\n)(### Format: Read the inputs from stdin solve the problem and write the... | [{"input": "321", "output": ")))))))))))))))))))))())))((((((((((((((((((((((((\n"}, {"input": "222", "output": "))))))))))))()))))))))((((((((((((((((((((\n"}, {"input": "193", "output": ")))()))))))))))))))))(((((((((((((((((((\n"}, {"input": "180", "output": ")))))))))())))))))))((((((((((((((((((\n"}, {"input": "17... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnd where the are the phone numbers?\n\nYou are given a string s consisting of lowercase English letters and ... | [{"input": "3 99948\nttt\n", "output": "tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 given an array $a$ of length $n$ and an integer $x$ to a brand new robot. What the robot does is the... | [{"input": "1\n20 9\n288 279 252 279 288 207 261 270 297 288 276 265 209 217 214 300 227 221 215 271\n", "output": "7833\n"}, {"input": "1\n20 9\n288 279 252 279 288 207 261 270 297 288 276 265 209 217 214 300 227 221 215 271\n", "output": "7833\n"}, {"input": "1\n20 9\n288 279 252 279 288 207 261 270 297 288 276 265 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\nWrite a program which performs the following operations to a binary search tree $T$ by adding delete operatio... | [{"input": "18\ninsert 13\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 13\nfind 5\nfind 6\nfind 4\nfind 7\nprint\ndelete 3\ndelete 7\nprint", "output": "yes\nyes\nyes\nyes\nno\nno\nno\nyes\n 1 2 3 7 13 22\n 13 2 1 3 7 22\n 1 2 13 22\n 13 2 1 22\n"}, {"input": "18\ninsert 16\ninsert 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\nAt the school where Vasya is studying, preparations are underway for the graduation ceremony. One of the plan... | [{"input": "3\n12 6 4\n2 1 2 4\n1 1 2 3\n2 1 1\n1\n1\n3 15 4\n1 1 2 2\n1 2 1 2\n", "output": "4\n0\n2\n"}, {"input": "3\n12 6 4\n2 1 2 4\n1 1 3 3\n2 1 1\n1\n1\n3 15 4\n1 1 2 2\n1 2 1 2\n", "output": "3\n0\n2\n"}, {"input": "3\n12 6 4\n2 1 2 7\n1 1 3 3\n2 1 1\n1\n1\n3 15 4\n1 1 2 2\n1 2 1 2\n", "output": "3\n0\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 are given an array $a$ consisting of $n$ integers.\n\nIn one move, you can choose two indices $1 \\le i, ... | [{"input": "5\n2\n0 3\n4\n2 0 13 1\n3\n3 3 3\n4\n5 10 5 4\n4\n2 1 1 2\n", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"input": "5\n2\n0 3\n4\n2 0 25 1\n3\n3 3 3\n4\n5 10 5 4\n4\n2 1 1 2\n", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"input": "5\n2\n0 3\n4\n2 0 25 1\n3\n3 3 3\n4\n5 10 1 4\n4\n2 1 1 2\n", "output": "YES\nYES\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNiwango-kun, an employee of Dwango Co., Ltd., likes Niconico TV-chan, so he collected a lot of soft toys of h... | [{"input": "17 2\n0 5\n2 3\n1 0\n1 2\n3 1\n3 1\n3 5\n5 1\n5 4\n7 4\n8 4\n6 1\n1 2\n6 1\n8 1\n11 0\n11 0\n11 -1\n7 0", "output": "5\n"}, {"input": "17 3\n0 5\n2 3\n1 0\n1 2\n3 1\n3 1\n3 5\n5 1\n5 4\n7 4\n8 4\n6 1\n1 2\n6 1\n8 1\n11 1\n11 0\n11 -1\n7 1", "output": "6\n"}, {"input": "17 2\n1 5\n2 3\n1 0\n1 2\n3 1\n3 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\nProblem D: Mr. Rito Post Office\n\nYou are a programmer working at a post office on a remote island. The area... | [{"input": "3 3\n1 2 10 L\n1 2 7 S\n2 3 11 S\n3\n1 2 1\n5 5\n1 2 15 L\n2 3 10 L\n4 5 7 L\n1 4 30 S\n3 5 100 S\n5\n1 3 5 4 1\n0 0", "output": "14\n124\n"}, {"input": "3 3\n1 2 5 L\n1 2 7 S\n2 3 11 S\n3\n1 2 3\n5 5\n1 2 15 L\n2 3 10 L\n4 5 12 L\n1 3 30 S\n3 5 100 S\n5\n1 3 5 4 1\n0 0", "output": "18\n279\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 king of a country loves prime numbers and gambling. The unit of currency in this country is called prime.... | [{"input": "4\n3 -1\n14 4\n3 24\n8 4\n1\n955049 29\n0", "output": "10\n4\n"}, {"input": "4\n0 -1\n13 1\n3 10\n8 3\n1\n964394 20\n0", "output": "6\n-1\n"}, {"input": "4\n0 -1\n18 2\n3 24\n8 4\n1\n190049 29\n0", "output": "10\n3\n"}, {"input": "4\n2 -1\n14 0\n3 24\n8 7\n1\n144232 29\n0", "output": "10\n5\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 Chef's latest idea is that some cooks might work better in pairs. So, he is going to experiment by pairin... | [{"input": "2\n4 5\n-1 0\n2 3\n0 1\n2 1\n1 0\n4 2\n0 1\n2 3\n2 0", "output": "1 4\n0 1\n"}, {"input": "2\n11 5\n0 2\n1 1\n1 3\n1 6\n3 0\n4 3\n0 -1\n0 -1\n2 0", "output": "3 4\n2\n"}, {"input": "2\n11 5\n0 4\n1 1\n1 3\n1 6\n3 0\n4 3\n0 -1\n0 -1\n2 0", "output": "3 4\n2\n"}, {"input": "2\n6 5\n0 1\n1 2\n2 3\n1 3\n3 0\n8 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's introduce the designation <image>, where x is a string, n is a positive integer and operation \" + \" i... | [{"input": "10000000 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "10000000\n"}, {"input": "10000000 10000000\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya has equal wooden bars of length n. He wants to make a frame for two equal doors. Each frame has two ver... | [{"input": "1000\n1000\n1000\n", "output": "6\n"}, {"input": "1000\n1000\n1000\n", "output": "6"}, {"input": "800\n401\n400\n", "output": "5\n"}, {"input": "828\n468\n726\n", "output": "6\n"}, {"input": "956\n153\n941\n", "output": "3\n"}, {"input": "676\n175\n514\n", "output": "4\n"}, {"input": "713\n150\n591\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\nDevuLand is a very strange place. There are n villages in it. Some of the villages are occupied by dinosaurs ... | [{"input": "3\n2\n5 -5\n2\n-5 5\n3\n-1 3 -2", "output": "5\n5\n3\n"}, {"input": "3\n1\n5 -5\n2\n-5 5\n3\n1 2 -3", "output": "5\n5\n4\n"}, {"input": "3\n2\n5 -5\n2\n-5 5\n3\n0 3 -3", "output": "5\n5\n3\n"}, {"input": "3\n1\n5 -5\n1\n-5 5\n2\n1 3 -4", "output": "5\n5\n5\n"}, {"input": "3\n1\n5 -5\n2\n-8 8\n2\n1 2 -3", "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\nLet a and b be some non-negative integers. Let's define strange addition of a and b as following:\n\n 1. wri... | [{"input": "2 3\n14\n2 4\n2 1\n1 1\n", "output": "15\n12\n12\n"}, {"input": "2 3\n14\n2 4\n2 1\n2 0\n", "output": "15\n12\n11\n"}, {"input": "2 3\n11\n2 8\n2 2\n2 0\n", "output": "19\n13\n11\n"}, {"input": "2 3\n11\n2 8\n2 2\n2 1\n", "output": "19\n13\n12\n"}, {"input": "2 3\n11\n2 8\n2 2\n2 2\n", "output": "19\n13\n13... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 three integers A_1, A_2, and A_3.\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; other... | [{"input": "13 13 13\n", "output": "bust\n"}, {"input": "1 10 11\n", "output": "bust\n"}, {"input": "6 13 10\n", "output": "bust\n"}, {"input": "115 -5 1", "output": "bust\n"}, {"input": "-2 -10 -1", "output": "win\n"}, {"input": "-4 -10 -1", "output": "win\n"}, {"input": "-4 -13 -1", "output": "win\n"}, {"input": "-4 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to... | [{"input": "3\n6.834942604239939 7.69628\n6.04723928846506 4.859878448884584\n7.439438773048666 6.914350092484497\n6\n7.260024632937995 4.220572316804344\n7.2301779956102665 2.69466\n5.977411451010016 4.7893139817742\n5.771323891387089 5.033018424848772\n7.097650770216692 5.940611762552271\n8.514204260774932 5.46523993... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 process of mammoth's genome decoding in Berland comes to its end!\n\nOne of the few remaining tasks is to... | [{"input": "252\n???????GCG??T??TT?????T?C???C?CCG???GA???????AC??A???AAC?C?CC??CCC??A??TA?CCC??T???C??CA???CA??G????C?C?C????C??C??A???C?T????C??ACGC??CC?A?????A??CC?C??C?CCG?C??C??A??CG?A?????A?CT???CC????CCC?CATC?G??????????A???????????????TCCCC?C?CA??AC??GC????????\n", "output": "AAAAAAAGCGAATAATTAAAAATACAAACACCGAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCompare two strings by comparing the sum of their values (ASCII character code).\n\n* For comparing treat all... | [{"input": "\"ZzZz\"\n\"ffPFF\"", "output": "[true]", "fn_name": "compare"}, {"input": "\"!!\"\n\"7476\"", "output": "[true]", "fn_name": "compare"}, {"input": "\"##\"\n\"1176\"", "output": "[true]", "fn_name": "compare"}, {"input": "\"AD\"\n\"DD\"", "output": "[false]", "fn_name": "compare"}, {"input": "\"Ad\"\n\"DD\"... | 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 consider a positive integer perfect, if and only if the sum of its digits is exactly $10$. Given a positiv... | [{"input": "10000\n", "output": "10800100\n"}, {"input": "9999\n", "output": "10800010\n"}, {"input": "9139\n", "output": "10134010\n"}, {"input": "9859\n", "output": "10422001\n"}, {"input": "8888\n", "output": "10110061\n"}, {"input": "9411\n", "output": "10214200\n"}, {"input": "8515\n", "output": "10030114\n"}, {"i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConvenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its busine... | [{"input": "10 12\n6\n2 1\n6 1\n6 2\n1 5\n0 6\n5 6\n2\n1 3\n5 3\n11 6\n6\n3 3\n3 4\n6 1\n1 1\n1 6\n5 6\n2\n0 3\n6 4\n0 0", "output": "6\n18\n"}, {"input": "10 12\n6\n1 1\n6 1\n6 2\n1 5\n0 6\n5 6\n2\n1 3\n5 3\n11 6\n6\n3 3\n3 4\n6 2\n1 1\n1 5\n1 6\n2\n0 3\n6 4\n0 0", "output": "8\n20\n"}, {"input": "6 6\n6\n1 1\n4 2\n3 ... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.