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\nA newspaper is published in Walr... | [{"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\naaghjagjchjieibbcjacjhbdfcbdgjaaagjgjbihjbjdfbf\n", "output": "10\n"}, {"type": "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\nGhosts live in harmony and peace... | [{"type": "stdin_stdout", "input": "10 7 -626288749\n795312099 49439844 266151109\n-1357052512 23740808 624973405\n-513221420 -44452680 -391096559\n-350963348 -5068756 -160670209\n690883790 11897718 3356227\n-509035268 -76541374 -210137445\n-121282138 -32581578 230716703\n491731655 9500548 -13423963\n-665038289 4817024... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 vector \\vec{v} = (x, y), ... | [{"type": "stdin_stdout", "input": "9\n1000000 0\n0 -999999\n600000 600000\n600000 600000\n600000 600000\n-600000 -600000\n600000 600000\n600000 600000\n-700000 710000\n", "output": "-1 -1 -1 -1 1 -1 -1 1 -1 "}, {"type": "stdin_stdout", "input": "9\n1000000 0\n0 -999999\n600000 600000\n600000 600000\n600000 171765\n-60... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nBajirao's city has N X N police ... | [{"type": "stdin_stdout", "input": "3\n-1 -1 13\n-2 -4 9\n3 -12 -1\n\nESARLN", "output": "25\n"}, {"type": "stdin_stdout", "input": "3\n-2 -2 18\n-2 0 13\n0 -13 -1\n\nASERLN", "output": "31\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 13\n-1 -4 12\n3 -12 -1\n\nESARMN", "output": "28\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\nDescription:\nName string is a s... | [{"type": "stdin_stdout", "input": "21\n0 0 0\n3 -1 0\n5 1 2\n7 12 4\n0 0 0\n0 2 0\n1 1 0\n50 67 56\n4 10 12\n11 10 20\n30 21 30\n3 7 1\n29 14 15\n39 29 34\n5 10 10\n41 12 41\n50 50 1\n50 50 49\n2 3 3\n0 0 68\n1000000 1000000 1010000", "output": "0\n1\n5\n15\n0\n1\n2\n113\n21\n23\n60\n7\n31\n69\n20\n82\n100\n100\n6\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\nFatal Eagle has finally teamed u... | [{"type": "stdin_stdout", "input": "6\n32 188 2 109 25 61", "output": "10395 417\nWe will win!\n"}, {"type": "stdin_stdout", "input": "6\n32 362 2 109 25 61", "output": "10395 591\nWe will win!\n"}, {"type": "stdin_stdout", "input": "6\n32 142 0 132 25 61", "output": "11340 392\nWe will win!\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\nGiven is a number sequence A of ... | [{"type": "stdin_stdout", "input": "10\n33 4 45 28 15 19 123 86 2 4", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n33 18 45 28 8 19 89 86 2 7", "output": "6\n"}, {"type": "stdin_stdout", "input": "10\n33 4 45 28 15 19 89 86 2 4", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n33 2 26 28 13 19 89 8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are an immigration officer i... | [{"type": "stdin_stdout", "input": "5\n-1 -1 1 1 321", "output": "APPROVED\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 1 1 337", "output": "APPROVED\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 1 1 200", "output": "APPROVED\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 1 1 385", "output": "APPROVED\n"}, {"t... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a digit sequence S of l... | [{"type": "stdin_stdout", "input": "1211", "output": "AMBIGUOUS\n"}, {"type": "stdin_stdout", "input": "1204", "output": "AMBIGUOUS\n"}, {"type": "stdin_stdout", "input": "0112", "output": "AMBIGUOUS"}, {"type": "stdin_stdout", "input": "2206", "output": "YYMM\n"}, {"type": "stdin_stdout", "input": "1291", "output": "M... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 grid with H horizonta... | [{"type": "stdin_stdout", "input": "100000 100000 1\n50000 23836", "output": "920202332\n"}, {"type": "stdin_stdout", "input": "100000 100000 1\n50000 25003", "output": "717307015\n"}, {"type": "stdin_stdout", "input": "100000 100000 1\n50000 29731", "output": "587968146\n"}, {"type": "stdin_stdout", "input": "100000 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\nTakahashi has two positive integ... | [{"type": "stdin_stdout", "input": "100000", "output": "10"}, {"type": "stdin_stdout", "input": "1697", "output": "23\n"}, {"type": "stdin_stdout", "input": "199", "output": "19\n"}, {"type": "stdin_stdout", "input": "178", "output": "16\n"}, {"type": "stdin_stdout", "input": "389", "output": "20\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\nA robot is put at the origin in ... | [{"type": "stdin_stdout", "input": "FTFFTFFF\n-2 -2", "output": "Yes"}, {"type": "stdin_stdout", "input": "FTFFTFFF\n-2 -3", "output": "No\n"}, {"type": "stdin_stdout", "input": "FTFFTFFF\n-2 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "FTFFTFFF\n-1 -1", "output": "No\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 boxes arranged in a ... | [{"type": "stdin_stdout", "input": "5\n12 26 12 10 8", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5\n6 11 12 10 8", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5\n6 16 12 10 8", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5\n6 26 12 10 8", "output": "NO\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is data that records the c... | [{"type": "stdin_stdout", "input": "123,10\n56,12\n35,14\n\n123,3\n56,4\n123,5", "output": "56 2\n123 3\n"}, {"type": "stdin_stdout", "input": "123,10\n56,12\n45,13\n\n113,4\n56,4\n123,5", "output": "56 2\n123 2\n"}, {"type": "stdin_stdout", "input": "123,10\n57,12\n35,14\n\n123,3\n57,4\n123,5", "output": "57 2\n123 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 greatest common divisor is a... | [{"type": "stdin_stdout", "input": "1251 5715\n10 10\n0 0", "output": "9 6\n10 1\n"}, {"type": "stdin_stdout", "input": "1251 3144\n10 10\n0 0", "output": "3 6\n10 1\n"}, {"type": "stdin_stdout", "input": "1893 2905\n10 6\n0 0", "output": "1 11\n2 3\n"}, {"type": "stdin_stdout", "input": "1893 2905\n11 6\n0 0", "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\nThere is a rectangular room, cov... | [{"type": "stdin_stdout", "input": "6 9\n....#.\n.....#\n./....\n......\n......\n......\n./....\n#@...#\n.#..#.\n11 9\n.#.........\n.#.#######.\n.#.#.....#.\n.#.#.###.#.\n.#.#..@#.#.\n.#.#####.#.\n.#......-#.\n.#########.\n...........\n11 6\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\nTraining is indispensable for ac... | [{"type": "stdin_stdout", "input": "2 3 100 20\nvim 10 10\nemacs 5 10\nvstudio 65 100\n2 1 6\nemacs 4\nvstudio 13\n3 -3 -1\nvim 5\nemacs 9\nvstudio 62", "output": "129\n"}, {"type": "stdin_stdout", "input": "2 3 100 10\nvim 10 10\nemacs 5 18\nvstudio 65 100\n2 1 6\nemacs 4\nvstudio 13\n3 -3 0\nvim 5\nemacs 9\nvstudio 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 playing a game called Gu... | [{"type": "stdin_stdout", "input": "RRLRRLRRRRLRRLRRRRLRRLRRRRLRRLRR", "output": "4"}, {"type": "stdin_stdout", "input": "RLLRRLLLRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRRLLMRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRLLLLRRRLLLRRR", "output": "0"}, {"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 priority queue is a data struc... | [{"type": "stdin_stdout", "input": "insert 8\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "8\n12\n11\n-1\n"}, {"type": "stdin_stdout", "input": "insert 9\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "9\n12\n11\n-1\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\nQueue is a container of elements... | [{"type": "stdin_stdout", "input": "3 24\n0 2 1\n0 0 2\n0 0 5\n0 2 6\n0 0 4\n2 0\n1 2\n2 0\n1 0", "output": "1\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n"}, {"type": "stdin_stdout", "input": "3 24\n0 2 1\n0 0 2\n0 0 5\n0 2 9\n0 0 4\n2 0\n1 0\n2 0\n1 0", "output": "5\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\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 rectangles in a row.... | [{"type": "stdin_stdout", "input": "10\n706794178 103578427\n431808055 641644550\n715688799 406274173\n767234853 345348548\n241724251 408945969\n808703176 213953908\n185314264 16672343\n1017427585 152702033\n105991807 76314740\n61409204 244301685\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10\n706794178 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nAll bus tickets in Berland have ... | [{"type": "stdin_stdout", "input": "200000 10\n3 6 0 5 7 4 2 1 8 9\n", "output": "712861856\n"}, {"type": "stdin_stdout", "input": "199998 10\n3 4 9 2 5 0 6 1 7 8\n", "output": "251145888\n"}, {"type": "stdin_stdout", "input": "199998 10\n3 7 9 5 2 6 1 8 0 4\n", "output": "251145888\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\nPolycarp wants to cook a soup. T... | [{"type": "stdin_stdout", "input": "4\n10 1 3\n7 5 2\n1 1000 1\n1000000000000 42 88\n", "output": "10\n11\n1000\n42000000000000\n"}, {"type": "stdin_stdout", "input": "4\n10 1 3\n7 3 2\n1 1000 1\n1000000000000 42 88\n", "output": "10\n9\n1000\n42000000000000\n"}, {"type": "stdin_stdout", "input": "4\n10 1 3\n7 5 2\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\nYou are given an array a consist... | [{"type": "stdin_stdout", "input": "69\n1 1 1 1 0 0 1 0 0 1 1 1 2 1 0 1 0 2 1 1 1 0 0 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 0 2 1 1 1 0 1 1 2 1 2 1 1 1 0 2 1 0 0 1 1 1 1 0 1 1 1 0 1 1 2\n", "output": "24\n1 5 4\n1 6 5\n1 8 7\n1 9 8\n2 13 12\n1 15 14\n1 17 16\n2 18 17\n1 22 21\n1 23 22\n2 25 24\n2 37 36\n1 39 38\n2 40 39\n1 44 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 call (yet again) a string ... | [{"type": "stdin_stdout", "input": "100\nababbaaabaaabaabbabbaaabbabaaabbbabbbbbbbbababbbbbabbaaaabbbabbaababaabaababbbabababbbababbbbaabbbba\n", "output": "34\nababbaabababbabaabbabaabbababababaabbabaabababababbabababababaabba\n"}, {"type": "stdin_stdout", "input": "100\nabbbbaabbbbababbbabababbbabaabaababaabbabbbaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Cybermen solved that first t... | [{"type": "stdin_stdout", "input": "5 0\n2 1\n-2 -1\n-1 1\n-2 -2\n2 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 1\n1 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 1\n2 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 1\n2 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\nYou are given a string t and n s... | [{"type": "stdin_stdout", "input": "abacabadabacaba\n22\na\nb\nc\nd\naba\naca\nabacabadabacaba\naa\ndab\nac\nca\nba\nab\nad\nda\nabacaba\nabacaba\nabacabad\nabacabad\ndabacaba\ndabacaba\nabacabadabacabaa\n", "output": "108\n"}, {"type": "stdin_stdout", "input": "abacabadabacaba\n22\na\nb\nc\nd\naba\nacb\nabacabadabacab... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence a_1, a_... | [{"type": "stdin_stdout", "input": "100 1186\n619 240 80 547 446 128 43 285 725 220 56 690 770 431 777 5 41 549 405 203 2 477 919 481 453 787 680 326 318 241 942 497 504 324 598 925 346 628 851 38 355 493 748 685 901 63 698 676 154 162 313 964 455 617 381 41 479 746 83 253 164 907 950 918 264 307 980 743 257 322 845 41... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 segments on a Ox axi... | [{"type": "stdin_stdout", "input": "4\n2\n-1000000000 1000000000\n-1000000000 1000000000\n2\n-1000000000 -1\n0 1000000000\n2\n-1000000000 -1\n1 1000000000\n2\n-1000000000 1\n-1 1000000000\n", "output": "1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "4\n2\n-1000000000 1000000000\n-1000000000 1000000000\n2\n-10000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nDreamoon likes sequences very mu... | [{"type": "stdin_stdout", "input": "10\n1 1000000000\n2 999999999\n3 39238314\n2 14233839\n3 1308869\n6 99995\n13 14099\n8 474\n9 146\n10 2\n", "output": "1\n3\n5\n3\n5\n23\n209\n59\n89\n1\n"}, {"type": "stdin_stdout", "input": "10\n1 1000000000\n2 999999999\n3 99999998\n4 9999997\n5 999996\n6 99995\n7 9994\n12 993\n15... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nSlime has a sequence of positive... | [{"type": "stdin_stdout", "input": "5\n5 3\n1 5 2 6 1\n1 6\n6\n3 2\n1 2 3\n4 3\n3 1 2 3\n10 3\n1 2 3 4 5 6 7 8 9 10\n", "output": "no\nyes\nyes\nno\nyes\n"}, {"type": "stdin_stdout", "input": "5\n5 3\n1 5 2 6 1\n1 6\n6\n3 2\n1 2 3\n4 3\n3 1 2 3\n10 3\n1 2 3 4 8 6 7 8 9 10\n", "output": "no\nyes\nyes\nno\nyes\n"}, {"typ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nLee is used to finish his storie... | [{"type": "stdin_stdout", "input": "6\n216986951114298167 235031205335543871\n148302405431848579 455670351549314242\n506251128322958430 575521452907339082\n1 648430128412383765\n189336074809158272 1455231353527037415\n256976506735255726 632385375031134277\n", "output": "1 1\n"}, {"type": "stdin_stdout", "input": "6\n21... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a simple and connected ... | [{"type": "stdin_stdout", "input": "4\n6 5\n1 4\n2 5\n3 6\n1 5\n3 5\n6 5\n1 4\n2 5\n3 6\n1 5\n3 5\n12 14\n1 2\n2 3\n3 4\n4 1\n1 5\n1 12\n2 6\n2 7\n3 8\n3 9\n4 10\n4 11\n2 4\n1 3\n12 14\n1 2\n2 3\n3 4\n4 1\n1 5\n1 12\n2 6\n2 7\n3 8\n6 9\n4 10\n4 11\n2 4\n1 3\n", "output": "PATH\n4\n6 3 5 1 \nPATH\n4\n6 3 5 1 \nPAIRING\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 is a building consisting o... | [{"type": "stdin_stdout", "input": "36\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n9999\n", "output": "90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90\n90... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 great hero guards the countr... | [{"type": "stdin_stdout", "input": "10\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\n1 1000000000 1\n1\n1000000000\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\nLittle Dormi received a histogra... | [{"type": "stdin_stdout", "input": "2\n4\n0 16 14 1\n6\n2 1 14 4 0 0\n", "output": "30\n19\n"}, {"type": "stdin_stdout", "input": "2\n4\n0 16 17 1\n6\n2 1 14 4 0 0\n", "output": "33\n19\n"}, {"type": "stdin_stdout", "input": "2\n4\n13 8 15 13\n6\n2 1 7 8 1 0\n", "output": "33\n16\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\nStudents of group 199 have writt... | [{"type": "stdin_stdout", "input": "10\n9 10 6 8 5 3 1 7 4 2\n7 6 2 9 5 10 8 4 1 3\n", "output": "8 3 10 1 5 2 4 9 7 6 "}, {"type": "stdin_stdout", "input": "10\n2 9 1 7 6 8 5 4 10 3\n6 8 5 1 9 10 2 3 4 7\n", "output": "5 6 7 3 2 9 1 10 8 4 "}, {"type": "stdin_stdout", "input": "10\n5 9 7 1 4 10 3 6 2 8\n8 3 9 10 6 5 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\nThe Little Elephant loves to pla... | [{"type": "stdin_stdout", "input": "100\n1 2\n2 1\n2 1\n1 2\n1 1\n1 2\n2 1\n1 1\n2 2\n2 1\n2 1\n1 1\n1 1\n2 1\n2 1\n2 1\n2 1\n2 1\n1 1\n2 1\n1 1\n1 1\n2 2\n1 2\n1 2\n1 2\n2 2\n1 2\n1 2\n2 1\n1 2\n2 1\n1 2\n2 2\n1 1\n2 1\n1 2\n2 1\n2 1\n1 2\n2 1\n2 1\n1 2\n2 1\n1 1\n1 2\n1 1\n1 1\n2 2\n2 2\n2 1\n2 1\n1 2\n2 2\n1 1\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\nLittle Petya likes permutations ... | [{"type": "stdin_stdout", "input": "55 28\n35 33 46 8 11 13 14 26 42 38 1 7 34 5 2 21 17 45 54 43 4 18 27 50 25 10 29 48 6 16 22 28 55 53 49 41 39 23 40 47 51 37 36 19 9 32 52 12 24 3 20 15 30 44 31\n5 52 24 16 7 27 48 21 18 8 14 28 29 12 47 53 17 31 54 41 30 55 10 35 25 4 38 46 23 34 33 3 15 6 11 20 9 26 42 37 43 45 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\nThere is a square matrix n Γ n, ... | [{"type": "stdin_stdout", "input": "10\n10 8 6 5 9 8 2 5 3 2\n3 1 8 10 8 10 5 10 7 8\n5 9 7 7 4 9 7 2 5 2\n5 9 9 5 4 2 6 6 8 1\n10 6 9 9 10 5 6 3 5 9\n6 7 10 3 1 4 3 6 7 6\n10 10 4 7 4 4 8 2 7 4\n10 5 8 2 2 7 4 4 1 4\n8 4 6 10 10 6 1 3 3 1\n9 9 7 2 11 5 1 8 6 3\n", "output": "1\nDRDDDRRDDDRRDRDRRR\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\nDaniel is organizing a football ... | [{"type": "stdin_stdout", "input": "288230376151711743\n", "output": "144115188344291328\n288230376151711744\n"}, {"type": "stdin_stdout", "input": "72057594037927935\n", "output": "36028797153181696\n72057594037927936\n"}, {"type": "stdin_stdout", "input": "1125899906842623\n", "output": "562949970198528\n112589990684... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 system of n vessels a... | [{"type": "stdin_stdout", "input": "50\n57 122 98 44 22 63 5 65 36 69 49 54 61 15 58 79 50 30 43 155 18 105 46 92 72 67 67 51 34 40 50 77 91 53 79 72 72 34 91 75 83 67 71 93 11 51 85 20 6 2\n20\n2 40\n1 14 102\n2 4\n2 15\n2 43\n1 29 532\n2 27\n2 47\n1 24 107\n1 20 720\n1 21 315\n2 20\n1 2 787\n1 27 909\n2 38\n1 32 445\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 likes word \"nineteen\" ve... | [{"type": "stdin_stdout", "input": "nnnnnnnnnneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiitttttttttttttttttttt\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "nnnnnnnnnneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiitttttttttttttttttttt\n", "output": "4\n"}, {"t... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nSergey is testing a next-generat... | [{"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\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\nNura wants to buy k gadgets. She... | [{"type": "stdin_stdout", "input": "1 93 46 46\n1\n1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\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\nThe numbers of all offices in th... | [{"type": "stdin_stdout", "input": "55\n", "output": "72057594037927934\n"}, {"type": "stdin_stdout", "input": "54\n", "output": "36028797018963966\n"}, {"type": "stdin_stdout", "input": "49\n", "output": "1125899906842622\n"}, {"type": "stdin_stdout", "input": "43\n", "output": "17592186044414\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\nA simple recommendation system w... | [{"type": "stdin_stdout", "input": "10 10 10\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\nYYYYYYYYYY\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 10 1\nNNNNNNNNNN\nNNNNNNNNNN\nNNNNNNNNNN\nNNNNNNNNNN\nNNNNNNNNNN\nNNNNNNNNNN\nNNNNNNNNNN\nNNNN... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 cities in Bearland, ... | [{"type": "stdin_stdout", "input": "100 100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "100"}, {"type": "stdin_stdout", "input": "100 100\n1 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\nMishka is a little polar bear. A... | [{"type": "stdin_stdout", "input": "100\n4 3\n3 4\n5 1\n2 5\n5 3\n1 5\n6 3\n2 4\n5 2\n2 6\n5 2\n1 5\n6 3\n1 5\n6 3\n3 4\n5 2\n1 5\n6 1\n1 5\n4 2\n3 5\n6 3\n2 6\n6 3\n1 4\n6 2\n3 4\n4 1\n3 6\n5 1\n2 4\n5 1\n3 4\n6 2\n3 5\n4 1\n2 6\n4 3\n2 6\n5 2\n3 6\n6 2\n3 5\n4 3\n1 5\n5 3\n3 6\n4 2\n3 4\n6 1\n3 4\n5 2\n2 6\n5 2\n2 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\nIn a new version of the famous P... | [{"type": "stdin_stdout", "input": "100\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", "output": "100"}, {"type": "stdin_stdout", "input": "100\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\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\nBitwise exclusive OR (or bitwise... | [{"type": "stdin_stdout", "input": "9992164445234764941\n8162963574901971597\n", "output": "914600435166396672 9077564010068368269"}, {"type": "stdin_stdout", "input": "1367480970723947\n584615739735395\n", "output": "391432615494276 976048355229671"}, {"type": "stdin_stdout", "input": "339671107814\n208405902980\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 robber has attempted to rob a ... | [{"type": "stdin_stdout", "input": "8 3 13\n12\n3 3 3 12 7 6 10 1 8 8 7 12\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 3 13\n12\n3 3 3 8 7 6 10 1 8 8 7 12\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 5 13\n12\n3 3 3 8 7 6 10 1 7 8 7 11\n", "output": "8\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\nBeroffice text editor has a wide... | [{"type": "stdin_stdout", "input": "bababcdfabbcabcdfacbbabcdfacacabcdfacbcabcdfaccbabcdfacaaabcdfabacabcdfabcbabcdfacbaabcdfabaaabcdfabbaabcdfacababcdfabbbabcdfabcaabcdfaaababcdfabccabcdfacccabcdfaacbabcdfaabaabcdfaabcabcdfaaacabcdfaccaabcdfaabbabcdfaaaaabcdfaacaabcdfaacc\n", "output": "bababc dfabb cabc dfacb babc df... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 points ... | [{"type": "stdin_stdout", "input": "50\n-38 -107\n-34 -75\n-200 -143\n-222 -139\n-34 55\n-102 -79\n48 -99\n2 -237\n-118 -167\n-56 -41\n10 17\n68 -89\n-32 41\n-100 -93\n84 -1\n86 -15\n46 -145\n-101 -117\n8 31\n-36 -61\n-12 21\n-116 79\n88 -205\n70 -103\n-78 -37\n106 -5\n-96 -201\n-60 -103\n-54 45\n-138 -177\n-178 -47\n-... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 unrest in the Galactic ... | [{"type": "stdin_stdout", "input": "100 100\n52 93 36 69 49 37 48 42 63 27 16 60 16 63 80 37 69 24 86 38 73 15 43 65 49 35 39 98 91 24 20 35 12 40 75 32 54 4 76 22 23 7 50 86 41 9 9 91 23 18 41 61 47 66 1 79 49 21 99 29 87 94 42 55 87 21 60 67 36 89 40 71 6 63 65 88 17 12 89 32 79 99 34 30 63 33 53 56 10 11 66 80 73 50... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 m = nΒ·k wooden staves. ... | [{"type": "stdin_stdout", "input": "10 3 726\n277 706 1241 812 692 1291 196 507 911 111 498 704 573 381 463 1095 704 36 443 640 326 405 47 834 962 521 1296 740 520 622\n", "output": "5072\n"}, {"type": "stdin_stdout", "input": "10 3 726\n277 706 1241 812 692 1291 196 507 911 111 498 704 573 381 463 1095 704 36 693 640 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nThose of you who are familiar wi... | [{"type": "stdin_stdout", "input": "10\n227 147\n36 22\n110 62\n9\n143 19\n34 4\n84 13\n9\n556 63\n21 57\n94 25\n4\n398 205\n172 177\n127 195\n4\n240 153\n111 114\n207 85\n7\n203 42\n89 3\n107 32\n4\n132 167\n103 22\n102 140\n5\n115 7\n111 5\n56 1\n7\n116 108\n41 37\n40 30\n1\n136 81\n112 37\n49 23\n2", "output": "1026... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nExams are over !! Everyone is no... | [{"type": "stdin_stdout", "input": "998\n2 -7299 -1104 5841 7780\n8 4665 -7637 8967 -4124\n2 9223 789 -7690 4412\n4 116 -9319 -6946 -5438\n4 4417 3824 -2120 -90\n2 -9912 1820 -9527 6254\n6 1466 1097 1912 -2611\n4 -9462 7771 1177 6218\n8 8290 9152 -1317 -2873\n3 -5267 -1353 3365 -2413\n5 9661 -2020 -4846 -456\n7 -5160 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\nHansa did not have enough money ... | [{"type": "stdin_stdout", "input": "2\n-1 -2 -1\n-2 2 12\n\nLBMMES", "output": "NO BILL\nNO BILL\n"}, {"type": "stdin_stdout", "input": "2\n-1 -2 -1\n-2 0 12\n\nLBMMES", "output": "NO BILL\nNO BILL\n"}, {"type": "stdin_stdout", "input": "2\n-1 -2 -1\n-2 0 12\n\nLBMNES", "output": "NO BILL\nNO BILL\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\nTakahashi loves takoyaki - a bal... | [{"type": "stdin_stdout", "input": "1000 1 1100", "output": "1100000\n"}, {"type": "stdin_stdout", "input": "1010 1 1100", "output": "1111000\n"}, {"type": "stdin_stdout", "input": "1011 1 1100", "output": "1112100\n"}, {"type": "stdin_stdout", "input": "1001 1 1000", "output": "1001000\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA company has N members, who are... | [{"type": "stdin_stdout", "input": "10\n1 1 1 1 1 2 1 1 1", "output": "8\n1\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 2 1 2 1 1 1", "output": "7\n2\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 2 1 2 1 1 2", "output": "6\n3\n0\n0\n0\n0\n0\n0\n0\n0\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\nTakahashi loves palindromes. Non... | [{"type": "stdin_stdout", "input": "redocder", "output": "1\n"}, {"type": "stdin_stdout", "input": "rdebrdeo", "output": "4\n"}, {"type": "stdin_stdout", "input": "reeocddr", "output": "3\n"}, {"type": "stdin_stdout", "input": "rddcoeer", "output": "3\n"}, {"type": "stdin_stdout", "input": "rddboeer", "output": "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\nYou are given a string S as inpu... | [{"type": "stdin_stdout", "input": "2019/03/30", "output": "Heisei\n"}, {"type": "stdin_stdout", "input": "2019/04/20", "output": "Heisei\n"}, {"type": "stdin_stdout", "input": "1019/04/30", "output": "Heisei\n"}, {"type": "stdin_stdout", "input": "2019/01/00", "output": "Heisei\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\nYou are given an undirected grap... | [{"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 11\n11 2\n13 13\n11 9\n4 1\n9 7\n9 6\n8 13\n8 6\n4 10\n8 7\n4 3\n2 1\n8 12\n6 9", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 12\n11 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn a two-dimensional plane, ther... | [{"type": "stdin_stdout", "input": "5\n0 0\n4 1\n5 5\n6 6\n13 11\n2 2\n6 3\n-1 4\n8 4\n14 17", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n0 0\n4 1\n5 5\n6 6\n13 11\n2 2\n6 3\n-1 4\n8 4\n9 17", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n0 0\n4 1\n5 5\n6 6\n13 11\n2 2\n8 3\n-1 4\n14 4\n9 4", "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\nThere is a tree with N vertices ... | [{"type": "stdin_stdout", "input": "6\n1 2\n3 5\n4 6\n1 6\n0 2\n5 3\n1 4\n2 6\n12 3\n5 6", "output": "NO\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n3 5\n4 6\n1 6\n5 2\n5 3\n1 4\n2 6\n4 3\n5 6", "output": "NO\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n3 1\n4 6\n1 6\n5 1\n5 3\n1 4\n2 6\n4 3\n5 6", "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\nSnuke got a present from his mot... | [{"type": "stdin_stdout", "input": "107 11\n0 1 3 3 5 10 13 1 7 17", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "107 11\n0 1 3 3 5 12 13 1 7 17", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "107 10\n0 2 3 5 5 6 7 12 9 10", "output": "Impossible\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\nTaro is not good at hide-and-see... | [{"type": "stdin_stdout", "input": "3\n6 6 3\n19 19 6\n42 10 1\n6\n5 2 2 11\n12 7 2 11\n11 9 1 11\n14 2 22 5\n17 9 20 5\n20 10 20 5\n0", "output": "Safe\nDanger\nDanger\nDanger\nDanger\nDanger\n"}, {"type": "stdin_stdout", "input": "3\n6 2 16\n40 7 8\n42 8 1\n6\n5 3 4 11\n12 4 2 15\n16 2 0 11\n28 2 31 5\n17 9 41 5\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\nThe following sorting operation ... | [{"type": "stdin_stdout", "input": "6\n1 4 1 3 2 4\n5\n1 2 5 4 5\n10\n1 1 1 1 1 1 1 1 1 1\n9\n1 1 1 1 1 1 1 1 1\n12\n1 4 1 3 2 4 3 3 2 1 2 2\n1\n5050\n3\n10000 10000 100\n0", "output": "24\n-1\n10\n-1\n48\n5049\n-1\n"}, {"type": "stdin_stdout", "input": "6\n1 4 1 3 2 4\n5\n1 2 5 4 5\n10\n1 1 1 1 1 1 1 1 1 1\n9\n1 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\nproblem\n\nThere are n islands i... | [{"type": "stdin_stdout", "input": "3 8\n1 3 1 10\n0 2 3\n1 2 3 20\n1 1 2 5\n0 3 2\n1 1 3 7\n1 2 1 9\n0 2 3\n5 16\n1 1 3 343750\n1 1 3 3343\n1 1 4 347392\n1 2 5 5497\n1 2 3 123394\n1 2 4 545492\n1 2 5 458\n1 3 4 343983\n1 3 5 843468\n1 4 5 2780\n0 2 1\n0 4 1\n0 3 2\n0 4 2\n0 4 3\n0 5 3\n0 0", "output": "-1\n15\n12\n126... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nSaying that it is not surprising... | [{"type": "stdin_stdout", "input": "3\n800 600\nindxe 1\n443 100 700 200 profile\nprofile 2\n100 100 400 200 index\n000 742 400 500 link\nlink 1\n100 100 300 200 index\n9\nclick 600 150\nshow\nclick 200 450\nshow\nback\nback\nshow\nforward\nshow\n0", "output": "profile\nprofile\nindxe\nprofile\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\nThere are a number of rectangles... | [{"type": "stdin_stdout", "input": "3\n4 28 27 17\n15 20 42 5\n19 24 33 14\n5\n4 44 27 11\n12 11 34 2\n7 26 14 16\n14 16 19 12\n17 28 50 21\n2\n322297 1000000 828907 0\n-1 1164792 1000000 300000\n0", "output": "8\n7\n4\n"}, {"type": "stdin_stdout", "input": "3\n4 28 27 17\n15 20 21 5\n19 42 33 14\n5\n4 28 27 11\n12 11 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nThere is an arithmeti... | [{"type": "stdin_stdout", "input": "6\n10 -1\n0\n24 -1 1\n0 4 1\n-2 -2 0\n1 1 1\n1", "output": "-13\n"}, {"type": "stdin_stdout", "input": "6\n19 -1\n0\n24 -1 1\n0 4 1\n-2 -1 0\n0 1 1\n1", "output": "-4\n"}, {"type": "stdin_stdout", "input": "6\n3 -1\n0\n30 -2 1\n0 2 1\n-1 1 1\n-2 2 0\n2", "output": "-26\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\nEnglish text is not available in... | [{"type": "stdin_stdout", "input": "6\n-2 -1 1 1\n2 2 4 1\n5 7 1 1\n8 0 3 1\n13 4 1 1\n16 1 0 2\n3\n-1 0 2 1\n10 0 2 2\n0 10 4 1\n3\n0 0 2 1\n10 0 2 1\n1 11 2 1\n3\n0 0 2 1\n10 0 2 1\n-1 4 2 1\n1\n0 0 1 1\n0", "output": "5\n2\n2\n3\n1\n"}, {"type": "stdin_stdout", "input": "6\n-2 -1 1 1\n2 2 4 1\n5 7 1 0\n8 0 3 1\n16 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\nExample\n\nInput\n\nmmemewwemeww... | [{"type": "stdin_stdout", "input": "mmemwweemeww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "wwemeewwmemm", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "mmemwweeneww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "mnemwweeneww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nIn Ikatta, the SNS us... | [{"type": "stdin_stdout", "input": "0 13\n-1\n3\n3\n-1\n1\n14", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 13\n-1\n-1\n0\n3\n7\n0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 13\n-1\n-1\n0\n3\n7\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 13\n-1\n-2\n0\n3\n7\n1", "output": "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\nProblem statement\n\nI have a gr... | [{"type": "stdin_stdout", "input": "3 3\n1820\n4#2\n1007", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1 13\n1558\n2$4\n246", "output": "NO\n"}, {"type": "stdin_stdout", "input": "3 3\n631\n4#2\n486", "output": "YES\n"}, {"type": "stdin_stdout", "input": "3 3\n631\n4#2\n246", "output": "YES\n"}, {"type": "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\nFind bridges of an undirected gr... | [{"type": "stdin_stdout", "input": "5 4\n0 1\n1 2\n1 3\n3 4", "output": "0 1\n1 2\n1 3\n3 4\n"}, {"type": "stdin_stdout", "input": "5 4\n0 1\n1 3\n2 3\n3 4", "output": "0 1\n1 3\n2 3\n3 4\n"}, {"type": "stdin_stdout", "input": "5 4\n0 1\n0 2\n2 3\n3 4", "output": "0 1\n0 2\n2 3\n3 4\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\nYou are given n integers a_1, a_... | [{"type": "stdin_stdout", "input": "10\n2 1000013759 1000012847\n2 1000010197 1000008649\n2 1000014583 1000000933\n2 1000001021 1000010233\n2 1000005763 1000012927\n2 1000013759 1000003471\n2 1000008829 1000012219\n2 1000012847 1000008397\n2 1000011011 1736428976\n2 1000007909 1000010549\n", "output": "102400\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\nArkady and his friends love play... | [{"type": "stdin_stdout", "input": "1100000000 1000\n", "output": "4114000000000000\n"}, {"type": "stdin_stdout", "input": "1000010000 1\n", "output": "1000020000100000000\n"}, {"type": "stdin_stdout", "input": "1100010000 1000\n", "output": "4114074800340000\n"}, {"type": "stdin_stdout", "input": "1010010000 1\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\nAndrey received a postcard from ... | [{"type": "stdin_stdout", "input": "uduzhzchjkaddukfwqngffblohjmqbgyfrzomuznircygatbxoyfxflurhoewioptyqlpoozlksyxrntwsqozghcamszlgeawisninpntpwpuemybjwmhwmpqkurkrnjzfoppmoopwrmpylvhtntghxkavveeyfmdqsvuqiflyemklnshfrtskmyhkbzhwmlaqcasjbw\n200\n", "output": "uduzhzchjkaddukfwqngffblohjmqbgyfrzomuznircygatbxoyfxflurhoewio... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nVus the Cossack has two binary s... | [{"type": "stdin_stdout", "input": "10010110100000101100\n11001\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n10011\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n00010\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n0101... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Ivan the Fool decided t... | [{"type": "stdin_stdout", "input": "100000 100000\n", "output": "870472905"}, {"type": "stdin_stdout", "input": "28151 100000\n", "output": "422317846\n"}, {"type": "stdin_stdout", "input": "100000 99999\n", "output": "758107445"}, {"type": "stdin_stdout", "input": "24538 86821\n", "output": "1000000005"}, {"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\nTry guessing the statement from ... | [{"type": "stdin_stdout", "input": "3\n1 14\n4 2\n191 102469002\n", "output": "1\n0\n1528\n"}, {"type": "stdin_stdout", "input": "3\n1 14\n4 2\n131 176163142\n", "output": "1\n0\n1048\n"}, {"type": "stdin_stdout", "input": "3\n1 14\n4 2\n142 128000654\n", "output": "1\n0\n1136\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\n<image>\n\nInput\n\nThe input co... | [{"type": "stdin_stdout", "input": "27 36\n", "output": "OUT\n"}, {"type": "stdin_stdout", "input": "0 45\n", "output": "OUT\n"}, {"type": "stdin_stdout", "input": "53 27\n", "output": "IN\n"}, {"type": "stdin_stdout", "input": "0 18\n", "output": "OUT\n"}, {"type": "stdin_stdout", "input": "51 1\n", "output": "OUT\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\nSkier rides on a snowy field. It... | [{"type": "stdin_stdout", "input": "1\nENNNNNNNNNNNSSSSSSSSSSSEEEEEEEEEEN\n", "output": "126\n"}, {"type": "stdin_stdout", "input": "1\nNEEEEEEEEEEEWWWWWWWWWWWNNNNNNNNNNE\n", "output": "126\n"}, {"type": "stdin_stdout", "input": "1\nENNNNNNNNNNNSSSSSSSNSSSEEEEEEEEEES\n", "output": "126\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\nThis is the easy version of the ... | [{"type": "stdin_stdout", "input": "123 79\n49 100 128 149 148 22 89 81 46 142 119 70 22 134 134 80 69 145 144 33 28 127 70 27 91 94 98 29 153 53 102 138 113 123 135 143 87 77 84 27 106 8 156 27 97 150 53 31 126 135 40 79 150 79 69 7 3 49 84 14 24 39 13 103 54 98 122 95 71 157 79 114 136 101 38 25 150 103 150 158 109 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\nYou are given an array a consist... | [{"type": "stdin_stdout", "input": "100\n79 79 79 97 97 97 64 64 64 2 2 2 38 38 38 65 65 65 10 10 10 25 24 25 53 53 53 73 73 73 11 11 11 29 29 29 93 93 93 73 73 73 89 89 89 72 72 72 49 49 49 78 78 78 92 92 92 90 90 90 95 95 95 92 92 92 12 12 12 65 65 65 81 81 81 5 5 5 21 21 21 94 94 94 51 51 51 44 44 44 55 55 55 47 47 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nMike received an array a of leng... | [{"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n9\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n3\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is playing a new comput... | [{"type": "stdin_stdout", "input": "1\n52\n1 3 3 4 5 10 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 48 29 30 31 32 49 34 35 36 37 38 39 40 41 42 43 21 45 46 47 48 49 50 51 52\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n52\n1 3 3 4 5 10 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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\nAs you very well know, the whole... | [{"type": "stdin_stdout", "input": "1000\n1000 1000 1000\n", "output": "333.33333443989454 333.3333334287973 333.33333213130817\n"}, {"type": "stdin_stdout", "input": "1000\n1268 998 997\n", "output": "388.59944836040455 305.85350904076006 305.54704259883545\n"}, {"type": "stdin_stdout", "input": "1\n1000 1000 1000\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\nTernary numeric notation is quit... | [{"type": "stdin_stdout", "input": "..---.-.--.-..-.-.---...--.-------..-.---.-...-.-----...-.-.....-..--.---.-.-.-----.-.-.-..----.-.----.-.---.--.-..-.----..---.-..--..------.-.-.---.-.-...--....-.--.--.-.-.-..-..-...--..---.-.------.\n", "output": "00211201011210020222101211001221001100001020211122111102201220121201... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nValera conducts experiments with... | [{"type": "stdin_stdout", "input": "139 8017 8\n18 108 117 114 99 74 36 52\n", "output": "18 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n1 25\n1 26\n1 27\n1 28\n1 29\n1 30\n1 31\n1 32\n1 33\n1 34\n1 35\n1 36\n1 37\n1 38\n1 39\n1 40\n1 41... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 number a, whose decimal... | [{"type": "stdin_stdout", "input": "16514659663135220552358975265304642528481558184545431737172205632772580885090555390229496726074548190\n", "output": "11111112222222222222333333334444444444555555555555555555556666666677777777888888889999991869000000000"}, {"type": "stdin_stdout", "input": "982599565604028679312800604... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 some square in the lowest row... | [{"type": "stdin_stdout", "input": "100 3 4\n644\n861\n478\n250\n560\n998\n141\n162\n386\n778\n123\n811\n602\n533\n391\n515\n898\n215\n965\n556\n446\n883\n256\n195\n573\n889\n515\n240\n179\n339\n258\n593\n930\n730\n735\n949\n522\n067\n549\n366\n452\n405\n473\n188\n488\n994\n000\n046\n930\n217\n897\n580\n509\n032\n343\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\nLittle X has met the following p... | [{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000 1999999999999999999"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000 1999999999999999999"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000 199... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nPolycarpus participates in a com... | [{"type": "stdin_stdout", "input": "284254589153928171911281811000\n1009 1000\n", "output": "YES\n2842545891539\n28171911281811000\n"}, {"type": "stdin_stdout", "input": "284254589153928171911281811000\n1009 1100\n", "output": "YES\n2842545891539\n28171911281811000\n"}, {"type": "stdin_stdout", "input": "64502253490350... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nWatto, the owner of a spare part... | [{"type": "stdin_stdout", "input": "1 17\ncacdbcacabccba\naccbcbcabaabbcbcaa\nbabccaaacccacbb\nbbbabbabbbcaacbaaac\nabbaccacabacaaaa\nbccbccabaacaacb\nbbbabbbbabcaacbcaac\nbcacababbbdaaca\nccbbbbababbccaab\nbbcbcc`babcaacb\naacccbabbacbabacaca\nbcaacbabcccbcbb\nacbacacbcacc\ncaaabcaaabacabbabbb\nabcbabaaaba\naacccbcaab... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Bad Luck Island is inhabited... | [{"type": "stdin_stdout", "input": "39 16 81\n", "output": "0.015517101139791982 0.9843603428087337 0.00012255605147426518\n"}, {"type": "stdin_stdout", "input": "2 100 69\n", "output": "0.7464107946114571 0.25358920538854307 -1.6653345369377348e-16\n"}, {"type": "stdin_stdout", "input": "41 100 14\n", "output": "0.417... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Bertown's main street n trees... | [{"type": "stdin_stdout", "input": "10\n73905 73906 73907 85732 73909 73909 73908 73907 73906 73905\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10\n60718 99414 65042 65043 65044 38495 95782 65042 65041 65040\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n60718 99414 65042 89001 65044 38495 95... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.