messages listlengths 1 1 | ground_truth stringlengths 88 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\nSolve the following coding problem using the programming language python:\n\nYurii is sure he can do everythi... | [{"type": "stdin_stdout", "input": "10\n997230370 58052053 240970544 715275815 250707702 156801523 44100666 64791577 43523002 480196854\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n997230370 58052053 240970544 715275815 250707702 42457490 44100666 64791577 43523002 480196854\n", "output": "1\n"}, {"type... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have 2n integers 1, 2, ..., ... | [{"type": "stdin_stdout", "input": "3\n1\n1\n5\n1 4 5 9 10\n2\n3 4\n", "output": "\n1\n3\n1\n"}, {"type": "stdin_stdout", "input": "3\n1\n1\n5\n1 4 5 9 10\n2\n1 4\n", "output": "1\n3\n1\n"}, {"type": "stdin_stdout", "input": "3\n1\n1\n5\n1 4 5 9 10\n2\n2 4\n", "output": "1\n3\n2\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nThe dragon and the princess are ... | [{"type": "stdin_stdout", "input": "267 111\n", "output": "0.7727518243505415\n"}, {"type": "stdin_stdout", "input": "768 487\n", "output": "0.7203654732552364\n"}, {"type": "stdin_stdout", "input": "377 205\n", "output": "0.7393583121158366\n"}, {"type": "stdin_stdout", "input": "815 180\n", "output": "0.8467179193191... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a square field of size ... | [{"type": "stdin_stdout", "input": "6\n4\n..*.\n....\n*...\n....\n2\n*.\n.*\n2\n.*\n.*\n3\n*.*\n...\n...\n5\n.....\n..*..\n.....\n.*...\n.....\n4\n....\n....\n*...\n*...\n", "output": "\n*.*.\n....\n*.*.\n....\n**\n**\n**\n**\n*.*\n*.*\n...\n.....\n.**..\n.....\n.**..\n.....\n....\n....\n**..\n**..\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA median in an array with the le... | [{"type": "stdin_stdout", "input": "100 813\n285 143 378 188 972 950 222 557 170 755 470 164 1433 553 146 820 842 62 496 1893 746 944 677 828 465 577 791 277 303 218 561 653 925 692 871 424 626 795 813 343 418 280 123 364 496 447 435 452 645 36 311 315 830 289 450 675 23 212 421 661 7 217 468 877 172 141 475 409 178 71... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere have recently been electio... | [{"type": "stdin_stdout", "input": "987549745\n", "output": "206294274\n"}, {"type": "stdin_stdout", "input": "674810014\n", "output": "550536983\n"}, {"type": "stdin_stdout", "input": "545794012\n", "output": "829479797\n"}, {"type": "stdin_stdout", "input": "301542785\n", "output": "763583849\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSince most contestants do not re... | [{"type": "stdin_stdout", "input": "3\n101 186 223\n", "output": "BitAryo\n"}, {"type": "stdin_stdout", "input": "3\n184 222 102\n", "output": "BitAryo\n"}, {"type": "stdin_stdout", "input": "3\n299 290 288\n", "output": "BitLGM\n"}, {"type": "stdin_stdout", "input": "3\n299 299 298\n", "output": "BitLGM\n"}, {"type": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan has got an array of n non-n... | [{"type": "stdin_stdout", "input": "26\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\n2000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "1\n1646661570\n", "output": "1646661570\n"}, {"type": "stdin_stdout", "input": "1\n11016434... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPasha has many hamsters and he m... | [{"type": "stdin_stdout", "input": "200\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "100\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBizon the Champion isn't just ch... | [{"type": "stdin_stdout", "input": "499997 499989 248758432143\n", "output": "225563648440"}, {"type": "stdin_stdout", "input": "500000 500000 250000000000\n", "output": "250000000000"}, {"type": "stdin_stdout", "input": "172200 409931 42943608085\n", "output": "18254872778\n"}, {"type": "stdin_stdout", "input": "18365... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has started watching footb... | [{"type": "stdin_stdout", "input": "KASFLS\nASJBGGDLJFDDFHHTHJH\n42\n2 a 68 y\n4 h 64 r\n5 a 24 y\n6 h 20 r\n2 a 16 r\n9 a 96 y\n10 h 36 r\n12 a 44 y\n13 h 69 r\n16 a 62 r\n18 a 99 r\n20 h 12 r\n21 a 68 y\n25 h 40 y\n26 h 54 r\n28 h 91 r\n29 a 36 r\n33 a 91 y\n36 h 93 r\n37 h 60 r\n38 a 82 r\n41 a 85 y\n42 a 62 r\n46 a... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDrazil has many friends. Some of... | [{"type": "stdin_stdout", "input": "5880582 100615605\n33 994430 2580881 208833 773217 5288222 4144306 1283201 4501728 3876492 4261396 1313993 1567121 1408932 5225554 2622889 3029881 1790677 5350621 1743001 3413796 5100735 3105904 1969283 453573 429283 4544410 2070808 3695158 1066291 2639099 4258365 908486 3326551\n24 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Misha and Andrew were pl... | [{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1000000000 100000000\n", "output": "100000001\n"}, {"type": "stdin_stdout", "input": "1000000000 500000000\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "1199670843 346250868\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\nSolve the following coding problem using the programming language python:\n\nIvan wants to make a necklace as... | [{"type": "stdin_stdout", "input": "20\n19259 5236 2272 7238 560 938 6209 91 1540 2821 35 6097 12593 1092 6181 7553 4095 280 12810 2723\n", "output": "0\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter observing the results of S... | [{"type": "stdin_stdout", "input": "71\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n8\na\nba\naaa\naaaa\naaaaa\naaaaaa\naaaabaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n", "output": "a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter their adventure with the m... | [{"type": "stdin_stdout", "input": "6 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "output": "7000000000 0\n"}, {"type": "stdin_stdout", "input": "6 1000000000\n+ 1000000000\n+ 0000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "output": "6000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem. ... | [{"type": "stdin_stdout", "input": "24\n4\n1 2 3 4\n4\n1 2 4 3\n4\n1 3 2 4\n4\n1 3 4 2\n4\n1 4 2 3\n4\n1 4 3 2\n4\n2 1 3 4\n4\n2 1 4 3\n4\n2 3 1 4\n4\n2 3 4 1\n4\n2 4 1 3\n4\n2 4 3 1\n4\n3 1 2 4\n4\n3 1 4 2\n4\n3 2 1 4\n4\n3 2 4 1\n4\n3 4 1 2\n4\n3 4 2 1\n4\n4 1 2 3\n4\n4 1 3 2\n4\n4 2 1 3\n4\n4 2 3 1\n4\n4 3 1 2\n4\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\nSolve the following coding problem using the programming language python:\n\nPolycarp thinks about the meanin... | [{"type": "stdin_stdout", "input": "babbbbabbabbbababbabbbbbbabaabaababaaabbbbbabbbbaaaaabbaaabbaabaabbbbabbbababbabaaabbababaaababbbaaa\n", "output": "babababababababababababa\n"}, {"type": "stdin_stdout", "input": "aaabbbabaaabababbaaababbababbbabbbbaabaabbaaabbaaaaabbbbabbbbbaaababaabaababbbbbbabbababbbabbabbbbab\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\nSolve the following coding problem using the programming language python:\n\nPolycarp has just attempted to p... | [{"type": "stdin_stdout", "input": "11\n1 100\n3 70\n4\n2\n3 120\n5\n3 120\n6\n1 150\n4\n3 300\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "11\n1 100\n3 57\n4\n2\n3 120\n5\n3 120\n6\n1 150\n4\n3 300\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "11\n1 110\n3 70\n4\n2\n3 120\n5\n3 120\n6\n1 150\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\nSolve the following coding problem using the programming language python:\n\nJafar has n cans of cola. Each c... | [{"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 4 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 5 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 5 25 39\n27 72 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array a1, a2, ..., an o... | [{"type": "stdin_stdout", "input": "71\n908209 289 44521 240100 680625 274576 212521 91809 506944 499849 3844 15376 592900 58081 240100 984064 732736 257049 600625 180625 130321 580644 261121 75625 46225 853776 485809 700569 817216 268324 293764 528529 25921 399424 175561 99856 295936 20736 611524 13924 470596 574564 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\nSolve the following coding problem using the programming language python:\n\nWelcome to another task about br... | [{"type": "stdin_stdout", "input": "100\nmntyyerijtaaditeyqvxstrwxoxglpaubigaggtrepaegniybvfmssawvhrgjjhwwkwuqhtyrimxvolcstyllbhlcursvgfafpts\nbsgmhsgavsbgtwiiqaigmtyjxihphxdlseeajfywugawigrjruttuykthfrvwagpcsxlxsopnarqcvetnbtvfrvlyymwoyelrlta\n", "output": "300\n67 1 100 88 1 100 93 1 100 70 1 100 46 1 100 96 1 100 88... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has created his own tra... | [{"type": "stdin_stdout", "input": "69\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\n", "output": "35\n"}, {"type": "stdin_stdout", "input": "69\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 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the modification of the ... | [{"type": "stdin_stdout", "input": "9949\n", "output": "307719457689743128298492861497180324397986774674234939670103343582839949843260265155046613013945400801415123028273388247235932017894817398309825952296257005831495862389554310376537787393094576718901293512769236851428349025597989172462502154215215274376199660914517... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nM-kun is a brilliant air traffic... | [{"type": "stdin_stdout", "input": "8\n285 224 U\n130 175 R\n111 322 D\n121 188 L\n201 116 U\n112 121 R\n145 239 D\n185 107 L", "output": "SAFE\n"}, {"type": "stdin_stdout", "input": "8\n285 224 U\n130 175 R\n101 322 D\n121 188 L\n201 116 U\n112 121 R\n145 239 D\n185 107 L", "output": "SAFE\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is distributing N ball... | [{"type": "stdin_stdout", "input": "-2 135", "output": "-137\n"}, {"type": "stdin_stdout", "input": "-2 240", "output": "-242\n"}, {"type": "stdin_stdout", "input": "-4 240", "output": "-244\n"}, {"type": "stdin_stdout", "input": "3 130", "output": "-127\n"}, {"type": "stdin_stdout", "input": "2 130", "output": "-128\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\nSolve the following coding problem using the programming language python:\n\nYou are given a string S. Each c... | [{"type": "stdin_stdout", "input": "AtCoddr", "output": "AC\n"}, {"type": "stdin_stdout", "input": "redoctA", "output": "WA\n"}, {"type": "stdin_stdout", "input": "BcycliC", "output": "WA\n"}, {"type": "stdin_stdout", "input": "etCodAr", "output": "WA\n"}, {"type": "stdin_stdout", "input": "redpctA", "output": "WA\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\nSolve the following coding problem using the programming language python:\n\nIt is September 9 in Japan now.\... | [{"type": "stdin_stdout", "input": "929", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "109", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "189", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1223", "output": "No\n"}, {"type": "stdin_stdout", "input": "69", "output": "Yes\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHow many infinite sequences a_1,... | [{"type": "stdin_stdout", "input": "138065", "output": "144629245\n"}, {"type": "stdin_stdout", "input": "132361", "output": "413027178\n"}, {"type": "stdin_stdout", "input": "219101", "output": "267179376\n"}, {"type": "stdin_stdout", "input": "412635", "output": "541957737\n"}, {"type": "stdin_stdout", "input": "1475... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour task is to write a program ... | [{"type": "stdin_stdout", "input": "6 2\n12 8\n0 0", "output": "Wednesday\nWednesday\n"}, {"type": "stdin_stdout", "input": "4 1\n2 18\n0 0", "output": "Thursday\nWednesday\n"}, {"type": "stdin_stdout", "input": "6 2\n7 17\n0 0", "output": "Wednesday\nSaturday\n"}, {"type": "stdin_stdout", "input": "1 1\n5 19\n0 0", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a positive integer n\n\n* If... | [{"type": "stdin_stdout", "input": "3\n1043\n0", "output": "7\n124\n"}, {"type": "stdin_stdout", "input": "3\n3340\n0", "output": "7\n136\n"}, {"type": "stdin_stdout", "input": "3\n109\n0", "output": "7\n113\n"}, {"type": "stdin_stdout", "input": "3\n440\n0", "output": "7\n115\n"}, {"type": "stdin_stdout", "input": "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\nSolve the following coding problem using the programming language python:\n\nThe cloth coasters produced and ... | [{"type": "stdin_stdout", "input": "7 8\n00100010\n00011000\n10111101\n01100110\n01000110\n10111101\n00011000\n00100100\n2\n5 3\n0 6\n1\n6 16\n3\n6 10\n3 3\n3 6\n2\n6 3\n6 6\n0\n3\n1 8\n6 8", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 8\n00100000\n00011000\n10111101\n01100110\n01000110\n10111101\n00011000\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\nSolve the following coding problem using the programming language python:\n\nThere are N towns in JOI, which ... | [{"type": "stdin_stdout", "input": "10 3 1\n1 2 5\n3 3 2\n3 1 1\n2", "output": "7\n"}, {"type": "stdin_stdout", "input": "11 3 1\n1 1 1\n2 3 0\n3 1 1\n1", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 3 1\n1 2 2\n2 3 2\n3 1 1\n1", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 3 1\n1 2 2\n2 3 2\n2 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYOKARI TAMURA is a nationally fa... | [{"type": "stdin_stdout", "input": "5 5 8 2\n1 1 0 1 0\n0 5 1 0 1\n1 1 1 9 1\n1 1 9 0 1\n1 1 2 1 0\n2 1 0 1 1\n0 9 2 0 1\n1 1 1 9 1\n1 1 1 0 1\n1 1 1 1 0\n1 1 13 0\n3\n7\n1 1 5 0\n3\n9\n1 2 10 1\n10 7\n5 10\n2 1 11 1\n6\n8\n4\n7\n2 1 20 0\n4\n13\n3\n11\n2 1 5 0\n4\n8\n3\n6\n0 0 0 0", "output": "17\n3\n0\n10\n14\n13\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\nSolve the following coding problem using the programming language python:\n\nLet's play a new board game ``Li... | [{"type": "stdin_stdout", "input": "4 4\n 2\n 2 3\n 1 0 4\n1 1 4 0\n4 5\n 2\n 2 3\n 3 0 4\n1 1 4 0\n4 1\n 2\n 2 3\n 3 0 4\n1 1 7 0\n4 1\n 1\n 1 1\n 1 1 1\n1 1 1 0\n4 2\n 1\n 1 0\n 1 1 1\n1 1 1 0\n4 1\n 0\n 2 2\n 5 0 7\n0 5 7 0\n4 2\n 0\n 0 3\n 1 0 4\n0 1 0 4\n4 3\n 0\n 3 3\n 3 2 3\n0 3 0 3\n4 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nFind the area of ββa ... | [{"type": "stdin_stdout", "input": "110111 100", "output": "3.1415923987\n"}, {"type": "stdin_stdout", "input": "010111 100", "output": "3.1415624160\n"}, {"type": "stdin_stdout", "input": "010111 110", "output": "3.1415593799\n"}, {"type": "stdin_stdout", "input": "010011 110", "output": "3.1415587116\n"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\ny 7\ny 6\... | [{"type": "stdin_stdout", "input": "3\ny 11\ny 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\ny 11\nx 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\nx 2\ny 10\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\ny 11\nw 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nNeat lives on the wor... | [{"type": "stdin_stdout", "input": "8\n2 9 297 297\n8 6 359 211\n8 16 28 233\n7 9 113 143\n3 18 315 190\n10 18 277 300\n9 5 276 88\n3 5 322 40", "output": "297\n"}, {"type": "stdin_stdout", "input": "8\n2 9 297 297\n8 6 359 211\n8 16 28 288\n7 9 113 143\n3 18 315 190\n10 18 277 300\n9 5 276 88\n3 5 322 40", "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\nSolve the following coding problem using the programming language python:\n\nYou have $N$ items that you want... | [{"type": "stdin_stdout", "input": "1 96\n113 10\n111 20\n120 31", "output": "113.0000000000\n"}, {"type": "stdin_stdout", "input": "1 77\n119 10\n111 20\n120 31", "output": "119.0000000000\n"}, {"type": "stdin_stdout", "input": "1 77\n197 10\n111 20\n120 31", "output": "197.0000000000\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nWrite a program which calculates... | [{"type": "stdin_stdout", "input": "-210", "output": "138544.236023275 -1319.46891451\n"}, {"type": "stdin_stdout", "input": "-215", "output": "145220.120412152 -1350.88484104\n"}, {"type": "stdin_stdout", "input": "-113", "output": "40114.996593678 -709.999939711\n"}, {"type": "stdin_stdout", "input": "-114", "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\nSolve the following coding problem using the programming language python:\n\nYou are given two positive integ... | [{"type": "stdin_stdout", "input": "500 5000\n", "output": "99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is an active user of the soc... | [{"type": "stdin_stdout", "input": "35\n21 26 18 7 28 2 16 13 16 25 6 32 11 5 31 17 18 3 24 33 14 27 29 1 20 4 12 9 10 30 34 8 19 23 22\n", "output": "0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 \n"}, {"type": "stdin_stdout", "input": "35\n21 26 18 4 28 3 15 13 16 25 6 25 11 5 31 17 9 3 24 33 14 27 29 1 20 4 12 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\nSolve the following coding problem using the programming language python:\n\nCan the greatest common divisor ... | [{"type": "stdin_stdout", "input": "9\n30\n11\n12\n122\n136\n92\n1984716\n217\n14628115\n", "output": "31\n15\n15\n127\n255\n127\n2097151\n255\n16777215\n"}, {"type": "stdin_stdout", "input": "9\n30\n7\n12\n122\n136\n92\n1984716\n204\n14628115\n", "output": "31\n1\n15\n127\n255\n127\n2097151\n255\n16777215\n"}, {"type"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, on the course of algor... | [{"type": "stdin_stdout", "input": "71 57\n9 26 80 10 65 60 63 1 15 85 71 1 58 27 41 97 42 15 42 56 87 22 10 28 34 90 13 70 71 56 65 21 0 78 47 191 56 77 32 83 28 16 10 41 0 18 92 12 27 58 4 67 21 41 99 20 21 52 74 10 83 45 43 65 2 15 1 63 46 97 72\n150\n21\n81\n81\n5\n9\n41\n76\n81\n92\n95\n94\n78\n93\n47\n30\n92\n3\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\nSolve the following coding problem using the programming language python:\n\nOne common way of digitalizing s... | [{"type": "stdin_stdout", "input": "50 20\n592183311 362557946 154127088 616872926 395353745 675069471 509655682 79915471 356656666 937992998 304422065 724106263 472338455 792258113 796069631 1325917135 201799298 566151622 722278085 827802227 703159587 690854023 925377265 11010958 69791159 990158269 535460930 167415727... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n seats in the train's... | [{"type": "stdin_stdout", "input": "100 1000000000\n12 803 439 918 435 300 497 520 718 573 782 523 328 88 275 159 128 389 920 869 503 80 490 289 22 889 353 799 29 131 587 123 405 221 727 135 248 348 299 833 19 943 471 410 635 626 784 712 213 724 550 661 860 536 718 173 406 832 520 748 512 29 466 982 574 848 11 693 915 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA team of three programmers is g... | [{"type": "stdin_stdout", "input": "11 7 9\n4 8 9 12 14 16 19 21 22 23 27\n1 2 3 11 17 18 26\n5 6 7 10 13 15 20 24 25\n", "output": "15"}, {"type": "stdin_stdout", "input": "5 10 6\n14 3 6 12 21\n7 1 5 8 10 11 13 17 18 20\n9 2 4 15 16 19\n", "output": "11"}, {"type": "stdin_stdout", "input": "1 5 1\n6\n5 1 2 4 7\n3\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\nSolve the following coding problem using the programming language python:\n\nThere are n water tanks in a row... | [{"type": "stdin_stdout", "input": "65\n1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 16 19 20 21 22 23 44 25 26 35 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 104 59 60 61 62 63 64\n", "output": "15417.723076923077\n15417.723076923077\n15417.723076923077\n15417.7230769... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected unwe... | [{"type": "stdin_stdout", "input": "2\n4 3 2 3 4\n2 4 3\n1 2\n1 3\n1 4\n7 9 1 5 7\n2 10 4 8 5 6 7 3 3\n1 2\n1 3\n1 4\n3 2\n3 5\n4 2\n5 6\n1 4\n6 7\n", "output": "11\n12\n"}, {"type": "stdin_stdout", "input": "2\n4 3 2 3 4\n1 5 3\n1 2\n1 3\n1 4\n7 9 2 5 7\n3 10 4 8 5 8 7 3 3\n2 2\n2 3\n1 4\n3 2\n3 5\n4 3\n5 6\n1 4\n6 7\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAyush, Ashish and Vivek are busy... | [{"type": "stdin_stdout", "input": "24\n4\n1 2 3 4\n1 2 3 4\n4\n1 2 3 4\n1 2 4 3\n4\n1 2 3 4\n1 3 2 4\n4\n1 2 3 4\n1 3 4 2\n4\n1 2 3 4\n1 4 2 3\n4\n1 2 3 4\n1 4 3 2\n4\n1 2 3 4\n2 1 3 4\n4\n1 2 3 4\n2 1 4 3\n4\n1 2 3 4\n2 3 1 4\n4\n1 2 3 4\n2 3 4 1\n4\n1 2 3 4\n2 4 1 3\n4\n1 2 3 4\n2 4 3 1\n4\n1 2 3 4\n3 1 2 4\n4\n1 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree (connected ... | [{"type": "stdin_stdout", "input": "4\n8 10\n1 2\n1 5\n7 6\n6 8\n3 1\n8 4\n7 1\n10 1\n1 2\n1 10\n2 3\n1 5\n1 6\n2 4\n7 10\n10 9\n8 10\n7 2\n3 1\n1 5\n4 6\n7 4\n1 2\n1 4\n5 1\n1 4\n2 1\n4 3\n5 3\n", "output": "0\n9\n3\n4\n"}, {"type": "stdin_stdout", "input": "4\n8 10\n1 2\n1 5\n7 6\n6 8\n3 1\n8 4\n4 1\n10 3\n1 2\n1 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\nSolve the following coding problem using the programming language python:\n\nThere are n beautiful skyscraper... | [{"type": "stdin_stdout", "input": "8\n7 2 5 5 1 2 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n7 2 5 5 1 2 2 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n7 2 5 5 2 2 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n4 3 5 5 1 2 5 2\n", "output": "4\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the snake exhibition, there a... | [{"type": "stdin_stdout", "input": "36\n2\n--\n2\n>-\n2\n<-\n2\n->\n2\n>>\n2\n<>\n2\n-<\n2\n><\n2\n<<\n3\n---\n3\n>--\n3\n<--\n3\n->-\n3\n>>-\n3\n<>-\n3\n-<-\n3\n><-\n3\n<<-\n3\n-->\n3\n>->\n3\n<->\n3\n->>\n3\n>>>\n3\n<>>\n3\n-<>\n3\n><>\n3\n<<>\n3\n--<\n3\n>-<\n3\n<-<\n3\n-><\n3\n>><\n3\n<><\n3\n-<<\n3\n><<\n3\n<<<\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHr0d1y has q queries on a binary... | [{"type": "stdin_stdout", "input": "2\n6 3\n001000\n2 4\n1 3\n3 5\n4 2\n1111\n1 4\n2 3\n", "output": "\nYES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "2\n6 3\n001000\n2 4\n1 3\n3 5\n4 2\n1111\n1 4\n1 3\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "2\n6 3\n001000\n2 5\n1 3\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp remembered the 2020-th ... | [{"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n8081\n8079\n", "output": "\nNO\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n12391\n8079\n", "output": "NO\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n8081\n4273\n", "output": "NO\nYES\nYES\nYES\nNO\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\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation a co... | [{"type": "stdin_stdout", "input": "3\n4\n1 3 2 4\n3\n1 2 3\n5\n2 1 4 5 3\n", "output": "\n1\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 3 2 10\n3\n1 2 3\n5\n3 1 4 0 0\n", "output": "1\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 3 2 7\n3\n1 2 3\n5\n2 1 4 5 -1\n", "output": "1\n0\n2\n"}, {"type": "st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs Sherlock Holmes was investiga... | [{"type": "stdin_stdout", "input": "30 70 288262020\n27 18\n5 19\n23 17\n16 17\n29 17\n1 22\n23 5\n10 13\n22 26\n14 3\n8 3\n29 9\n9 1\n3 9\n16 4\n9 22\n10 22\n20 1\n3 7\n23 19\n26 8\n24 1\n5 7\n28 29\n20 11\n16 12\n6 9\n24 29\n30 4\n5 26\n18 21\n5 21\n30 6\n12 13\n16 23\n28 14\n30 1\n7 27\n7 19\n27 17\n5 30\n30 27\n28 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFibonacci strings are defined as... | [{"type": "stdin_stdout", "input": "50 100\na\na\nb\na\na\nb\nb\nb\na\na\nb\nb\na\na\na\na\nb\nb\na\nb\nb\nb\na\na\na\na\na\na\nb\nb\na\nb\na\nb\na\nb\na\nb\nb\nb\na\na\nb\na\na\na\nb\na\nb\na\na\na\nb\na\nb\na\na\nb\na\na\nb\na\na\na\na\nb\na\nb\na\nb\nb\na\nb\nb\nb\na\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb\na\na\na\nb\nb\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\nSolve the following coding problem using the programming language python:\n\nA bracket sequence is a string, ... | [{"type": "stdin_stdout", "input": "[()][([[]])][[[]()]][()[]]()()([[][]][[]][](()))[[[(())]]][]()(([([])(([[[]]()])(()))]((())))([()]([()[[[]([][[[[][(())([[]()])]]][[(())]([])]()][[](())]()[])]()[][]]([[]])[]])[(()[()((()[][()]))][])[]()()([]())](()[][][])()()[]()))[]()[]\n", "output": "61\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\nSolve the following coding problem using the programming language python:\n\nYou've got an undirected graph, ... | [{"type": "stdin_stdout", "input": "50 47\n21 17 47 15 50 47 47 41 28 18 27 47 29 28 32 26 16 26 8 22 27 10 45 21 17 30 31 38 14 8 9 40 29 35 41 24 22 14 40 46 44 34 40 31 48 40 8 50 1 28\n10 5\n34 2\n42 5\n36 28\n8 44\n36 3\n40 15\n33 18\n5 50\n1 6\n25 20\n39 24\n45 35\n14 27\n14 39\n17 47\n19 49\n28 10\n7 13\n34 3\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\nSolve the following coding problem using the programming language python:\n\nThere are three horses living in... | [{"type": "stdin_stdout", "input": "10 10\n4 8 4 10 2 10 8 10 4 6\n", "output": " 25\n"}, {"type": "stdin_stdout", "input": "10 10\n9 3 6 6 3 3 6 3 6 9\n", "output": " 25\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGreg has a weighed directed grap... | [{"type": "stdin_stdout", "input": "9\n0 85236 27579 82251 69479 24737 87917 15149 52311\n59640 0 74687 34711 3685 30121 4961 7552 83399\n33376 68733 0 81357 18042 74297 15466 29476 5865\n7493 5601 3321 0 20263 55901 58229 55361 87633\n26751 17161 76681 58775 0 39745 50717 56887 90055\n18885 76353 47089 43601 21561 0 6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou helped Dima to have a great ... | [{"type": "stdin_stdout", "input": "50 10\n1 2 3 4 5 4 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "50 10\n1 2 3 4 5 1 7 8 9 10 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 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\nSolve the following coding problem using the programming language python:\n\nThe Berland Armed Forces System ... | [{"type": "stdin_stdout", "input": "100\n63 65 21 41 95 23 3 4 12 23 95 50 75 63 58 34 71 27 75 31 23 94 96 74 69 34 43 25 25 55 44 19 43 86 68 17 52 65 36 29 72 96 84 25 84 23 71 54 6 7 71 7 21 100 99 58 93 35 62 47 36 70 68 9 75 13 35 70 76 36 62 22 52 51 2 87 66 41 54 35 78 62 30 35 65 44 74 93 78 37 96 70 26 32 71 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOf course our child likes walkin... | [{"type": "stdin_stdout", "input": "10 19\n13637 26970 19043 3616 12880 19387 12539 25190 2452 1261\n1 2\n1 3\n1 4\n2 5\n3 6\n6 7\n3 8\n5 9\n3 10\n4 10\n9 3\n2 8\n4 3\n2 3\n7 10\n7 8\n5 10\n5 6\n7 4\n", "output": "8241.4222222222\n"}, {"type": "stdin_stdout", "input": "10 19\n15704 19758 26631 25050 22778 15041 8487 26... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Kitayuta has kindly given yo... | [{"type": "stdin_stdout", "input": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczlxscoxhszsoxzxrzohsccsclocxxzshrhzoexxhrohqrrqhorhxxeozhrhszxxcolcsccshozrxzxoszshxocsxlzcxxhcsqkcxlhcrecokqeqoqxssxxellqlooczxloosrsqsoxrcesxcc\n536870712\n", "output": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczl... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy... | [{"type": "stdin_stdout", "input": "9\n011111111\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "9\n011101111\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "9\n011101101\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "9\n001101101\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMotorist Kojiro spent 10 years s... | [{"type": "stdin_stdout", "input": "386 20 29 30\n1 349\n2 482\n1 112\n1 93\n2 189\n1 207\n2 35\n2 -5\n1 422\n1 442\n1 402\n2 238\n3 258\n3 54\n2 369\n2 290\n2 329\n3 74\n3 -62\n2 170\n1 462\n2 15\n2 222\n1 309\n3 150\n1 -25\n3 130\n1 271\n1 -43\n351 250 91 102 0 286 123 93 100 205 328 269 188 83 73 35 188 223 73 215 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\nSolve the following coding problem using the programming language python:\n\nCatherine has a deck of n cards,... | [{"type": "stdin_stdout", "input": "200\nBBRBGGRGBRBRRRBRGRGBGRRBBRBGGGBGGGRBBBGRGRGGRRRRRRGBGBBBGRRGGGRRBRGBRBBBGGBGRRRBRRGBGBBBGBGGBBBBGRGRBGBGGBBRBRRRBRRRRBGGBGBGRGGRRRGGRBGGBBBBBBBRBGBGBGRBBGGRRRGRRGBGRGBBRRGRGBRGRGRGRRGBGBGBGGGRBBRRGRBB\n", "output": "BGR\n"}, {"type": "stdin_stdout", "input": "200\nBBRBGGRGBRBRRR... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n banks in the city wh... | [{"type": "stdin_stdout", "input": "50\n108431864 128274949 -554057370 -384620666 -202862975 -803855410 -482167063 -55139054 -215901009 0 0 0 0 0 94325701 730397219 358214459 -673647271 -131397668 -377892440 0 0 0 0 0 -487994257 -360271553 639988328 489338210 -281060728 250208758 0 993242346 -213071841 -59752620 -86435... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKostya likes Codeforces contests... | [{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA prime number is a number which... | [{"type": "stdin_stdout", "input": "13 17\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "23 29\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "43 47\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "17 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11 13\n", "output": "YES... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\nSome time ago Slastyo... | [{"type": "stdin_stdout", "input": "50 5\n2 39 16 20 32 36 29 42 14 23 9 4 28 17 45 16 46 1 39 33 47 15 34 43 6 6 12 15 46 11 32 16 31 12 41 33 47 35 22 3 10 4 15 36 22 24 17 33 15 46\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "50 5\n2 39 16 20 32 36 29 42 14 23 9 4 28 17 45 16 46 1 39 33 47 15 34 43 6 6 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor Dumbledore is helping ... | [{"type": "stdin_stdout", "input": "43 959134961 -868367850 142426380\n921743429 63959718 -797293233 122041422 -407576197 700139744 299598010 168207043 362252658 591926075 941946099 812263640 -76679927 -824267725 89529990 -73303355 83596189 -982699817 -235197848 654773327 125211479 -497091570 -2301804 203486596 -126652... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova is again playing some compu... | [{"type": "stdin_stdout", "input": "1 1 100\n100 99\n", "output": "9901\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nH... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle town Nsk consists of n ju... | [{"type": "stdin_stdout", "input": "5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n2 5\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n1 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "5 6 1 5\n1 2\n1 3\n2 4\n4 5\n3 5\n2 5\n", "output": "3\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nProfessor Ibrahim has prepared t... | [{"type": "stdin_stdout", "input": "100 10\n39 242 238 155 95 30 129 132 72 59 22 91 203 113 99 81 253 204 160 109 92 187 11 227 145 211 100 42 78 14 113 91 140 197 123 182 4 185 208 27 182 207 63 146 102 39 159 195 26 100 72 127 157 159 152 53 0 117 101 125 19 188 179 145 240 50 205 207 113 246 42 56 161 13 188 244 15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne beautiful July morning a ter... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "512\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "511\n"}, {"type": "stdin_stdout", "input": "121212121\n", "output": "511\n"}, {"type": "stdin_stdout", "input": "101010101\n", "output": "341\n"}, {"type": "stdin_stdout", "input": "9015561... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a square matrix of... | [{"type": "stdin_stdout", "input": "500\n12\n.***.**.***.\n.*.**.*..*.*\n*...*..***.*\n***.*..*..**\n*..**...*...\n..**.*.**.*.\n..*....**...\n..**.**...*.\n..**..*...**\n**..**.****.\n*..**.**....\n.*.***.....*\n5\n**..*\n*.*.*\n**.**\n.*.*.\n*****\n10\n.***..*.**\n*.*..***.*\n*.***...*.\n.*.*..*.*.\n*.....**..\n**...... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the Kingdom of AtCoder, peopl... | [{"type": "stdin_stdout", "input": "aeplp", "output": "aeplps\n"}, {"type": "stdin_stdout", "input": "eaplp", "output": "eaplps\n"}, {"type": "stdin_stdout", "input": "daplp", "output": "daplps\n"}, {"type": "stdin_stdout", "input": "d`plp", "output": "d`plps\n"}, {"type": "stdin_stdout", "input": "c`plp", "output": "c... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider an analog clock whose h... | [{"type": "stdin_stdout", "input": "3 4 10 40", "output": "4.56425719433005567605"}, {"type": "stdin_stdout", "input": "3 4 9 0", "output": "5.00000000000000000000"}, {"type": "stdin_stdout", "input": "4 4 1 269", "output": "0.662465660098\n"}, {"type": "stdin_stdout", "input": "8 1 -1 312", "output": "7.45623470415\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\nSolve the following coding problem using the programming language python:\n\nGiven are N points (x_i, y_i) in... | [{"type": "stdin_stdout", "input": "10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9", "output": "6.726812023536805158"}, {"type": "stdin_stdout", "input": "10\n21 1\n10 7\n-1 -1\n-2 0\n1 10\n3 3\n1 4\n20 1\n6 7\n4 5", "output": "11.6109530324\n"}, {"type": "stdin_stdout", "input": "10\n21 2\n10 7\n-1 0\n-2 0\n0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Patisserie AtCoder sells cak... | [{"type": "stdin_stdout", "input": "10 10 10 42\n3471439818 7125082499 52097 2843504496 3381970101 14107954240 249131806 9465078905 6690322794 2898542789\n1873977926 4407421270 764181049 1379118507 9014541718 4925540914 3902539811 5851891101 178325203 2877436338\n8482502021 8974383988 2882263257 4734915691 95905874 859... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn \"Takahashi-ya\", a ramen res... | [{"type": "stdin_stdout", "input": "ooo", "output": "1000"}, {"type": "stdin_stdout", "input": "pxo", "output": "800\n"}, {"type": "stdin_stdout", "input": "yxx", "output": "700\n"}, {"type": "stdin_stdout", "input": "opo", "output": "900\n"}, {"type": "stdin_stdout", "input": "oxp", "output": "800\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJoisino is about to compete in t... | [{"type": "stdin_stdout", "input": "5\n7 5 1 10 5\n3\n4 3\n1 11\n3 12", "output": "21\n32\n39\n"}, {"type": "stdin_stdout", "input": "5\n7 5 1 10 5\n3\n4 3\n2 11\n3 12", "output": "21\n34\n39\n"}, {"type": "stdin_stdout", "input": "5\n7 8 1 10 11\n3\n4 3\n0 11\n3 7", "output": "30\n37\n43\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet w be a string consisting of ... | [{"type": "stdin_stdout", "input": "ab`cc`ba", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "abaccaba", "output": "Yes"}, {"type": "stdin_stdout", "input": "ab`ccaba", "output": "No\n"}, {"type": "stdin_stdout", "input": "`b`cc`ba", "output": "No\n"}, {"type": "stdin_stdout", "input": "ab`cc`b`", "output": "No... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMatrix of given integers\n\n\na1... | [{"type": "stdin_stdout", "input": "4\n1 3 -9 2\n2 7 -1 5\n-8 3 2 -1\n5 -1 -3 1", "output": "15\n"}, {"type": "stdin_stdout", "input": "4\n1 3 -9 0\n2 7 -1 5\n-8 3 2 -2\n3 -1 -3 1", "output": "14\n"}, {"type": "stdin_stdout", "input": "4\n1 3 -9 2\n2 4 -1 5\n-8 3 2 -1\n5 -1 -6 1", "output": "12\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNinja Atsushi guards the town fr... | [{"type": "stdin_stdout", "input": "8\n0 0 0 2 3 1 0 -1\n1 2 -1 2 1 0 -1 0\n2\n1 1 2 2\n0 -1 2 2\n-1", "output": "4\n0\n"}, {"type": "stdin_stdout", "input": "8\n0 0 -1 2 2 2 0 -1\n1 1 1 1 1 1 -1 0\n2\n1 1 2 2\n0 -1 4 2\n0", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "8\n0 0 0 2 3 1 0 -1\n1 2 0 2 1 0 -1 0\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\nSolve the following coding problem using the programming language python:\n\nYou are now examining a unique m... | [{"type": "stdin_stdout", "input": "7\n4 7 6 5 6 12 5", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n4 7 6 4 6 13 5", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n2 9 6 5 6 7 5", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n4 9 6 5 6 7 5", "output": "0\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nPeter is a senior manager of Agi... | [{"type": "stdin_stdout", "input": "2\ndevelopment:alice,bob,design,eve.\ndesign:carol,alice.\n3\none:another.\nanother:yetanother.\nxetanother:dave.\n3\nfriends:alice,bob,bestfriends,carol,fran,badcompany.\nbestfriends:eve,alice.\nbadcompany:dave,carol.\n5\na:b,c,d,e.\nb:c,d,e,f.\nc:d,e,f,g.\nd:e,f,g,h.\ne:f,g,h,i.\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\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\n2D, who is ... | [{"type": "stdin_stdout", "input": "2\npaks 0\naxii -1\n-1\nnkua hx`j", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\ntako -1\njiay -1\n0\npuja yakh", "output": "-2\n"}, {"type": "stdin_stdout", "input": "2\npaks -2\nayhi -1\n0\nmauk j`xh", "output": "-3\n"}, {"type": "stdin_stdout", "input": "2\npaks 1\naxi... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nPrepare the Othello b... | [{"type": "stdin_stdout", "input": "3\n1 1 10 1\n2 4 6 8\n6 3 8 8", "output": "10\n19\n15\n"}, {"type": "stdin_stdout", "input": "3\n1 1 10 1\n2 4 6 8\n8 3 8 8", "output": "10\n19\n6\n"}, {"type": "stdin_stdout", "input": "3\n1 1 10 1\n2 4 6 8\n8 3 8 4", "output": "10\n19\n2\n"}, {"type": "stdin_stdout", "input": "3\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\nSolve the following coding problem using the programming language python:\n\nFor given $N$ points in the 2D E... | [{"type": "stdin_stdout", "input": "5\n-1 0\n1 2\n2 1\n3 2\n4 0", "output": "12.462840740\n"}, {"type": "stdin_stdout", "input": "5\n0 0\n1 2\n2 1\n3 2\n4 0", "output": "10.94427191"}, {"type": "stdin_stdout", "input": "3\n-13 -1\n0 -1\n10 -2", "output": "46.071604488\n"}, {"type": "stdin_stdout", "input": "3\n-10 -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\nSolve the following coding problem using the programming language python:\n\nFor given integer n, count the t... | [{"type": "stdin_stdout", "input": "1101011", "output": "1084512\n"}, {"type": "stdin_stdout", "input": "1100111", "output": "1097712\n"}, {"type": "stdin_stdout", "input": "1010111", "output": "1003752\n"}, {"type": "stdin_stdout", "input": "1111111", "output": "1106224\n"}, {"type": "stdin_stdout", "input": "1011001"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChef Jessie has a lot of recipes... | [{"type": "stdin_stdout", "input": "4\nflour-with-eggs 100\nchicken-ham -10\nflour-without-eggs 200\nfish-with-pepper 1100\n6\nf\nflour-with\nflour-with-\nc\nfl\nchik", "output": "fish-with-pepper\nflour-without-eggs\nflour-with-eggs\nchicken-ham\nflour-without-eggs\nNO\n"}, {"type": "stdin_stdout", "input": "4\nflour-... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you know, majority of student... | [{"type": "stdin_stdout", "input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 37\n7 97\n8 54\n7 41\n7 56\n5 21\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "10 10\n7 29\n10 31\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "10 10\n7 29\n10 31\n9 32\n5 17\n5 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tube which is re... | [{"type": "stdin_stdout", "input": "13 968288\n0 67108864 134217728 201326592 268435456 335544320 402653184 469762048 536870912 603979776 671088640 738197504 805306368\n13 986214\n33554432 100663296 167772160 234881024 301989888 369098752 436207616 503316480 570425344 637534208 704643072 771751936 838860800\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\nSolve the following coding problem using the programming language python:\n\nLunar New Year is approaching, a... | [{"type": "stdin_stdout", "input": "100\n28 27 23 6 23 11 25 20 28 15 29 23 20 2 8 24 8 9 30 8 8 1 11 7 6 17 17 27 26 30 12 22 17 22 9 25 4 26 9 26 10 30 13 4 16 12 23 19 10 22 12 20 3 16 10 4 29 11 15 4 5 7 29 16 3 1 7 16 26 14 28 1 15 19 30 28 5 22 14 28 13 12 11 30 3 4 7 10 22 8 4 10 22 12 17 27 23 11 18 7\n", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two arrays a and b... | [{"type": "stdin_stdout", "input": "5\n-999999999 999999999 1252085585 999999998 -414067761\n-1011239935 -1000000000 -1000000000 -1397885361 1010000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n-999999999 999999999 1252085585 999999998 -421666581\n-1011239935 -1000000000 -1000000000 -1397885361 101000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have an array a_1, a_2, ...,... | [{"type": "stdin_stdout", "input": "99\n1 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 95 96 9... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.