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\nYou are given an array $d_1, d_2... | [{"type": "stdin_stdout", "input": "5\n2 3 5 4 10\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1000000100\n", "output": "0\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\nThere are n pearls in a row. Let... | [{"type": "stdin_stdout", "input": "10\n460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451\n", "output": "5\n1 2\n3 4\n5 6\n7 8\n9 10\n"}, {"type": "stdin_stdout", "input": "10\n460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nAlice has a string consisting of... | [{"type": "stdin_stdout", "input": "AAAAAA\nAAAAAA\n30\n3 4 1 2\n3 3 4 4\n5 6 3 4\n3 3 2 3\n6 6 1 5\n2 4 4 6\n1 6 2 5\n6 6 3 4\n3 5 1 4\n4 5 3 6\n2 3 2 4\n3 4 4 4\n6 6 4 6\n3 3 2 5\n1 5 3 3\n4 6 1 2\n6 6 6 6\n3 3 3 4\n6 6 6 6\n5 6 4 4\n6 6 5 5\n2 3 1 4\n3 6 4 5\n3 5 6 6\n4 5 2 6\n5 6 6 6\n1 4 2 5\n4 5 2 5\n4 5 1 3\n2 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\nOn the xy-plane, Snuke is going ... | [{"type": "stdin_stdout", "input": "711627115 480696358 633203014 877112611\n997\n823068082 -750068892 144324195\n-150528283 572165970 8705984\n579786057 146049479 458783401\n-571870801 -833355728 354709151\n-225671601 -182489804 264833500\n816772899 775985943 18276416\n111104358 490248913 465440593\n-508331521 -827309... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 function with the signat... | [{"input": "[-11, -12, -13, -14]", "output": "[true]", "fn_name": "is_int_array"}, {"input": "[1.0, 2.0, 3.0001]", "output": "[false]", "fn_name": "is_int_array"}, {"input": "[1.0, 2.0, 3.0]", "output": "[true]", "fn_name": "is_int_array"}, {"input": "[1, 2, null]", "output": "[false]", "fn_name": "is_int_array"}, {"in... | 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\nSolve the following coding problem using the programming language python:\n\nKolya got string s for his birth... | [{"type": "stdin_stdout", "input": "jhfwjyyzwrjiyrrgveiqkoltivghgkontrqragikttxxuwszjwqhwxindyrdqhucnbwgwrppgqmsasrzohezjlfmkzsqptwpratprcrxyxecnlsaiqrvimihmhjfgzwdtvmfhgbuonpsblphyoxzclkrwbwrkasahiirzqlfjdoomlosltldbpomyyhmdwfchzxnmwlh\n200\n", "output": "400\n"}, {"type": "stdin_stdout", "input": "nemtbujbscvkgxnbqbo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 array of intege... | [{"type": "stdin_stdout", "input": "4\n5\n-1 -1 -4 -1 -5\n6\n-4 -4 -3 1 2 -1\n6\n0 -1 -1 -1 -1 -1\n6\n-12 -7 -10 -3 -2 1\n", "output": "-20\n96\n0\n2520\n"}, {"type": "stdin_stdout", "input": "4\n5\n-1 -1 -4 -1 -5\n6\n-4 -4 -3 1 2 -1\n6\n0 -1 -1 -1 -1 -1\n6\n-9 -7 -10 -3 -2 1\n", "output": "-20\n96\n0\n1890\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\nMultiplication of Big Integers\n... | [{"type": "stdin_stdout", "input": "2 -134", "output": "-268\n"}, {"type": "stdin_stdout", "input": "3 -134", "output": "-402\n"}, {"type": "stdin_stdout", "input": "6 -134", "output": "-804\n"}, {"type": "stdin_stdout", "input": "-124 4", "output": "-496\n"}, {"type": "stdin_stdout", "input": "-103 -1", "output": "103... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nFind the number of palindromic n... | [{"type": "stdin_stdout", "input": "31415 92653\n", "output": "612\n"}, {"type": "stdin_stdout", "input": "31415 97709", "output": "662\n"}, {"type": "stdin_stdout", "input": "53417 77120", "output": "237\n"}, {"type": "stdin_stdout", "input": "44323 77120", "output": "328\n"}, {"type": "stdin_stdout", "input": "44323 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 likes everything infinite.... | [{"type": "stdin_stdout", "input": "-1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-1000000000 1001000000 1000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "119057... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nDr .: Peter. I did.\n\nPeter: Se... | [{"type": "stdin_stdout", "input": "1\n0 1 0 0 0 0 0 0 0 0\n1 1 1 0 0 0 0 0 0 0\n0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 1 0 0 0 0\n0 0 0 1 0 0 1 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 0 1 0", "output": "0 0 0 0 1 0 1 0 0 0\n0 1 0 1 1 0 1 1 0 0\n0 0 1 0 1 0 1 0 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnimation is one of methods for ... | [{"type": "stdin_stdout", "input": "1\ngalaxy_angel 0 1197\n1\ngalaxy_angel\n11\nA 0 600\nB 0 610\nC 0 610\nD 0 931\nE 0 640\nEE 0 700\nF 0 788\nG 0 710\nH 0 710\nI 0 740\nJ 0 750\n2\nB\nH\n42\nnchj 6 2620\nanhnnnmewbktthsrn 4 2515\ngntmdsh 1 1800\nachnnl 4 2540\nhnskirh 0 2200\naonexrcst 0 1700\ndgdys 6 2330\nhdnnara ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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## Task\n\nGenerate a sorted lis... | [{"input": "\"213.192.46.160/28\"", "output": "[[\"213.192.46.161\", \"213.192.46.162\", \"213.192.46.163\", \"213.192.46.164\", \"213.192.46.165\", \"213.192.46.166\", \"213.192.46.167\", \"213.192.46.168\", \"213.192.46.169\", \"213.192.46.170\", \"213.192.46.171\", \"213.192.46.172\", \"213.192.46.173\", \"213.192.4... | 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\nSolve the following coding problem using the programming language python:\n\nYou are given a tree that consis... | [{"type": "stdin_stdout", "input": "4\n3\n3 1\n2 1\n4\n22861 20707 59627 9293\n3\n3 1\n1 2\n6\n15767 40973 20807 24419 46439 62816\n3\n3 2\n1 2\n6\n31575 54493 10799 37529 59743 30529\n3\n3 1\n2 1\n1\n51618\n", "output": "783349080\n372565328\n603348715\n103238\n"}, {"type": "stdin_stdout", "input": "4\n3\n3 1\n2 1\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\nYelisey has an array $a$ of $n$ ... | [{"type": "stdin_stdout", "input": "8\n1\n10\n2\n0 0\n3\n-1 2 -1\n4\n2 18 1 -1\n2\n3 6\n5\n3 2 -4 -2 0\n2\n-1 -1\n1\n-2\n", "output": "10\n0\n3\n16\n3\n2\n0\n-2\n"}, {"type": "stdin_stdout", "input": "8\n1\n10\n2\n1 0\n3\n-1 2 -1\n4\n2 18 1 -1\n2\n3 6\n5\n3 2 -4 -2 0\n2\n-1 -1\n1\n-2\n", "output": "10\n1\n3\n16\n3\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\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "30\n4 4 1\n3 3 1 2\n4 4 1\n4 1 4 1\n1 1 1\n1\n3 2 1\n2 1 2\n4 4 2\n3 2 2 2\n4 2 4\n1 2 2 2\n1 4 1\n4\n2 3 1\n2 3\n2 2 1\n2 2\n4 4 2\n1 2 4 2\n4 4 1\n2 4 4 3\n4 3 1\n1 3 1 3\n1 1 1\n1\n2 2 2\n2 1\n2 4 1\n1 4\n2 4 1\n3 4\n1 2 1\n1\n2 4 2\n2 1\n3 1 2\n1 1 1\n2 4 1\n1 4\n2 3 1\n3 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\n# Background\n\nMy TV remote con... | [{"input": "\"The Quick Brown Fox Jumps Over A Lazy Dog.\"", "output": "[306]", "fn_name": "tv_remote"}, {"input": "\"Pack My Box With Five Dozen Liquor Jugs.\"", "output": "[290]", "fn_name": "tv_remote"}, {"input": "\" x X \"", "output": "[34]", "fn_name": "tv_remote"}, {"input": "\"MISSISSIPPI\"", "output": ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRick and Morty are playing their... | [{"type": "stdin_stdout", "input": "7000\n7 419 1631 1925 3861 6940 379 493\n29 5389 5925 2923 4696 972 6125 3779 6044 5477 1305 6488 5059 5515 3238 3863 248 6947 4023 6168 1915 6607 2991 2220 2023 200 4457 6398 1017 447\n", "output": "Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 function named sumDigits... | [{"input": "1234567890", "output": "[45]", "fn_name": "sum_digits"}, {"input": "800000009", "output": "[17]", "fn_name": "sum_digits"}, {"input": "100000002", "output": "[3]", "fn_name": "sum_digits"}, {"input": "666", "output": "[18]", "fn_name": "sum_digits"}, {"input": "99", "output": "[18]", "fn_name": "sum_digits"... | 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\nSolve the following coding problem using the programming language python:\n\nYou're continuing to enjoy your ... | [{"input": "100", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "200", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "2017", "output": "[\"F\"]", "fn_name": "which_note"}, {"input": "12", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "111", "output": "[\"G\"]", "fn_name": "which_note... | 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\nSolve the following coding problem using the programming language python:\n\nA magic number is a number forme... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "144144144\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "141414141\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "114114144\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nWe have a large square grid with... | [{"type": "stdin_stdout", "input": "100000 100000 99999 72298", "output": "471980925\n"}, {"type": "stdin_stdout", "input": "100000 100000 43938 55555", "output": "265769345\n"}, {"type": "stdin_stdout", "input": "100000 100000 99999 39553", "output": "199584029\n"}, {"type": "stdin_stdout", "input": "100000 100000 439... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nVanya smashes potato in a vertic... | [{"type": "stdin_stdout", "input": "25 1000000000 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDZY loves planting, and he enjoy... | [{"type": "stdin_stdout", "input": "10\n1 10 4313\n2 6 2842\n3 6 7059\n4 6 3007\n5 6 6195\n7 6 3962\n8 6 3413\n9 6 7658\n10 6 8049\n3\n3\n2\n1\n4\n4\n5\n2\n1\n1\n", "output": "7059\n"}, {"type": "stdin_stdout", "input": "10\n2 1 8760\n3 1 3705\n4 1 1862\n5 2 7332\n6 3 7015\n7 5 4866\n8 3 4465\n9 7 8886\n10 3 9362\n2\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\nDefine a function that takes in ... | [{"input": "3715290469715693021198967285016729344580685479654510946723\n68819615221552997273737174557165657483427362207517952651", "output": "[7]", "fn_name": "last_digit"}, {"input": "38710248912497124917933333333284108412048102948908149081409204712406\n226628148126342643123641923461846128214626", "output": "[6]", "fn... | 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\nSolve the following coding problem using the programming language python:\n\nPolycarp calls an array dense if... | [{"type": "stdin_stdout", "input": "6\n4\n4 2 10 1\n2\n1 3\n2\n12 1\n3\n1 4 2\n5\n1 2 3 4 3\n12\n4 27 25 50 30 20 34 46 42 16 15 21\n", "output": "5\n1\n3\n1\n0\n3\n"}, {"type": "stdin_stdout", "input": "6\n4\n4 2 10 1\n2\n1 6\n2\n6 1\n3\n1 7 2\n5\n1 1 2 6 1\n12\n3 58 25 17 43 21 20 46 42 11 30 16\n", "output": "5\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\nSolve the following coding problem using the programming language python:\n\nSnuke loves flags.\n\nSnuke is p... | [{"type": "stdin_stdout", "input": "22\n93 6440\n78 6647\n1028 11\n8306 9689\n798 99\n801 521\n188 206\n6079 971\n4559 209\n50 94\n92 6270\n5403 560\n803 83\n1855 99\n42 504\n75 484\n629 11\n92 122\n3359 37\n28 16\n648 14\n11 269", "output": "17\n"}, {"type": "stdin_stdout", "input": "22\n93 6440\n78 6647\n889 11\n8306... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nPetya loves lucky numbers. Every... | [{"type": "stdin_stdout", "input": "485 9554485\n7759121368632736852539182753173468028218114958118158732302477551670775608015153610483175626465946144780731573954182900412248382710280376491925985206156109890139333293746203940442347501294009600230166311978044218247083102712257326301109220002496805123344816427514286225153... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Smart Beaver from ABBYY bega... | [{"type": "stdin_stdout", "input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 608 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 of leng... | [{"type": "stdin_stdout", "input": "9\nedtbiuaon\n-2", "output": "******a**\n"}, {"type": "stdin_stdout", "input": "9\neducation\n4", "output": "***c*****\n"}, {"type": "stdin_stdout", "input": "9\nedubation\n4", "output": "***b*****\n"}, {"type": "stdin_stdout", "input": "9\nedubation\n6", "output": "*****t***\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\nSnuke is having another barbeque... | [{"type": "stdin_stdout", "input": "3\n11 3\n2 2\n0 2", "output": "12951\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n2 3\n2 0", "output": "11783\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n2 3\n1 0", "output": "11753\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n0 4\n7 9", "output": "262332\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\nSasha is a very happy guy, that'... | [{"type": "stdin_stdout", "input": "84 15\n", "output": "2429 \n"}, {"type": "stdin_stdout", "input": "100 100\n", "output": "99 \n"}, {"type": "stdin_stdout", "input": "100 98\n", "output": "100 \n"}, {"type": "stdin_stdout", "input": "100 97\n", "output": "102 \n"}, {"type": "stdin_stdout", "input": "100 3\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\nSolve the following coding problem using the programming language python:\n\nThe string $t_1t_2 \\dots t_k$ i... | [{"type": "stdin_stdout", "input": "7\nAAABABB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "7\nBBABAAA\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "7\nBAAAABB\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "7\nABABAAB\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "7\nBBAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 two lines s1 and s2, p... | [{"type": "stdin_stdout", "input": "3\n-1 -1 10 1 2 0 2 2\n0 5 6 -1 0 -1 0 22\n-2 -1 1 1 0 -1 2 2", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1 10 1 2 0 2 2\n0 5 6 -1 0 -1 0 22\n-2 -1 1 1 1 -1 2 2", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1 10 1 2 0 2 4\n0 5 6 -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\nSolve the following coding problem using the programming language python:\n\nYou are given some text $t$ and ... | [{"type": "stdin_stdout", "input": "5\naaaaa\n3\naaa\naaa\na\nabbaa\n4\nab\nbaa\nabb\na\nabcdefg\n10\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nabcdefghijklmnop\n4\nabcdefg\nefghijklmo\nijklmnop\nhijklmnop\nababababbababba\n5\na\nabba\nb\nbb\naa\n", "output": "2\n1 1\n1 3\n2\n3 1\n2 3\n7\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n7 7\n2\n1 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\nTwo players, A and B, play the g... | [{"type": "stdin_stdout", "input": "3\n13 1\n1 4\n1 4\n3\n20 1\n6 7\n1 1\n3\n15 1\n5 5\n1 8\n0", "output": "14 10\n22 14\n21 14\n"}, {"type": "stdin_stdout", "input": "3\n13 1\n1 4\n1 4\n3\n20 1\n6 8\n1 1\n3\n15 1\n5 5\n1 8\n0", "output": "14 10\n22 15\n21 14\n"}, {"type": "stdin_stdout", "input": "3\n13 1\n1 4\n0 4\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\nSolve the following coding problem using the programming language python:\n\nA railroad running from west to ... | [{"type": "stdin_stdout", "input": "4\n12 13 1\n44 17 17\n66 4096 64\n", "output": "4162\n4162\n4162\n0\n"}, {"type": "stdin_stdout", "input": "4\n1 13 1\n44 17 22\n101 4096 64", "output": "4197\n4197\n4197\n0\n"}, {"type": "stdin_stdout", "input": "4\n1 13 1\n44 17 22\n120 4096 64", "output": "4216\n4216\n4216\n0\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe development of a text editor... | [{"type": "stdin_stdout", "input": "21\n(RRRRR)LLLL(RRR)LL(R)\n", "output": "-1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 2 2 2 -1 -1 3 "}, {"type": "stdin_stdout", "input": "21\n(RRRRR)LLLL(RRR)LL(R)\n", "output": "-1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 2 2 2 -1 -1 3 "}, {"type": "stdin_stdout", "input": "11\n'R)R(R)Ra)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\nWhat's in a name?\n..Or rather, ... | [{"input": "\"A crew that boards the ship\"\n\"chris\"", "output": "[false]", "fn_name": "name_in_str"}, {"input": "\"Just enough nice friends\"\n\"Jennifer\"", "output": "[false]", "fn_name": "name_in_str"}, {"input": "\"Across the rivers\"\n\"chris\"", "output": "[true]", "fn_name": "name_in_str"}, {"input": "\"Next ... | 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\nSolve the following coding problem using the programming language python:\n\nHave you ever heard of the unit ... | [{"type": "stdin_stdout", "input": "101 -1", "output": "-30.5525011457\n"}, {"type": "stdin_stdout", "input": "111 -1", "output": "-33.5775012592\n"}, {"type": "stdin_stdout", "input": "-1 106", "output": "-32.0650012024\n"}, {"type": "stdin_stdout", "input": "26 -1", "output": "-7.86500029494\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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[Haikus](https://en.wikipedia.or... | [{"input": "\"My code is cool, right?\\nJava # Pyhton ; Ruby // Go:\\nI know them all, yay! ;-)\"", "output": "[true]", "fn_name": "is_haiku"}, {"input": "\"An old silent pond...\\nA frog jumps into the pond,\\nsplash!\\nSilence again.\"", "output": "[false]", "fn_name": "is_haiku"}, {"input": "\"An old silent pond...\... | 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\nSolve the following coding problem using the programming language python:\n\n# Task\n Let's consider a table ... | [{"input": "100000\n1000000000", "output": "[16]", "fn_name": "count_number"}, {"input": "6\n169", "output": "[0]", "fn_name": "count_number"}, {"input": "10\n5", "output": "[2]", "fn_name": "count_number"}, {"input": "6\n12", "output": "[4]", "fn_name": "count_number"}, {"input": "5\n5", "output": "[2]", "fn_name": "c... | 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\nSolve the following coding problem using the programming language python:\n\nAt the store, the salespeople wa... | [{"type": "stdin_stdout", "input": "7\n100\n40000000\n89657\n326894\n2325566\n74444\n200055\n", "output": "0\n30000000\n79657\n226894\n1325566\n64444\n100055\n"}, {"type": "stdin_stdout", "input": "7\n1\n2\n178\n20\n999999999\n9000\n987654321\n", "output": "0\n1\n78\n10\n899999999\n8000\n887654321\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\nAn art exhibition will be held i... | [{"type": "stdin_stdout", "input": "3\n1 12\n26 -1\n2 0", "output": "12\n"}, {"type": "stdin_stdout", "input": "3\n1 11\n80 0\n2 -1", "output": "11\n"}, {"type": "stdin_stdout", "input": "3\n0 17\n14 1\n13 2", "output": "17\n"}, {"type": "stdin_stdout", "input": "3\n0 16\n54 3\n5 1", "output": "16\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\nYou are given a set of n element... | [{"type": "stdin_stdout", "input": "6 2\n2578 6301 8624 6020 8513 9486\n", "output": "4401332\n"}, {"type": "stdin_stdout", "input": "6 3\n4759 5555 7401 8003 2501 6345\n", "output": "7431260\n"}, {"type": "stdin_stdout", "input": "6 2\n2578 6301 8624 6020 8513 9486\n", "output": "4401332\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\nThere are two bus stops denoted ... | [{"type": "stdin_stdout", "input": "2 1000000000\n999999999 1000000000\n1 2\n", "output": "Yes\n1999999999 2000000000\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n2 2\n", "output": "Yes\n2000000000 2000000001\n"}, {"type": "stdin_stdout", "input": "2 1000010000\n1 1000000000\n2 2\n", "output": "Y... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nRng is preparing a problem set f... | [{"type": "stdin_stdout", "input": "7\n100 200 500 700 238 1600 2000\n6\n100 200 500 700 1600 1600", "output": "NO\n"}, {"type": "stdin_stdout", "input": "7\n100 200 500 700 238 1600 2000\n6\n100 200 500 337 1600 1600", "output": "NO\n"}, {"type": "stdin_stdout", "input": "7\n100 200 500 700 1200 1600 2000\n6\n100 200 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 biggest event of the year β ... | [{"type": "stdin_stdout", "input": "16 50\n57794 44224 38309 41637 11732 44974 655 27143 11324 49584 3371 17159 26557 38800 33033 18231 26264 14765 33584 30879 46988 60703 52973 47349 22720 51251 54716 29642 7041 54896 12197 38530 51481 43063 55463 2057 48064 41953 16250 21272 34003 51464 50389 30417 45901 38895 25949 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 two strings s and t co... | [{"type": "stdin_stdout", "input": "contest\nprogramming\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "contest\nprogrammhng", "output": "-1\n"}, {"type": "stdin_stdout", "input": "eontcst\nprogrammhng", "output": "-1\n"}, {"type": "stdin_stdout", "input": "eonscst\nprogrammhng", "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\nWrite a program that will calcul... | [{"input": "1000000000", "output": "[249999998]", "fn_name": "zeros"}, {"input": "100000", "output": "[24999]", "fn_name": "zeros"}, {"input": "1000", "output": "[249]", "fn_name": "zeros"}, {"input": "100", "output": "[24]", "fn_name": "zeros"}, {"input": "30", "output": "[7]", "fn_name": "zeros"}, {"input": "0", "out... | 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\nSolve the following coding problem using the programming language python:\n\nAfter the educational reform Pol... | [{"type": "stdin_stdout", "input": "100\n45 55\n3 5 3 4 1 1 1 1 5 2 1 3 1 5 3 5 1 1 3 1 1 3 5 5 1 1 1 5 5 1 3 1 1 1 3 3 1 1 1 4 3 1 5 1 3 1 4 5 4 3 3 1 1 5 5 1 3 5 1 1 5 1 1 3 5 5 1 1 3 3 4 1 1 4 5 3 1 3 1 5 1 5 4 5 1 1 1 1 4 5 4 5 3 1 1 5 1 5 1 4\n", "output": "1 1 1 1 2 2 2 2 1 2 2 1 2 1 1 1 2 2 1 2 2 1 1 1 2 2 2 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\nClaire is a man-eater. She's a r... | [{"type": "stdin_stdout", "input": "2\n2 100\n10 12\n14 16\n2 200\n12 13\n18 20\n4\n1 100\n6 22\n1 1000\n12 22\n1 10000\n6 22\n1 100000\n6 22\n16\n1 100000000\n6 7\n1 100000000\n7 8\n1 100000000\n8 15\n1 110000000\n9 10\n1 100000000\n10 11\n1 100000000\n11 12\n1 100000000\n12 13\n1 100000000\n13 17\n1 100000000\n14 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\nGiven the list of numbers, you a... | [{"type": "stdin_stdout", "input": "5\n0\n0\n10\n11\n2", "output": "0\n0\n2\n10\n11\n"}, {"type": "stdin_stdout", "input": "5\n1\n1\n3\n11\n2", "output": "1\n1\n2\n3\n11\n"}, {"type": "stdin_stdout", "input": "5\n1\n1\n3\n11\n4", "output": "1\n1\n3\n4\n11\n"}, {"type": "stdin_stdout", "input": "5\n1\n0\n3\n11\n4", "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\nSolve the following coding problem using the programming language python:\n\nDiameter of a Tree\n\n\n\n\nGive... | [{"type": "stdin_stdout", "input": "4\n1 0 -2\n2 1 10\n1 3 4", "output": "14\n"}, {"type": "stdin_stdout", "input": "4\n1 0 1\n0 2 12\n2 3 -1", "output": "13\n"}, {"type": "stdin_stdout", "input": "4\n1 0 0\n2 1 11\n0 3 11", "output": "22\n"}, {"type": "stdin_stdout", "input": "4\n1 0 -1\n2 1 15\n1 3 4", "output": "19\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 people standing on t... | [{"type": "stdin_stdout", "input": "10 3\n8 7 100\n7 9 100\n9 8 100\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "3 3\n1 2 1\n2 3 1\n1 3 2\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4 3\n2 1 1\n2 3 5\n3 4 2\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3 3\n1 2 1\n2 3 1\n1 3 5\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 a dynamic array $A = \\\\{a_... | [{"type": "stdin_stdout", "input": "8\n0 -1\n0 14\n0 1\n2\n0 4\n1 0\n1 0\n1 1", "output": "-1\n-1\n14\n"}, {"type": "stdin_stdout", "input": "8\n0 -1\n0 9\n1 1\n2\n0 4\n1 0\n1 0\n1 1", "output": "9\n-1\n-1\n4\n"}, {"type": "stdin_stdout", "input": "8\n0 -1\n0 2\n0 3\n2\n0 4\n1 0\n1 0\n1 0", "output": "-1\n-1\n-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\nRead problems statements in Mand... | [{"type": "stdin_stdout", "input": "4 0\n5 -1 14 -1", "output": "5 -1 14 -1\n"}, {"type": "stdin_stdout", "input": "4 0\n6 -1 14 -1", "output": "6 -1 14 -1\n"}, {"type": "stdin_stdout", "input": "4 1\n1 -1 19 4", "output": "18 20 0 15\n"}, {"type": "stdin_stdout", "input": "4 1\n5 -1 15 0", "output": "10 16 0 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\nSolve the following coding problem using the programming language python:\n\nEkiden competitions are held eve... | [{"type": "stdin_stdout", "input": "7 11\n2 4 2\n1 6 2\n2 4 2\n1 5 10\n2 6 2\n6 4 1\n6 5 1\n3 6 1\n4 7 0\n5 5 6\n6 7 1", "output": "4\n3\n4\n5\n7\n"}, {"type": "stdin_stdout", "input": "7 11\n2 1 2\n1 3 1\n2 3 2\n3 4 4\n2 6 1\n4 4 1\n3 5 2\n3 6 1\n4 7 3\n5 7 7\n6 7 1", "output": "4\n1\n2\n6\n7\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 of n... | [{"type": "stdin_stdout", "input": "100 83\n6 98 18 72 51 83 66 40 32 60 90 53 91 10 92 47 94 1 77 8 19 78 9 52 85 2 26 12 97 100 82 84 46 79 38 39 50 35 55 99 37 88 74 4 20 23 43 11 87 59 75 61 71 73 34 130 21 17 44 62 42 95 30 54 5 25 64 81 58 65 7 3 45 70 76 24 89 28 80 41 14 31 49 56 22 63 68 13 29 33 67 96 27 36 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\nSnuke has an empty sequence a.\n... | [{"type": "stdin_stdout", "input": "9\n1 1 1 1 2 1 2 3 2", "output": "1\n2\n2\n3\n1\n2\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1 2 1 1 2 3 2", "output": "1\n2\n2\n3\n1\n1\n2\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1 1 2 1 4 3 2", "output": "1\n2\n1\n3\n2\n4\n1\n1\n1\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\nIn some country live wizards. Th... | [{"type": "stdin_stdout", "input": "10 7 8\n2 4\n3 13\n4 7\n5 1\n6 16\n10 9\n12 18\n16 4\n17 16\n20 6\n", "output": "4.285714285714286\n4.511857892036909\n5.642857142857143\n13.071428571428573\n13.071428571428573\n13.071428571428573\n13.51185789203691\n18.28571428571429\n18.511857892036907\n21.761904761904763\n"}, {"ty... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nHeidi found out that the Daleks ... | [{"type": "stdin_stdout", "input": "10 26\n9 5 277429172\n10 8 789225932\n5 2 992601916\n9 8 277294258\n8 6 245446241\n9 2 378979732\n7 1 895407000\n10 6 699661758\n1 9 865851152\n2 8 397672809\n7 10 756200111\n8 3 431547893\n5 6 465205287\n7 4 957301499\n3 4 308491540\n3 7 258504473\n10 5 282875145\n1 8 262659451\n5 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\nSolve the following coding problem using the programming language python:\n\nOnce upon a time in the thicket ... | [{"type": "stdin_stdout", "input": "62 47 14 888621154\n202 268 300 401 422 660 782 822 1164 1300 1571 1670 1713 1807 2677 2700 2747 2873 2956 3068 3798 4159 4221 4232 4485 4507 4803 5071 5161 5161 5595 5600 5623 5846 5867 5949 6140 6560 6727 6781 6873 7159 7218 7232 7241 7333 7369 7415 7486 7506 7538 7681 7781 8074 87... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\n"}, {"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... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 going out for a walk, wh... | [{"type": "stdin_stdout", "input": "2 1000000000\n1 1\n1 00000000\n0 30000000\n2 164820504", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n", "output": "860000004\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n1 1\n1 00000000\n1 30000000\n1 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\nThe king Copa often has been rep... | [{"type": "stdin_stdout", "input": "02.05.90\n08.03.50\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "29.02.80\n29.02.60\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "15.12.62\n17.12.21\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "08.07.20\n27.01.01\n", "output": "YES\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\nproblem\n\nYou are looking for a... | [{"type": "stdin_stdout", "input": "5\n8 5\n6 4\n4 3\n7 10\n0 10\n10\n10 5\n2 7\n9 7\n8 10\n10 2\n1 2\n8 1\n6 7\n6 0\n0 0\n5\n904207 809784\n845370 244806\n499091 59863\n638406 182509\n435076 362268\n10\n757559 866424\n114810 239537\n519926 989458\n461089 424480\n674361 448440\n81851 150384\n459107 795405\n299682 6700\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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##Task:\n\nYou have to write a f... | [{"input": "5", "output": "[\"5\\n54\\n543\\n5432\\n54321\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"2\\n21\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"1\"]", "fn_name": "pattern"}, {"input": "0", "output": "[\"\"]", "fn_name": "patt... | 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\nSolve the following coding problem using the programming language python:\n\nVasya decided to write an anonym... | [{"type": "stdin_stdout", "input": "kKhuIwRPLCwPFfcnsyCfBdnsraGeOCcLTfXuGjqFSGPSAeDZJSS bXKFanNqWjpFnvRpWxHJspvisDlADJBioxXNbVoXeUedoPcNEpUyEeYxdJXhGzFAmpAiHotSVwbZQsuWjIVhVaEGgqbZHIoDpiEmjTtFylCwCkWWzUOoUfOHxEZvDwNpXhBWamHn\nK VpJjGhNbwCRhcfmNGVjewBFpEmPlIKeTuWiukDtEWpjgqciqglkyNfWrBLbGAKvlNWxaUelJmSlSoakSpRzePvJsshOs... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 programming contest will be he... | [{"type": "stdin_stdout", "input": "7\n-1 -1 19 1 0 4 -2", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 -1 19 2 0 4 -2", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 1 19 2 2 4 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 1 19 2 3 4 -1", "output": "3\n"}, {"type": "stdin_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\nFind the sum of the weights of e... | [{"type": "stdin_stdout", "input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 10\n0 5 3", "output": "32\n"}, {"type": "stdin_stdout", "input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 0\n0 5 3", "output": "30\n"}, {"type": "stdin_stdout", "input": "6 10 0\n0 2 14\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nCreate a function that takes in ... | [{"input": "63\n14", "output": "[[38.5, 24.5]]", "fn_name": "get_ages"}, {"input": "70\n10", "output": "[[40, 30]]", "fn_name": "get_ages"}, {"input": "24\n4", "output": "[[14, 10]]", "fn_name": "get_ages"}, {"input": "30\n6", "output": "[[18, 12]]", "fn_name": "get_ages"}, {"input": "80\n80", "output": "[[80, 0]]", "f... | 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\nSolve the following coding problem using the programming language python:\n\nYou need to play around with the... | [{"input": "\"returnofthespacecamel\"", "output": "[\"aatpawnftqabyvbabvvau\"]", "fn_name": "vowel_back"}, {"input": "\"bringonthebootcamp\"", "output": "[\"kaiwpnwtqaknntbvvy\"]", "fn_name": "vowel_back"}, {"input": "\"weneedanofficedog\"", "output": "[\"fawaaavwnffibaanp\"]", "fn_name": "vowel_back"}, {"input": "\"ex... | 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\nSolve the following coding problem using the programming language python:\n\nFor given two segments s1 and s2... | [{"type": "stdin_stdout", "input": "3\n-1 0 0 -1 2 1 4 -2\n1 -1 -1 0 4 2 6 -1\n0 -1 6 1 0 -2 5 0", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 -1 -1 2 1 4 -2\n1 0 0 0 4 1 6 -1\n0 -1 12 1 1 -2 0 0", "output": "0\n0\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 0 -1 2 1 4 -2\n1 0 0 0 4 1 6 -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\nDepth-first search (DFS) follows... | [{"type": "stdin_stdout", "input": "6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 -1", "output": "1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n"}, {"type": "stdin_stdout", "input": "6\n1 2 2 3\n2 2 4 4\n3 1 5\n4 1 6\n5 1 6\n6 -1", "output": "1 1 12\n2 2 7\n3 8 11\n4 3 6\n5 9 10\n6 4 5\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\nByteburg Senate elections are co... | [{"type": "stdin_stdout", "input": "11 14\n8 4 17 5 14 9 13 3 17 21 27\n5 16 1 4 24 14 8 32 29 19 17\n11 6 12 0 16 31 27 11 4 7 32\n2 9 2 31 30 12 21 11 29 29 26\n9 21 4 25 26 14 28 16 12 26 23\n31 22 30 5 6 29 31 11 20 18 29\n5 21 27 13 23 23 9 6 25 21 25\n8 16 29 5 26 14 2 15 3 15 22\n19 18 18 21 5 31 14 1 8 3 19\n16... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 job is to write a function ... | [{"input": "\"a lot of words for a single line\"\n10", "output": "[\"a lot of\\nwords for\\na single\\nline\"]", "fn_name": "word_wrap"}, {"input": "\"a b c dd eee ffff g hhhhh i\"\n3", "output": "[\"a b\\nc\\ndd\\neee\\nfff\\nf g\\nhhh\\nhh\\ni\"]", "fn_name": "word_wrap"}, {"input": "\"areallylongword\"\n6", "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\nSolve the following coding problem using the programming language python:\n\nThe country Treeland consists of... | [{"type": "stdin_stdout", "input": "15\n15 6\n2 15\n14 15\n15 12\n1 2\n10 15\n14 4\n13 7\n11 1\n5 2\n7 2\n3 2\n14 8\n9 15\n", "output": "7\n11 13\n"}, {"type": "stdin_stdout", "input": "15\n15 6\n2 15\n14 15\n15 12\n1 2\n10 15\n14 4\n13 7\n11 1\n5 2\n7 2\n3 2\n7 8\n9 15\n", "output": "7\n11 13\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nMoamen has an array of $n$ disti... | [{"type": "stdin_stdout", "input": "3\n5 4\n6 3 4 2 2\n4 4\n1 -8 -1 -2\n5 4\n1 0 3 4 12\n", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5 4\n6 3 4 2 2\n4 4\n1 -8 -1 -2\n5 4\n1 0 3 5 12\n", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5 4\n6 3 4 2 2\n4 2\n1 -8 -1 -2\n5 4\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\nSolve the following coding problem using the programming language python:\n\nImplement a method that accepts ... | [{"input": "-1\n2\n3", "output": "[false]", "fn_name": "is_triangle"}, {"input": "1\n-2\n3", "output": "[false]", "fn_name": "is_triangle"}, {"input": "1\n2\n-3", "output": "[false]", "fn_name": "is_triangle"}, {"input": "7\n2\n2", "output": "[false]", "fn_name": "is_triangle"}, {"input": "1\n2\n3", "output": "[false]"... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp and his friends want to... | [{"type": "stdin_stdout", "input": "7\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n", "output": "0\n0\n0\n0\n0\n0\n0\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\nJohn is developing a system to r... | [{"input": "11.7\n63.4", "output": "[541.88]", "fn_name": "total_kilometers"}, {"input": "9.3\n87.3", "output": "[938.71]", "fn_name": "total_kilometers"}, {"input": "6.4\n54", "output": "[843.75]", "fn_name": "total_kilometers"}, {"input": "10\n60", "output": "[600]", "fn_name": "total_kilometers"}, {"input": "8\n0", ... | 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\nSolve the following coding problem using the programming language python:\n\nWrite function RemoveExclamation... | [{"input": "\"Hello World!!!\"", "output": "[\"Hello World\"]", "fn_name": "remove_exclamation_marks"}, {"input": "\"Hello World!\"", "output": "[\"Hello World\"]", "fn_name": "remove_exclamation_marks"}, {"input": "\"Hi! Hello!\"", "output": "[\"Hi Hello\"]", "fn_name": "remove_exclamation_marks"}, {"input": "\"Oh, no... | 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\nSolve the following coding problem using the programming language python:\n\nOn a weekend, Qingshan suggests ... | [{"type": "stdin_stdout", "input": "50\n3 10 13 26 31 27 22 20 9 8 33 30 12 21 16 7 17 11 6 24 14 5 19 25 29 36 37 40 41 44 45 46 47 48 49 50 43 42 39 38 35 34 32 28 23 18 15 4 2 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "50\n3 10 13 26 31 27 22 20 9 8 33 30 12 21 16 7 17 11 6 24 14 5 19 25 29 36 37 40 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 $n$ words, each of... | [{"type": "stdin_stdout", "input": "14\nwow\nthis\nis\nthe\nfirst\nmcdics\ncodeforces\nround\nhooray\ni\nam\nproud\nabout\nthat\n", "output": "3\nabout proud\nhooray round\nwow first\nthis is\ni that\nmcdics am\n"}, {"type": "stdin_stdout", "input": "14\nwow\nthis\nis\nthe\nfirst\nmcdics\ncodeforces\nround\nhooray\ni\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\nTwo coordinates (a1, a2) and (b1... | [{"type": "stdin_stdout", "input": "1226 500 1 0 107 129", "output": "14190866\n"}, {"type": "stdin_stdout", "input": "912 500 2 -1 107 239", "output": "98025026\n"}, {"type": "stdin_stdout", "input": "500 500 -1 0 107 239", "output": "68765037\n"}, {"type": "stdin_stdout", "input": "1174 500 0 0 107 298", "output": "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\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\nAdding tip to a restaurant bill ... | [{"input": "983212", "output": "[1500000]", "fn_name": "graceful_tipping"}, {"input": "1149", "output": "[1500]", "fn_name": "graceful_tipping"}, {"input": "86", "output": "[100]", "fn_name": "graceful_tipping"}, {"input": "99", "output": "[150]", "fn_name": "graceful_tipping"}, {"input": "12", "output": "[15]", "fn_na... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# A History Lesson\n\nTetris is ... | [{"input": "[2, 0, 4, 2, 2, 3, 0, 0, 3, 3]", "output": "[3300]", "fn_name": "get_score"}, {"input": "[0, 1, 1, 3, 0, 2, 1, 2]", "output": "[620]", "fn_name": "get_score"}, {"input": "[0, 1, 2, 3, 4]", "output": "[1640]", "fn_name": "get_score"}, {"input": "[0]", "output": "[0]", "fn_name": "get_score"}, {"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\nSolve the following coding problem using the programming language python:\n\nFind places where a string P is ... | [{"type": "stdin_stdout", "input": "aaaaaa\naa", "output": "0\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "aaaaab\naa", "output": "0\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "`aaaaa\naa", "output": "1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "aaabaa\naa", "output": "0\n1\n4\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\nWe know that prime numbers are p... | [{"type": "stdin_stdout", "input": "22\n1 2 3 4 5 6 7 13 14 10 12752041 64 121 144 55063932582 124 42550 23756 135153365 25235235235 42351351 81\n", "output": "NO \nNO \nNO \nYES\nNO \nNO \nNO \nNO \nNO \nNO \nYES\nNO \nYES\nNO \nNO \nNO \nNO \nNO \nNO \nNO \nNO \nNO \n"}, {"type": "stdin_stdout", "input": "22\n1 2 3 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\nSolve the following coding problem using the programming language python:\n\nCarl is a beginner magician. He ... | [{"type": "stdin_stdout", "input": "1000000 1000000 1000000\n1000000 1000000 1000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 1000000\n1000000 1000000 1000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000100 1000000 1000000\n1000000 1000000 1000000\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\nLindsey Buckingham told Stevie N... | [{"type": "stdin_stdout", "input": "2\n-3 1\n1 3 5 7 9 11\n1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "18\n1000000000000000000\n"}, {"type": "stdin_stdout", "input": "2\n-3 1\n1 3 5 7 9 11\n1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 110... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nTanya wants to go on a journey a... | [{"type": "stdin_stdout", "input": "15\n10 10 10 1 2 3 4 5 6 7 8 9 10 11 12\n", "output": "78\n"}, {"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "9\n4 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\nThere are n wizards. They are nu... | [{"type": "stdin_stdout", "input": "3 11\n0\n3\n10\n0 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "3 11\n0\n3\n18\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "3 11\n0\n3\n20\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "3 13\n1\n3\n10\n0 0", "output": "0\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\nThe crowdedness of the discotheq... | [{"type": "stdin_stdout", "input": "20\n-961747 0 961747\n-957138 0 957138\n-921232 0 921232\n-887450 0 887450\n-859109 0 859109\n-686787 0 686787\n-664613 0 664613\n-625553 0 625553\n-464803 0 464803\n-422784 0 422784\n-49107 0 49107\n-37424 0 37424\n134718 0 134718\n178903 0 178903\n304415 0 304415\n335362 0 335362\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\nSereja has a bracket sequence s_... | [{"type": "stdin_stdout", "input": "(()((((()(())((((((((()((((((()((((\n71\n15 29\n17 18\n5 26\n7 10\n16 31\n26 35\n2 30\n16 24\n2 24\n7 12\n15 18\n12 13\n25 30\n1 30\n12 13\n16 20\n6 35\n20 28\n18 23\n9 31\n12 35\n14 17\n8 16\n3 10\n12 33\n7 19\n2 33\n7 17\n21 27\n10 30\n29 32\n9 28\n18 32\n28 31\n31 33\n4 26\n15 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\nSolve the following coding problem using the programming language python:\n\nYou are given three integers A, ... | [{"type": "stdin_stdout", "input": "27 39 17\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "19 43 41\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "39 49 21\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "26 37 19\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "13 48 20\n", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Alex was creating a cont... | [{"type": "stdin_stdout", "input": "____________________________________________________________________________________________________\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "__________________________________________________________________________________________________`_\n", "output": "NO\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 array $a_1, a_2, \... | [{"type": "stdin_stdout", "input": "101\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "101\n"}, {"type": "stdin_stdout", "input": "101\n2 2 2 2 2 2 2... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.