messages listlengths 1 1 | ground_truth stringlengths 156 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe mayor of Amida, the City of Miracle, is not elected like any other city. Once exhausted by long political... | [{"input": "4 3 1\n3 1 2\n0 1 3\n4 3 4\n1 0 1\n0 0 0", "output": "2\n1\n"}, {"input": "4 3 1\n3 1 1\n0 1 3\n4 3 4\n1 0 1\n0 0 0", "output": "3\n1\n"}, {"input": "6 4 1\n3 -1 2\n2 2 3\n3 3 4\n0 2 4\n0 0 0", "output": "1\n"}, {"input": "6 4 1\n3 -1 2\n2 2 3\n3 3 4\n1 2 4\n0 0 0", "output": "1\n"}, {"input": "4 4 1\n3 2 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\nGerald plays the following game. He has a checkered field of size n Γ n cells, where m various cells are bann... | [{"input": "14 5\n4 2\n5 4\n3 3\n2 3\n1 2\n", "output": "17\n"}, {"input": "14 5\n4 2\n3 8\n3 3\n2 3\n1 2\n", "output": "18\n"}, {"input": "14 5\n4 2\n5 4\n3 3\n2 3\n1 1\n", "output": "17\n"}, {"input": "14 5\n4 2\n9 4\n3 3\n2 3\n1 1\n", "output": "17\n"}, {"input": "14 5\n4 2\n9 4\n3 3\n2 3\n1 2\n", "output": "17\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\nDr. Asimov, a robotics researcher, released cleaning robots he developed (see Problem B). His robots soon bec... | [{"input": "34 1\n1 6\n2 6\n0 0", "output": "..................................\n.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.\n.E..............................E.\n.E.EEEEEEEEEEEEEEEEEEEEEEEEEEEE.E.\n.E.E..........................E.E.\n.E.E.EEEEEEEEEEEEEEEEEEEEEEEE.E.E.\n.E.E.E......................E.E.E.\n.E.E.E.EEEEEEEEEEEEEEEE... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVanya is doing his maths homework. He has an expression of form $x_{1} \\diamond x_{2} \\diamond x_{3} \\diam... | [{"input": "3+9+3+1+6+4+7+9+5+8+2+6+1+4+4+5+1+7+5+4+6+4+3+1*9+7+7+4+5+2+3+2+6+5+5+8+7+8+2+3*3+8+3+4+9+8*5+9+2+8+2+8+6+6+9+6+4+2+5+3+1+2+6+6+2+4+6+4+2+7+2+7+6+9+9+3+6+7+8+3+3+2+3+7+9+7+8+5+5+5*1+3+2+5+8+5*6+5+4*6+2+5+5+4+9+8+3+5+1+3+1+6+2+2+1+3+2+3+3+3+2+8+3+2+8+8+5+2+6+6+3+1+1+5+5*1+5+7+5+8+4+1*7+5+9+5+8+1*8+5+9+3+1+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\nMr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year ... | [{"input": "1999999927\n", "output": "1\n"}, {"input": "1000000009\n", "output": "1\n"}, {"input": "1847133842\n", "output": "2\n"}, {"input": "1076153021\n", "output": "3\n"}, {"input": "1908903481\n", "output": "3\n"}, {"input": "2000000000\n", "output": "2\n"}, {"input": "1000000007\n", "output": "1\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya is writing an operating system shell, and it should have commands for working with directories. To begi... | [{"input": "11\npwd\ncd /home/vasya\npwd\ncd ..\npwd\ncd vasya/../../petya\npwd\ncd /a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a\npwd\ncd ..\npwd\n", "output": "/\n/h... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice and Bob are playing a game with $n$ piles of stones. It is guaranteed that $n$ is an even number. The $... | [{"input": "50\n42 31 49 11 28 38 49 32 15 22 10 18 43 39 46 32 10 19 13 32 19 40 34 28 28 39 19 3 1 47 10 18 19 31 21 7 39 37 34 45 19 21 35 46 10 24 45 33 20 40\n", "output": "Alice\n"}, {"input": "50\n42 31 49 11 28 38 49 32 15 22 10 18 43 39 46 32 10 19 13 32 19 40 34 28 28 39 19 3 1 47 10 18 19 31 21 7 39 37 34 45... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n\nWrite a function `deNico`/`de_nico()` that accepts two parameters:\n- `key`/`$key` - string consist... | [{"input": "\"crazy\"\n\"cseerntiofarmit on \"", "output": "[\"secretinformation\"]", "fn_name": "de_nico"}, {"input": "\"crazy\"\n\"cseerntiofarmit on\"", "output": "[\"secretinformation\"]", "fn_name": "de_nico"}, {"input": "\"ba\"\n\"2143658709\"", "output": "[\"1234567890\"]", "fn_name": "de_nico"}, {"input": "\"a... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an undirected connected weighted graph with N vertices and M edges that contains neither self-l... | [{"input": "100 1000\n1 2 1\n1 3 1\n1 4 1\n1 5 1\n1 6 1\n1 7 1\n1 8 1\n1 9 1\n1 10 1\n1 11 1\n1 12 1\n1 13 1\n1 14 1\n1 15 1\n1 16 1\n1 17 1\n1 18 1\n1 19 1\n1 20 1\n1 21 1\n1 22 1\n1 23 1\n1 24 1\n1 25 1\n1 26 1\n1 27 1\n1 28 1\n1 29 1\n1 30 1\n1 31 1\n1 32 1\n1 33 1\n1 34 1\n1 35 1\n1 36 1\n1 37 1\n1 38 1\n1 39 1\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\nIvan is collecting coins. There are only $N$ different collectible coins, Ivan has $K$ of them. He will be ce... | [{"input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "-1\n"}, {"input": "1000000000000000000 1000000000000000000 1000010000000000000 1000000000000000000\n", "output": "-1\n"}, {"input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA film festival is coming up in the city N. The festival will last for exactly n days and each day will have ... | [{"input": "129 37\n15 22 28 15 30 16 11 20 4 26 14 37 29 17 15 15 14 18 1 9 16 22 13 32 5 18 25 11 6 33 33 22 17 9 1 5 27 27 37 4 6 1 3 18 17 33 6 17 2 24 23 1 1 37 35 21 21 17 18 6 31 17 29 18 10 10 30 31 8 3 25 20 34 11 12 12 24 13 5 27 20 31 28 1 36 2 4 13 14 9 33 25 4 26 36 6 2 7 15 9 20 33 24 33 28 12 23 1 28 12 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe problem describes the properties of a command line. The description somehow resembles the one you usually... | [{"input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"input": "\"RUn.exe N\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, y... | [{"input": "17\n.EEEEE...EEEE..EE\nEEE..E...EEEEE..E\n.E..E..EEE.EE...E\n.EEE.EE..EE...E..\nE..EEEEEE.EE.....\nE.EE...EEEEEEE.E.\nEEEE....EE..E.EEE\n...EEEEE.E..EE...\nEEE.E..EEEE.EEE..\n..E.E....EEE.....\nEE..E..E.E..EEEEE\nEEE..E.EEEEE.E...\n..EEEEE.E..EE.EE.\nEE.E...E..E..E.EE\n..E.EEE.EE..EE.E.\nE..EE........E.E.\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\nImagine a triangle of numbers which follows this pattern:\n\n * Starting with the number \"1\", \"1\" is posi... | [{"input": "10000", "output": "[500000005000]", "fn_name": "cumulative_triangle"}, {"input": "1000", "output": "[500000500]", "fn_name": "cumulative_triangle"}, {"input": "500", "output": "[62500250]", "fn_name": "cumulative_triangle"}, {"input": "150", "output": "[1687575]", "fn_name": "cumulative_triangle"}, {"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\nYou are given a sequence A_1, A_2, ..., A_N and an integer K.\n\nPrint the maximum possible length of a seque... | [{"input": "10 3\n1\n5\n2\n1\n1\n6\n11\n11\n4\n2", "output": "6\n"}, {"input": "10 3\n0\n5\n4\n3\n14\n11\n9\n5\n3\n4", "output": "6\n"}, {"input": "10 3\n0\n5\n4\n3\n11\n11\n9\n7\n6\n1", "output": "5\n"}, {"input": "10 1\n2\n8\n0\n3\n8\n11\n14\n7\n6\n1", "output": "4\n"}, {"input": "10 3\n1\n5\n2\n1\n1\n6\n12\n11\n4\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\nYou are given two matrices $A$ and $B$. Each matrix contains exactly $n$ rows and $m$ columns. Each element o... | [{"input": "5 50\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 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\nChef Shifu and Chef Po are participating in the Greatest Dumpling Fight of 2012.\nOf course, Masterchef Oogwa... | [{"input": "3\n2 4 3 8 12\n1 4 0 2 -1\n11 22 10 18 16", "output": "13\n-1\n1\n"}, {"input": "3\n2 4 3 8 12\n1 4 4 2 -1\n10 22 12 9 16", "output": "13\n-1\n5\n"}, {"input": "3\n2 4 3 8 12\n1 4 0 2 -1\n11 22 10 7 16", "output": "13\n-1\n3\n"}, {"input": "3\n3 4 3 11 12\n1 6 0 1 0\n19 14 16 1 16", "output": "25\n1\n33\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\nInterest rates are attached to the money deposited in banks, and the calculation method and interest rates va... | [{"input": "2\n7\n1 5 2\n-1 9 2\n2\n14\n1 5 2\n-1 13 1\n0", "output": "-1\n-1\n"}, {"input": "2\n7\n1 5 2\n-1 12 2\n2\n14\n0 5 2\n0 10 1\n0", "output": "-1\n0\n"}, {"input": "2\n14\n1 3 0\n17 6 2\n2\n12\n1 5 2\n1 12 1\n0", "output": "17\n1\n"}, {"input": "2\n25\n1 10 1\n3 7 2\n2\n7\n-1 16 1\n1 1 0\n0", "output": "3\n-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\nOstap already settled down in Rio de Janiero suburb and started to grow a tree in his garden. Recall that a t... | [{"input": "64 3\n13 10\n60 54\n23 35\n4 41\n59 18\n41 36\n48 13\n64 8\n30 19\n53 3\n34 11\n24 27\n21 25\n5 55\n51 11\n3 45\n24 57\n47 38\n55 26\n8 20\n29 42\n44 3\n7 15\n9 1\n17 4\n41 9\n15 29\n60 13\n31 36\n53 52\n59 14\n12 52\n24 31\n47 28\n29 23\n2 49\n30 44\n28 31\n25 22\n9 58\n64 11\n45 35\n59 44\n62 8\n49 53\n32... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have N balance beams numbered 1 to N. The length of each beam is 1 meters. Snuke walks on Beam i at a spee... | [{"input": "10\n1375710043 178537096\n1332309236 80797230\n164044598 544580992\n117241210 865935868\n383133839 231371336\n378371075 681212831\n304570952 16537461\n1789737664 267238505\n844917655 218662351\n662961957 100386692", "output": "1121712759 3406064155"}, {"input": "10\n646213683 228215172\n705445072 318106937\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a sequence a1, a2, ..., aN. Find the smallest possible value of ai + aj, where 1 β€ i < j β€ N.\n... | [{"input": "1\n4\n15 1 11 10", "output": "11\n"}, {"input": "1\n4\n16 2 20 10", "output": "12\n"}, {"input": "1\n4\n-4 -1 0 -2", "output": "-6\n"}, {"input": "1\n4\n2 -1 0 -2", "output": "-3\n"}, {"input": "1\n4\n-1 1 0 -3", "output": "-4\n"}, {"input": "1\n4\n-2 1 0 -3", "output": "-5\n"}, {"input": "1\n4\n16 2 11 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\nWrite a program of the Selection Sort algorithm which sorts a sequence A in ascending order. The algorithm sh... | [{"input": "6\n-1 -1 -1 1 -1 -1", "output": "-1 -1 -1 -1 -1 1\n2\n"}, {"input": "6\n-1 -1 -1 1 -2 -1", "output": "-2 -1 -1 -1 -1 1\n3\n"}, {"input": "6\n-1 -1 -1 1 -3 -1", "output": "-3 -1 -1 -1 -1 1\n3\n"}, {"input": "6\n-1 -1 -1 1 -4 -1", "output": "-4 -1 -1 -1 -1 1\n3\n"}, {"input": "6\n-1 -1 0 1 -3 -1", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Explanation\n\nIt's your first day in the robot factory and your supervisor thinks that you should start wi... | [{"input": "[38, 38, 73, 9, 3, 47, 86, 67, 75, 52, 46, 86, 30, 37, 80, 48, 52, 0, 85, 72]\n11", "output": "[29229344539]", "fn_name": "calculate_scrap"}, {"input": "[71, 82, 47, 72, 5, 75, 69, 30, 16, 43, 10, 11, 64, 53, 12, 78, 23, 7, 24, 85]\n12", "output": "[1465387910]", "fn_name": "calculate_scrap"}, {"input": "[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\nKicker (table football) is a board game based on football, in which players control the footballers' figures ... | [{"input": "1 100\n100 1\n99 99\n99 99\n", "output": "Team 1\n"}, {"input": "80 79\n79 30\n80 81\n40 80\n", "output": "Team 2\n"}, {"input": "48 41\n15 47\n11 38\n19 31\n", "output": "Team 1\n"}, {"input": "51 54\n95 28\n42 28\n17 48\n", "output": "Team 1\n"}, {"input": "19 56\n59 46\n40 70\n67 34\n", "output": "Team 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\nProfessor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his ... | [{"input": "5 3\n999999999 999999999 999999999 999999999 19992232\n", "output": " 1339997413"}, {"input": "19 100000\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", "output": " 20"}, {"input": "20 20\n0 0 0 0 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\nDid you hear about the Nibiru collision ? It is a supposed disastrous encounter between the earth and a large... | [{"input": "3\n-1 0 R\n2\n1 -1 U\n1 1 D\n1 1 U\n1\n1 0 U\n0 0 R\n1\n4 -1 L", "output": "SAFE\nSAFE\nSAFE\n"}, {"input": "3\n0 0 R\n2\n1 -4 U\n2 3 D\n1 2 U\n1\n2 -1 U\n0 0 R\n1\n7 1 L", "output": "SAFE\nSAFE\nSAFE\n"}, {"input": "3\n0 0 R\n2\n1 -4 U\n2 3 D\n0 2 U\n1\n2 -1 U\n0 0 R\n1\n7 1 L", "output": "SAFE\nSAFE\nSAFE... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingl... | [{"input": "1488496828 607500000\n", "output": "-1\n"}, {"input": "1183431925 540244525\n", "output": "-1\n"}, {"input": "1270836736 387420489\n", "output": "-1\n"}, {"input": "100000007 800000011\n", "output": "-1\n"}, {"input": "900000011 800000011\n", "output": "-1\n"}, {"input": "900000011 999900017\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\nWe call a 4-digit integer with three or more consecutive same digits, such as 1118, good.\nYou are given a 4-... | [{"input": "1118\n", "output": "Yes\n"}, {"input": "7777\n", "output": "Yes\n"}, {"input": "1234\n", "output": "No\n"}, {"input": "4000", "output": "Yes\n"}, {"input": "15093", "output": "No\n"}, {"input": "12733", "output": "No\n"}, {"input": "24549", "output": "No\n"}, {"input": "16730", "output": "No\n"}, {"input": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDuring the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made ... | [{"input": "10 -6\n5 2 1 9 5 2 4 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"input": "10 -6\n5 2 1 8 5 2 4 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"input": "10 0\n5 14 1 1 5 1 1 4 9 2\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n"}, {"input": "10 -4\n5 4 1 7 5 1 2 4 15 2\n", "output": "2\n3\n4\n5\n7\n8\n9\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\nImagine `n` horizontal lines and `m` vertical lines.\n\nSome of these lines intersect, creating recta... | [{"input": "100\n100", "output": "[24502500]", "fn_name": "rectangles"}, {"input": "2\n3", "output": "[3]", "fn_name": "rectangles"}, {"input": "2\n2", "output": "[1]", "fn_name": "rectangles"}, {"input": "1\n1", "output": "[0]", "fn_name": "rectangles"}, {"input": "0\n1", "output": "[0]", "fn_name": "rectangles"}, {"i... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDawid has four bags of candies. The i-th of them contains a_i candies. Also, Dawid has two friends. He wants ... | [{"input": "100 100 100 100\n", "output": "YES\n"}, {"input": "100 101 100 100\n", "output": "NO\n"}, {"input": "100 101 99 100\n", "output": "YES\n"}, {"input": "100 100 99 100\n", "output": "NO\n"}, {"input": "100 98 99 97\n", "output": "YES\n"}, {"input": "70 100 10 86\n", "output": "NO\n"}, {"input": "76 97 99 74\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven are integers S and P.\nIs there a pair of positive integers (N,M) such that N + M = S and N \\times M =... | [{"input": "1000000000000 999999999999\n", "output": "Yes\n"}, {"input": "50000000002 100000000000\n", "output": "Yes\n"}, {"input": "978530427494 321593407609\n", "output": "No\n"}, {"input": "203939391324 871114841657\n", "output": "No\n"}, {"input": "119381456309 353176041209\n", "output": "No\n"}, {"input": "340495... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInput\n\nThe input contains two integers a1, a2 (0 β€ ai β€ 109), separated by a single space.\n\nOutput\n\nOut... | [{"input": "1000000000 1000000000\n", "output": "1000000001\n"}, {"input": "1000000000 0000000000\n", "output": "1000000000\n"}, {"input": "1000000000 999999999\n", "output": "1999999999\n"}, {"input": "937477084 827336327\n", "output": "1661110812\n"}, {"input": "957747793 424238335\n", "output": "1491580217\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor given a sequence $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$, print the previous permutation and the next perm... | [{"input": "3\n-1 12 -1", "output": "-1 -1 12\n-1 12 -1\n12 -1 -1\n"}, {"input": "3\n-1 16 -1", "output": "-1 -1 16\n-1 16 -1\n16 -1 -1\n"}, {"input": "3\n-1 13 -1", "output": "-1 -1 13\n-1 13 -1\n13 -1 -1\n"}, {"input": "3\n-1 18 -1", "output": "-1 -1 18\n-1 18 -1\n18 -1 -1\n"}, {"input": "3\n-1 20 -1", "output": "-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\nproblem\n\nOnce upon a time there were settlements and many people lived there. People built buildings of var... | [{"input": "10\n2 0\n1 1\n1 0\n1 -1\n2 5\n0 1\n2 1\n1 4\n1 14\n18 1\n10\n4 14\n4 0\n2 1\n0 2\n1 4\n0 5\n4 1\n1 1\n2 6\n5 -1\n0", "output": "1\n0\n"}, {"input": "10\n16 0\n0 1\n1 1\n1 0\n2 7\n0 3\n3 1\n1 3\n1 14\n18 2\n10\n2 7\n5 5\n2 1\n0 2\n1 4\n1 4\n4 1\n1 1\n1 6\n5 4\n0", "output": "0\n17\n"}, {"input": "10\n16 4\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from ... | [{"input": "16416\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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\nConsider the infinite sequence s of positive integers, created by repeating the following steps:\n\n 1. Find... | [{"input": "9\n2\n2\n6\n4\n14\n11\n13\n8\n17\n", "output": "2\n2\n12\n4\n9\n11\n7\n10\n32\n"}, {"input": "9\n2\n2\n3\n4\n10\n12\n12\n8\n11\n", "output": "2\n2\n3\n4\n6\n13\n13\n10\n11\n"}, {"input": "9\n2\n2\n6\n4\n14\n17\n13\n8\n17\n", "output": "2\n2\n12\n4\n9\n32\n7\n10\n32\n"}, {"input": "9\n2\n2\n3\n4\n8\n10\n20\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\nRecently, the Fair Nut has written k strings of length n, consisting of letters \"a\" and \"b\". He calculate... | [{"input": "100 1000000000\nbbabbaabbbaaaaabbabbbaaabbbbabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbaabbbbabaabbbabbaaaaabbbbaab\nbbabbaabbbaaaaabbabbbaaabbbbabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaababbbabbbbaaaaabbaaaaaaaab\n", "output": "41073741883\n"}, {"input": "100 1000000000\naaaaaaaaaaabbaaaaabbbababaaaab... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMr. Kitayuta has just bought an undirected graph consisting of n vertices and m edges. The vertices of the gr... | [{"input": "5 7\n1 5 1\n2 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "1\n1\n1\n1\n2\n"}, {"input": "5 7\n1 1 1\n2 5 1\n3 5 1\n4 5 1\n1 2 2\n2 3 2\n3 4 2\n5\n1 5\n5 1\n2 5\n1 5\n1 4\n", "output": "0\n0\n1\n0\n1\n"}, {"input": "5 7\n1 1 1\n2 5 1\n3 5 1\n4 5 2\n1 2 2\n2 3 2\n3 4 2\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\nYou are given a bracket sequence consisting of $n$ characters '(' and/or )'. You perform several operations w... | [{"input": "8\n3\n)()\n8\n)()()(((\n4\n(()(\n5\n(())(\n6\n))((()\n5\n))())\n1\n)\n2\n)(\n", "output": "1 0\n3 1\n1 2\n2 1\n3 0\n2 1\n0 1\n0 2\n"}, {"input": "5\n3\n)()\n8\n)()()(((\n4\n(()(\n5\n(())(\n6\n))((()\n", "output": "1 0\n3 1\n1 2\n2 1\n3 0\n"}, {"input": "5\n2\n()\n3\n())\n4\n((((\n5\n)((()\n6\n)((()(\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\nWelcome! Everything is fine.\n\nYou have arrived in The Medium Place, the place between The Good Place and Th... | [{"input": "2\n3\n1 2 3\n3 2 4\n2 4 0\n4 5 10\n5 6 5\n1\n1 2 2\n1 5 2\n1 4 6\n", "output": "12 32\n2 2\n"}, {"input": "2\n3\n1 2 3\n3 2 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 1\n1 3 0\n1 4 3\n", "output": "15 33\n4 4\n"}, {"input": "2\n3\n1 2 3\n3 2 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 0\n1 3 2\n1 4 3\n", "output": "15 33\n5 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\nDreamoon likes coloring cells very much.\n\nThere is a row of $n$ cells. Initially, all cells are empty (don'... | [{"input": "2000 100\n5 128 1368 1679 1265 313 1854 1512 1924 338 38 1971 238 1262 1834 1878 1749 784 770 1617 191 395 303 214 1910 1300 741 1966 1367 24 268 403 1828 1033 1424 218 1146 925 1501 1760 1164 1881 1628 1596 1358 1360 29 1343 922 618 1537 1839 1114 1381 704 464 692 1450 1590 1121 670 300 1053 1730 1024 1292... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Description:\n\n Remove all exclamation marks from sentence except at the end.\n\n### Examples\n\n```\nre... | [{"input": "\"Hi! Hi!\"", "output": "[\"Hi Hi!\"]", "fn_name": "remove"}, {"input": "\"Hi!!!\"", "output": "[\"Hi!!!\"]", "fn_name": "remove"}, {"input": "\"!Hi!\"", "output": "[\"Hi!\"]", "fn_name": "remove"}, {"input": "\"Hi!\"", "output": "[\"Hi!\"]", "fn_name": "remove"}, {"input": "\"!Hi\"", "output": "[\"Hi\"]", ... | 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\nGiven a string of characters, I want the function `findMiddle()`/`find_middle()` to return the middle number ... | [{"input": "\"asd.f855dasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[0]", "fn_name": "find_middle"}, {"input": "\"asd.fasd.ga654sdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[2]", "fn_name": "find_middle"}, {"input": "\"asd.fasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg\"", "output": "[-1]", "fn_name": "find_middle"},... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are the head of a large enterprise. $n$ people work at you, and $n$ is odd (i. e. $n$ is not divisible by... | [{"input": "3\n3 26\n10 12\n1 4\n13 26\n1 1337\n-1 1000000001\n5 26\n4 3\n1 4\n3 7\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"input": "3\n3 25\n10 12\n1 4\n10 13\n1 1337\n1 1000000001\n5 26\n4 3\n0 4\n3 11\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"input": "3\n3 26\n10 12\n1 4\n13 26\n1 1337\n-1 1000000001\n5 26\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValery is very interested in magic. Magic attracts him so much that he sees it everywhere. He explains any st... | [{"input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 0 -2 0 2 0 1 0 -2 0 -2 -1 -1 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 2 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -1 2 2 0 0 0 -1 -2 0 1 0 -1 0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe had a string s consisting of n lowercase Latin letters. We made k copies of this string, thus obtaining k ... | [{"input": "100 3\nzsk\nzsk\nzsk\nzsk\nskz\nskz\nkzs\nskz\nkzs\nkzs\nzsk\nkzs\nkzs\nkzs\nskz\nkzs\nskz\nskz\nkzs\nzsk\nkzs\nkzs\nkzs\nskz\nskz\nskz\nzsk\nskz\nzsk\nskz\nkzs\nskz\nskz\nskz\nkzs\nzsk\nzsk\nkzs\nskz\nskz\nkzs\nkzs\nskz\nkzs\nkzs\nskz\nkzs\nskz\nkzs\nkzs\nskz\nkzs\nkzs\nkzs\nkzs\nskz\nkzs\nskz\nskz\nskz\ns... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Anna got the following task at school: to arrange several numbers in a circle so that any two neighbo... | [{"input": "50\n363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 363510962 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 363510952 363510968 3635... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordi... | [{"input": "40\n0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n1 0\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 0\n3 0\n4 0\n5 0\n6 0\n7 0\n8 0\n9 0\n10 0\n11 0\n12 0\n13 0\n14 0\n15 0\n16 0\n17 0\n18 0\n19 0\n20 0\n0 1 2 -1 -2 3 4 -3 5 6 7 8 0 -4 -5 1 -6 -7 -8 -9 -10 -11 9 2 -12 -13 -14 3 10 -15 11 4 -16... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm ... | [{"input": "1000000000000 999999999999\n", "output": "1000000000000\n"}, {"input": "1000000000000 999999999999\n", "output": "1000000000000\n"}, {"input": "1000000000000 999999999998\n", "output": "500000000000\n"}, {"input": "1000000000000 999999999998\n", "output": "500000000000\n"}, {"input": "1370863279309 12652739... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Petya likes arrays that consist of non-negative integers a lot. Recently his mom has presented him one... | [{"input": "99\n3511 2076 9314 3598 7737 271 4110 4454 5830 8661 8584 8227 2236 2626 1025 3806 3162 2837 6071 9627 1836 7729 6629 4054 9377 3261 1325 8859 3610 7616 5052 9736 1249 6224 7031 6074 4196 8075 4005 5419 5664 8214 4391 731 8714 8622 6122 6976 4057 1770 8025 3778 2792 994 5204 1826 6083 5438 8409 8029 1962 31... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider the array `[3,6,9,12]`. If we generate all the combinations with repetition that sum to `12`, we get... | [{"input": "[3, 6, 9, 12, 14, 18]\n30", "output": "[21]", "fn_name": "find"}, {"input": "[3, 6, 9, 12]\n12", "output": "[5]", "fn_name": "find"}, {"input": "[3, 6, 9, 12]\n15", "output": "[5]", "fn_name": "find"}, {"input": "[1, 4, 5, 8]\n8", "output": "[3]", "fn_name": "find"}, {"input": "[1, 2, 3]\n10", "output": "[0... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA wise man told Kerem \"Different is good\" once, so Kerem wants all things in his life to be different. \n\n... | [{"input": "45\naaabbbcccdddeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"input": "45\naaabbbcccdddeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"input": "45\naaabbbcccdedeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"input": "45\naaabbbcccdedeeefffgghhijjjkkkkkkkkkkkkkkkkkkk\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice is the leader of the State Refactoring Party, and she is about to become the prime minister. \n\nThe el... | [{"input": "100\n100 48 48 22 21 27 51 43 53 34 54 37 45 37 27 53 39 53 37 44 55 44 31 36 55 47 45 23 40 32 55 54 40 38 30 25 28 20 39 20 53 50 41 26 29 37 42 55 23 27 51 30 39 50 24 30 22 50 56 32 60 45 50 43 27 25 52 59 47 58 28 56 49 39 33 52 26 46 23 42 45 58 42 50 49 25 28 30 46 43 26 32 40 53 60 21 54 16 57 50\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a permutation p of numbers 1, 2, ..., n. Let's define f(p) as the following sum:$f(p) = \\sum_{... | [{"input": "50 562949953421311\n", "output": "49 50 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\n"}, {"input": "50 562949953421310\n", "output": "48 50 49 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n**Introduction**\nβLittle Petya very much likes sequences. However, recently he received a sequence as a gift... | [{"input": "[5, 6, 1, 2, 3, 1, 3, 45, 7, 1000000000]", "output": "[[1, 1, 1, 2, 3, 3, 5, 6, 7, 45]]", "fn_name": "sort_number"}, {"input": "[1, 2, 3, 4, 5]", "output": "[[1, 1, 2, 3, 4]]", "fn_name": "sort_number"}, {"input": "[4, 2, 1, 3, 5]", "output": "[[1, 1, 2, 3, 4]]", "fn_name": "sort_number"}, {"input": "[2, 3,... | 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\nPlaying with Stones\n\nKoshiro and Ukiko are playing a game with black and white stones. The rules of the gam... | [{"input": "4\n24 99\n15 68\n12 155\n95 79", "output": "0\n"}, {"input": "4\n24 99\n15 97\n12 149\n95 79", "output": "0\n"}, {"input": "4\n39 99\n15 97\n12 149\n95 79", "output": "0\n"}, {"input": "4\n24 99\n15 68\n12 90\n95 66", "output": "0\n"}, {"input": "4\n24 99\n15 44\n12 90\n95 66", "output": "0\n"}, {"input": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA text editor is a useful software tool that can help people in various situations including writing and prog... | [{"input": "3\nA sample input\n9\nforward word\ndelete char\nforward word\ndelete char\nforward word\ndelete char\nbackward word\nbackward word\nforward word\nHallow, Word.\n7\nforward char\ndelete word\ninsert \"ello, \"\nforward word\nbackward char\nbackward char\ninsert \"l\"\n\n3\nforward vord\nbackward word\ndelet... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nErelong Leha was bored by calculating of the greatest common divisor of two factorials. Therefore he decided ... | [{"input": "26 26\nabcdefghijklmnopqrstuvwxyz\nffffffffffffffffffffffffff\n", "output": "25\n1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 \n"}, {"input": "26 26\nabcdefghijklmnopqrstuvwxyz\nffffffffffffffffffffffffff\n", "output": "25\n1 2 3 4 5 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\nPolycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he li... | [{"input": "20\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n", "output": "32591\n32591\n32591\n32591\n32591\n32591\n32591\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\nYou are given two arrays `arr1` and `arr2`, where `arr2` always contains integers.\n\nWrite the function `fin... | [{"input": "[\"this\", \"is\", \"test\"]\n[0, 1, 2]", "output": "[[\"this\", \"is\", \"test\"]]", "fn_name": "find_array"}, {"input": "[0, 1, 5, 2, 1, 8, 9, 1, 5]\n[1, 4, 7]", "output": "[[1, 1, 1]]", "fn_name": "find_array"}, {"input": "[\"a\", \"a\", \"a\", \"a\", \"a\"]\n[2, 4]", "output": "[[\"a\", \"a\"]]", "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\nMr. Chanek has an integer represented by a string $s$. Zero or more digits have been erased and are denoted b... | [{"input": "________\n", "output": "3600000\n"}, {"input": "X_______\n", "output": "3600000\n"}, {"input": "_____X__\n", "output": "3600000\n"}, {"input": "_______X\n", "output": "3600000\n"}, {"input": "________\n", "output": "3600000\n"}, {"input": "_____X__\n", "output": "3600000\n"}, {"input": "X_______\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\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nPrincess Rupsa saw one of h... | [{"input": "2\n1\n1 0\n2\n10 -1 -1", "output": "0\n999999949\n"}, {"input": "2\n1\n2 4\n2\n1 -1 1", "output": "16\n1000000003\n"}, {"input": "2\n1\n1 2\n2\n1 -1 0", "output": "4\n1000000003\n"}, {"input": "2\n1\n1 2\n2\n1 0 -1", "output": "4\n1000000005\n"}, {"input": "2\n1\n0 2\n2\n1 0 -1", "output": "0\n1000000005\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\nAizu Gakuen High School holds a school festival every year. The most popular of these is the haunted house. T... | [{"input": "1a 132 243\n1c 324 183\n1f 93 199\n2b 372 163\n2c 229 346\n2e 391 206\n3a 118 168\n3b 263 293\n3d 281 102", "output": "1a 375 99300\n1c 507 119700\n1f 292 78300\n2b 535 123300\n2c 575 149600\n2e 597 140000\n3a 286 74000\n3b 556 140500\n3d 383 86800\n"}, {"input": "1a 132 243\n1c 324 183\n1f 93 199\n3b 372 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\nProblem statement\n\nWhen you heard that this year's KUPC can be joined as a team, you decided to talk to you... | [{"input": "-127 10 -1 -1", "output": "115\n"}, {"input": "-127 10 -1 -3", "output": "113\n"}, {"input": "-1 -12 2 137", "output": "124\n"}, {"input": "2 -2 -158 -1", "output": "153\n"}, {"input": "1 -2 -158 -1", "output": "154\n"}, {"input": "1 -2 -256 -1", "output": "252\n"}, {"input": "-127 26 -1 -1", "output": "99\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya is preparing for his birthday. He decided that there would be $n$ different dishes on the dinner table,... | [{"input": "4\n4\n3 7 4 5\n2 1 2 4\n4\n1 2 3 4\n3 3 3 3\n2\n1 2\n10 10\n2\n10 10\n1 2\n", "output": "5\n3\n2\n3\n"}, {"input": "4\n4\n3 11 4 2\n2 1 2 4\n4\n1 2 3 4\n3 3 3 3\n2\n1 2\n10 10\n2\n10 10\n1 2\n", "output": "3\n3\n2\n3"}, {"input": "4\n4\n3 7 4 5\n3 1 2 4\n4\n1 2 3 4\n3 3 3 10\n2\n0 2\n10 10\n2\n10 10\n1 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\nAnalyzing the mistakes people make while typing search queries is a complex and an interesting work. As there... | [{"input": "250\niiffiehchidfgigdbcciahdehjjfacbbaaadagaibjjcehjcbjdhaadebaejiicgidbhajfbfejcdicgfbcchgbahfccbefdcddbjjhejigiafhdjbiiehadfficicbebeeegcebideijidbgdecffeaegjfjbbcfiabfbaiddbjgidebdiccfcgfbcbbfhaejaibeicghecchjbiaceaibfgibhgcfgifiedcbhhfadhccfdhejeggcah\njbadcfjffcfabbecfabgcafgfcgfeffjjhhdaajjgcbgbechhia... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor years, the Day of city N was held in the most rainy day of summer. New mayor decided to break this tradit... | [{"input": "100 7 7\n1656 322 975 921 115 647 61 232 127 277 839 797 261 968 788 381 191 117 663 959 475 166 471 984 17 473 57 809 65 881 1109 725 587 933 466 537 1017 706 927 173 636 372 644 82 835 893 792 494 808 977 479 109 1858 21 625 104 626 569 524 504 16 257 274 285 404 629 247 609 521 602 483 271 45 442 503 438... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function ```x(n)``` that takes in a number ```n``` and returns an ```nxn``` array with an ```X``` in ... | [{"input": "6", "output": "[[[1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 1]]]", "fn_name": "x"}, {"input": "5", "output": "[[[1, 0, 0, 0, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 1, 0], [1, 0, 0, 0, 1]]]", "fn_name": "x"}, {"input": "4", "ou... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n switches and m lamps. The i-th switch turns on some subset of the lamps. This information is ... | [{"input": "4 15\n111110100011010\n111111011010110\n101000001011001\n100110000111011\n", "output": "YES\n"}, {"input": "4 15\n111110100011010\n111111011010110\n101000001011001\n100110000111011\n", "output": "YES\n"}, {"input": "4 15\n111110100011010\n111111011010110\n101000001011001\n100110000111001\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\nYou are given n points on a plane. All the points are distinct and no three of them lie on the same line. Fin... | [{"input": "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 12\n18 14\n19 18\n20 17\n", "output": "18\n"}, {"input": "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 12\n18 14\n19 18\n20 17\n", "output": "18\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA well-known art union called \"Kalevich is Alive!\" manufactures objects d'art (pictures). The union consist... | [{"input": "10 3\n6 10 3\n2 7 12\n7 4 7\n10 3 2\n6 5 12\n8 4 4\n5 9 11\n6 7 7\n2 6 10\n2 6 2\n", "output": "19 35 42 44 56 60 71 78 88 90\n"}, {"input": "10 3\n6 10 3\n2 7 12\n7 4 7\n6 3 0\n6 5 12\n8 4 4\n5 15 11\n6 7 3\n2 6 10\n2 6 2\n", "output": "19 35 42 42 54 58 69 72 82 84\n"}, {"input": "10 3\n6 10 3\n3 7 12\n7 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a simple weighted connected undirected graph, consisting of $n$ vertices and $m$ edges.\n\nA pa... | [{"input": "15 15 23\n13 10 12\n11 14 12\n2 15 5\n4 10 8\n10 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 8\n9 15 4\n4 2 9\n11 15 1\n11 12 14\n10 8 12\n3 6 11\n", "output": "3250\n"}, {"input": "15 15 23\n13 11 12\n11 14 12\n2 15 5\n4 10 8\n10 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 8\n9 15 4\n4 2 9\n11 15 1\n11 12 14\n10 8 12\n3 6 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\nThe following problem is well-known: given integers n and m, calculate $2^{n} \\operatorname{mod} m$, \n\nwhe... | [{"input": "100000000\n100000000\n", "output": "100000000\n"}, {"input": "100000000\n100000000\n", "output": "100000000\n"}, {"input": "100000000\n100001000\n", "output": "100001000\n"}, {"input": "100000000\n110001000\n", "output": "110001000\n"}, {"input": "99999999\n100000000\n", "output": "100000000\n"}, {"input": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe R2 company has n employees working for it. The work involves constant exchange of ideas, sharing the stor... | [{"input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0 0 0\n4 1\n2 6\n7 3\n7 1\n5 3\n", "output": "1 2 4 4 3 4 2 \n"}, {"input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0 0 0\n4 1\n2 6\n7 3\n7 1\n5 3\n", "output": "1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Little Elephant loves to play with color cards.\n\nHe has n cards, each has exactly two colors (the color... | [{"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\n2 2\n1 1\n1 1\n1 2\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\nThere is a vampire family of N members. Vampires are also known as extreme gourmets. Of course vampires' food... | [{"input": "2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 4 5\n0 1 -1 1 2\n-1 1 1 2 2\n1 0 3 1 1\n0 0", "output": "Yes\nYes\n"}, {"input": "2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 7 5\n0 1 -1 1 2\n-1 1 1 2 2\n1 0 3 1 1\n0 0", "output": "Yes\nYes\n"}, {"input": "2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 7 5\n0 1 -1 1 2\n-1 1 1 0 2\n1 0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can mul... | [{"input": "5 1 3\n1 5 13 8 16\n", "output": " 63\n"}, {"input": "5 10 8\n0 0 0 0 0\n", "output": " 0\n"}, {"input": "5 10 8\n1000000000 1000001000 1000000000 1000000000 1000000000\n", "output": "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\nLong time ago there was a symmetric array $a_1,a_2,\\ldots,a_{2n}$ consisting of $2n$ distinct integers. Arra... | [{"input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n7 11 7 11\n1\n1 1\n4\n40 56 48 40 160 56 117 48\n6\n240 154 210 162 174 154 186 240 174 186 162 210\n", "output": "YES\nNO\nNO\nNO\nNO\nYES\n"}, {"input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n0 11 7 11\n1\n1 1\n4\n40 56 48 40 160 56 117 48\n6\n240 154 210 162 174 154 186 240 17... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array consisting of $n$ integers $a_1, a_2, \\dots , a_n$ and an integer $x$. It is guarante... | [{"input": "100 100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 50 4 80 72 39\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\nThe princess is going to escape the dragon's cave, and she needs to plan it carefully.\n\nThe princess runs a... | [{"input": "2\n100\n10\n10\n739\n", "output": "22\n"}, {"input": "1\n100\n1\n1\n1000\n", "output": "152\n"}, {"input": "2\n100\n13\n10\n739\n", "output": "22\n"}, {"input": "1\n100\n2\n1\n1000\n", "output": "151\n"}, {"input": "2\n100\n24\n10\n739\n", "output": "21\n"}, {"input": "100\n99\n1\n1\n1000\n", "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\nWrite a function that takes one or more arrays and returns a new array of unique values in the order of the o... | [{"input": "[1, 3, 2]\n[5, 2, 1, 4]\n[2, 1]", "output": "[[1, 3, 2, 5, 4]]", "fn_name": "unite_unique"}, {"input": "[]\n[1, 2, 1, 2]\n[2, 1, 1, 2, 1]", "output": "[[1, 2]]", "fn_name": "unite_unique"}, {"input": "[]\n[4, \"a\", 2]\n[]", "output": "[[4, \"a\", 2]]", "fn_name": "unite_unique"}, {"input": "[1, 2]\n[3, 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\nDevu is a class teacher of a class of n students. One day, in the morning prayer of the school, all the stude... | [{"input": "8\n-1\nBB\n0\nBG\n1\nGBGB\n2\nBGG\n2\nBGGB\n1\nBBBGG\n2\nBBGG\n2\nBGB", "output": "-1\n0\n0\n1\n1\n3\n1\n0\n"}, {"input": "8\n1\nBB\n0\nBG\n0\nBBGG\n1\nAGG\n0\nBGGB\n1\nBBBGG\n2\nBBGG\n2\nBGB", "output": "-1\n0\n1\n-1\n1\n3\n1\n0\n"}, {"input": "8\n1\nBB\n0\nBG\n0\nBBGG\n1\nAGG\n0\nBGGB\n1\nBBBGG\n2\nBBGG\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\nProblem:\n\nYou are given n natural numbers a1,a2,a3β¦β¦ an. Let SOD of a number be defined as the Sum of Digit... | [{"input": "975\n83120057411220087360668125140646348919041806702329314488483800118463434852377449595\n9717806464488721715522935873810745984496672189178897548\n96811324979237301769049529676571\n1036276136291119718301618513101612705490251717930737781164655306138110273308573272031338\n43586\n666957580799011908835864604532... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came... | [{"input": "100 100 1\n", "output": "988185646\n"}, {"input": "100 50 50\n", "output": "661237556\n"}, {"input": "100 13 11\n", "output": "883875774\n"}, {"input": "90 100 30\n", "output": "697322870\n"}, {"input": "100 50 50\n", "output": "661237556\n"}, {"input": "100 100 1\n", "output": "988185646\n"}, {"input": "90... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string $t$ consisting of $n$ lowercase Latin letters and an integer number $k$.\n\nLet's defi... | [{"input": "50 68\npyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvncea\n", "output": "pyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruld... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nproblem\n\nOne day in the cold winter, JOI Taro decided to break the thin ice in the plaza and play. The squa... | [{"input": "3\n3\n1 1 0\n1 0 1\n1 1 0\n5\n3\n1 1 1 0 1\n1 1 0 1 0\n1 0 0 0 1\n0\n0", "output": "5\n5\n"}, {"input": "3\n3\n1 1 0\n1 0 1\n0 1 0\n5\n3\n1 1 0 0 1\n1 1 0 1 0\n1 0 0 0 1\n0\n0", "output": "3\n5\n"}, {"input": "3\n3\n1 1 0\n1 0 1\n0 1 0\n5\n3\n1 1 0 0 1\n1 1 0 1 0\n1 1 1 0 1\n0\n0", "output": "3\n7\n"}, {"in... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n[Image] \n\nAs some of you know, cubism is a trend in art, where the problem of constructing volumetrical sha... | [{"input": "53\n1014364 40727 75774 243769 314 406417 5272684 14138 10640282 64955 2763 5667043 2121887 204672692 567643 60183 5183 11361359 2792918 199155 174809 16182540 21 392221 19434423 9140891 159733 15438 67903 3816799 616 429181 30392293 413992581 10847741 20771 16366654 1163 414283 156163 55907108 310278 95949... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a program that reads poker hand data and outputs the role for each. However, this issue follows the ru... | [{"input": "1,2,4,3,1\n3,3,1,3,12\n12,13,11,12,12\n7,6,7,6,7\n3,3,2,3,3\n6,7,8,9,10\n11,13,11,1,13\n11,12,13,1,1", "output": "one pair\nthree card\nthree card\nfull house\nfour card\nstraight\ntwo pair\none pair\n"}, {"input": "1,2,3,4,1\n2,3,1,3,12\n12,13,11,12,12\n7,6,7,6,6\n3,3,2,4,3\n6,7,8,9,10\n11,13,10,1,13\n11,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\nDescription\n\nTHE BY DOLM @ STER is a training simulation game scheduled to be released on EXIDNA by 1rem on... | [{"input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 0 2 1\ndop\n1 7 11 21\n2 300\nBydp System ahplA\n2 11 4 7\nGreen Inferno\n300 300 300 300", "output": "210\n1650\n"}, {"input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 1 2 1\ndop\n1 7 11 14\n2 300\nBydp System Alpha\n7 11 4 7\nGreen Inferno\n300 300 300 300", "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\nTokitsukaze and CSL are playing a little game of stones.\n\nIn the beginning, there are $n$ piles of stones, ... | [{"input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "output": "sjfnb\n"}, {"input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125477\n", "output": "cslnb\n"}, {"input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two integers $n$ and $k$. Your task is to find if $n$ can be represented as a sum of $k$ distin... | [{"input": "11\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"input": "11\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"input": "11\n4 2\n4 2\n4 2\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\nLittle girl Susie went shopping with her mom and she wondered how to improve service quality. \n\nThere are n... | [{"input": "26\n1000 4110030 64221 131521030 942374833 1003 2055015 32110 770511 16440130 263042057 32880256 128439 557559573 16051 8220066 469240078 65760513 256878 790176315 4012 2005 1027508 928528684 8030 1005954322\n", "output": "20\n"}, {"input": "26\n1000 4110030 64221 131521030 942374833 1003 2055015 32110 5137... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSasha likes programming. Once, during a very long contest, Sasha decided that he was a bit tired and needed t... | [{"input": "6\n3 2 2 10 13 8\n", "output": "1\n"}, {"input": "6\n3 2 2 12 13 8\n", "output": "1\n"}, {"input": "6\n3 2 2 12 13 2\n", "output": "2\n"}, {"input": "6\n3 2 4 12 13 2\n", "output": "0\n"}, {"input": "6\n3 2 4 12 13 3\n", "output": "0\n"}, {"input": "6\n0 2 4 12 13 3\n", "output": "0\n"}, {"input": "6\n0 2 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\nThis is yet another problem on regular bracket sequences.\n\nA bracket sequence is called regular, if by inse... | [{"input": "(?(((???))(??)?)?))))(?)????(()()???(?)????(??(??????)()(????(?)))))??(???(??)?(??)????????(????(?()\n39 78\n1 83\n2 35\n28 89\n53 53\n96 67\n16 46\n43 28\n25 73\n8 97\n57 41\n15 25\n47 49\n23 18\n97 77\n38 33\n68 80\n38 98\n62 8\n61 79\n84 50\n71 48\n12 16\n97 95\n16 70\n72 58\n55 85\n88 42\n49 56\n39 122\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe clique problem is one of the most well-known NP-complete problems. Under some simplification it can be fo... | [{"input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n30 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6\n"}, {"input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n30 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6"}, {"input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n4 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6"}, {"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\nYou are given a ternary string (it is a string which consists only of characters '0', '1' and '2').\n\nYou ca... | [{"input": "100022202\n", "output": "000122202\n"}, {"input": "100022202\n", "output": "000122202\n"}, {"input": "11222121\n", "output": "11112222\n"}, {"input": "11222121\n", "output": "11112222\n"}, {"input": "2112120\n", "output": "1112220\n"}, {"input": "2112120\n", "output": "1112220\n"}, {"input": "100210\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\nYaroslav likes algorithms. We'll describe one of his favorite algorithms.\n\n 1. The algorithm receives a st... | [{"input": "10\n448\n727\n1418\n278\n870\n913\n2072\n300\n36\n1312\n", "output": "0??<>1\n1??<>2\n2??<>3\n3??<>4\n4??<>5\n5??<>6\n6??<>7\n7??<>8\n8??<>9\n9??>>??0\n??<>1\n?0>>0?\n?1>>1?\n?2>>2?\n?3>>3?\n?4>>4?\n?5>>5?\n?6>>6?\n?7>>7?\n?8>>8?\n?9>>9?\n?>>??\n>>?\n"}, {"input": "10\n1429\n605\n903\n154\n293\n383\n422\n71... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two integers $a$ and $b$. You may perform any number of operations on them (possibly zero).\n\n... | [{"input": "3\n0 0\n2 1\n2 -1\n", "output": "YES\nYES\nNO\n"}, {"input": "3\n11 2\n-1 0\n1 2\n", "output": "NO\nNO\nYES\n"}, {"input": "3\n2 14\n2 1\n-1 0\n", "output": "NO\nYES\nNO\n"}, {"input": "3\n0 0\n2 1\n-1 0\n", "output": "YES\nYES\nNO\n"}, {"input": "3\n0 0\n2 1\n-2 0\n", "output": "YES\nYES\nNO\n"}, {"input":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNot to be confused with chessboard.\n\n [Image] \n\n\n-----Input-----\n\nThe first line of input contains a s... | [{"input": "42\nquxukow soft\nwcn soft\npbwg soft\nlrp hard\nphdvfz soft\nidkvymji soft\nobq soft\nyhx soft\nijygw soft\nztzz soft\nuwdhnwu soft\ndgnuuej hard\nhntyyzr soft\nqxf hard\nztg soft\nhnpq soft\nuhznu soft\nitelgl hard\nggceadhw hard\nrxq soft\nkznmshem hard\nlri hard\ndalh soft\ngyzzuht hard\nzvx soft\nbjffl... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.