messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn the Internet, data is divided into packets, and each packet is transferred to a destination via a relay device called a router. Each router determines the next router to forward from the destination described in the pa... | [{"type": "stdin_stdout", "input": "7\n1 4 2 5 5 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 2\n7 0\n6\n1 2 0\n1 5 0\n1 2 0\n5 1 3\n6 3 0\n1 7 4", "output": "NA\nNA\nNA\nNA\nNA\n3\n"}, {"type": "stdin_stdout", "input": "7\n1 4 2 5 4 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 1\n7 0\n6\n1 2 1\n1 3 6\n1 2 0\n5 2 3\n6 3 0\n3 7 4", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen registering in a social network, users are allowed to create their own convenient login to make it easier to share contacts, print it on business cards, etc.\n\nLogin is an arbitrary sequence of lower and uppercase l... | [{"type": "stdin_stdout", "input": "ELioO1lOoOIOiLoooi1iolul1O\n7\nOoEIuOIl1ui1010uiooOoi0Oio001L0EoEolO0\nOLIoOEuoE11u1u1iLOI0oO\nuEOuO0uIOOlO01OlEI0E1Oo0IO1LI0uE0LILO0\nEOo0Il11iIOOOIiuOiIiiLOLEOOII001EE\niOoO0LOulioE0OLIIIulli01OoiuOOOoOlEiI0EiiElIIu0\nlE1LOE1Oil\n1u0EOliIiIOl1u110il0l1O0u\n", "output": "Yes\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function that will return ```true``` if the input is in the following date time format ```01-09-2016 01:20``` and ```false``` if it is not.\n\nThis Kata has been inspired by the Regular Expressions chapter from t... | [{"input": "\"Tue Sep 06 2016 01:46:38 GMT+0100\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"01-09-2016 01;20\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"01_09_2016 01:20\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"Tenth of January\"", "output": "[false]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIf you have completed the Tribonacci sequence kata, you would know by now that mister Fibonacci has at least a bigger brother. If not, give it a quick look to get how things work.\n\nWell, time to expand the family a litt... | [{"input": "[0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n20", "output": "[[0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 1, 2, 4, 8, 16, 32, 64, 128]]", "fn_name": "Xbonacci"}, {"input": "[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n20", "output": "[[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256]]", "fn_name": "Xbonacci"}, {"i... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA number `n` is called `prime happy` if there is at least one prime less than `n` and the `sum of all primes less than n` is evenly divisible by `n`. Write `isPrimeHappy(n)` which returns `true` if `n` is `prime happy` el... | [{"input": "8", "output": "[false]", "fn_name": "is_prime_happy"}, {"input": "25", "output": "[true]", "fn_name": "is_prime_happy"}, {"input": "32", "output": "[true]", "fn_name": "is_prime_happy"}, {"input": "2", "output": "[false]", "fn_name": "is_prime_happy"}, {"input": "0", "output": "[false]", "fn_name": "is_prim... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nI have n tickets for a train with a rabbit. Each ticket is numbered from 0 to n − 1, and you can use the k ticket to go to p⋅ak + q⋅bk station.\n\nRabbit wants to go to the all-you-can-eat carrot shop at the station m sta... | [{"type": "stdin_stdout", "input": "6 279 2 5 26 14", "output": "117\n"}, {"type": "stdin_stdout", "input": "17 256 2 3 10 9", "output": "67\n"}, {"type": "stdin_stdout", "input": "6 323 2 12 8 9", "output": "182\n"}, {"type": "stdin_stdout", "input": "6 279 2 5 46 14", "output": "57\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNoora is a student of one famous high school. It's her final year in school — she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one.\n\... | [{"type": "stdin_stdout", "input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAssume there is an Ideal Random Number Generator which generates any real number between 0 and given integer. Two numbers are generated from the above generator using integer A and B, let's assume the numbers generated ar... | [{"type": "stdin_stdout", "input": "10 4 15", "output": "79/80"}, {"type": "stdin_stdout", "input": "12 2 6", "output": "1/12"}, {"type": "stdin_stdout", "input": "12 2 6", "output": "5/12"}, {"type": "stdin_stdout", "input": "10 4 13", "output": "1/2"}, {"type": "stdin_stdout", "input": "3 2 1", "output": "5/12"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob are playing a game on a matrix, consisting of $2$ rows and $m$ columns. The cell in the $i$-th row in the $j$-th column contains $a_{i, j}$ coins in it.\n\nInitially, both Alice and Bob are standing in a cel... | [{"type": "stdin_stdout", "input": "3\n3\n2 3 12\n2 10 0\n3\n-1 4 17\n3 9 0\n1\n4\n3\n", "output": "12\n12\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n2 3 12\n2 10 1\n3\n-1 4 17\n2 9 0\n1\n4\n3\n", "output": "12\n11\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n2 3 12\n2 10 2\n3\n-1 4 17\n3 5 0\n1\n4\n3\n", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \nNim is a well-known combinatorial game, based on removing stones from piles. In this problem, we'll deal with a similar game, which we'll cal... | [{"type": "stdin_stdout", "input": "3\n4\n1 2 4 12\n3\n2 3 3\n5\n1 3 3 3 3", "output": "First\nSecond\nSecond\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 2 4 12\n3\n1 3 3\n5\n1 3 3 3 3", "output": "First\nSecond\nSecond\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 2 8 13\n3\n3 1 3\n5\n1 3 1 3 3", "output": "Firs... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCosmic market, commonly known as Kozumike, is the largest coterie spot sale in the universe. Doujin lovers of all genres gather at Kozumike. In recent years, the number of visitors to Kozumike has been increasing. If ever... | [{"type": "stdin_stdout", "input": "5 5 4\n0 0 1\n0 0 0\n0 2 0\n1 1 1\n1 0 0\n5 5 5\n1 4 0\n0 1 1\n0 4 1\n1 3 0\n0 3 1\n5 5 5\n1 0 0\n0 3 1\n1 2 1\n0 4 0\n1 1 1\n0 0 0", "output": "5\n0\n13\n12\n"}, {"type": "stdin_stdout", "input": "5 14 5\n2 0 2\n0 0 0\n0 0 1\n1 2 1\n1 0 0\n5 5 5\n1 4 1\n0 1 1\n1 1 1\n1 3 0\n1 3 0\n5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement `String#digit?` (in Java `StringUtils.isDigit(String)`), which should return `true` if given object is a digit (0-9), `false` otherwise.\n\nWrite your solution by modifying this code:\n\n```python\ndef is_digit(... | [{"input": "\"1\\n0\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"1\\n\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"a5\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"14\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"\\\"\"", "output": "[false]", "fn_name": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays of integers $a_1, a_2, \\ldots, a_n$ and $b_1, b_2, \\ldots, b_n$.\n\nLet's define a transformation of the array $a$:\n\nChoose any non-negative integer $k$ such that $0 \\le k \\le n$.\n\nChoose ... | [{"type": "stdin_stdout", "input": "2\n10\n3 3 2 2 3 2 1 1 2 3\n3 3 2 1 2 3 2 3 1 1\n10\n1 1 3 1 2 2 1 3 3 3\n3 1 3 1 1 2 3 2 2 1\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "1\n10\n14 -91 -52 -82 -4 69 33 3 -46 81\n-45 15 -4 82 33 3 -90 -81 -51 69\n", "output": "YES\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given three points p1, p2, p, find the reflection point x of p onto p1p2.\n\n<image>\n\nConstraints\n\n* 1 ≤ q ≤ 1000\n* -10000 ≤ xi, yi ≤ 10000\n* p1 and p2 are not identical.\n\nInput\n\n\nxp1 yp1 xp2 yp2\nq\nxp0 yp... | [{"type": "stdin_stdout", "input": "0 0 3 -1\n3\n0 1\n4 20\n-1 2", "output": "-0.600000000 -0.800000000\n-8.800000000 -18.400000000\n-2.000000000 -1.000000000\n"}, {"type": "stdin_stdout", "input": "0 0 2 0\n3\n-1 1\n0 1\n1 1", "output": "-1.0000000000 -1.0000000000\n0.0000000000 -1.0000000000\n1.0000000000 -1.00000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata, you need to make a (simplified) LZ78 encoder and decoder.\n[LZ78](https://en.wikipedia.org/wiki/LZ77_and_LZ78#LZ78) is a dictionary-based compression method created in 1978. You will find a detailed explana... | [{"input": "\"ABCDDEFGABCDEDBBDEAAEDAEDCDABC\"", "output": "[\"0A0B0C0D4E0F0G1B3D0E4B2D10A1E4A10D9A2C\"]", "fn_name": "encoder"}, {"input": "\"ABBCBCABABCAABCAABBCAA\"", "output": "[\"0A0B2C3A2A4A6B6\"]", "fn_name": "encoder"}, {"input": "\"ABCABCABCABCABCABC\"", "output": "[\"0A0B0C1B3A2C4C7A6\"]", "fn_name": "encoder... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nUjan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. This time he found an old dusty graph theory notebook with a description of a graph.\n\nIt ... | [{"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 4\n5 7\n3 8\n3 10\n11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle X used to play a card game called \"24 Game\", but recently he has found it too easy. So he invented a new game.\n\nInitially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of t... | [{"type": "stdin_stdout", "input": "1000\n", "output": "YES\n1 * 2 = 2\n2 * 3 = 6\n6 * 4 = 24\n6 - 5 = 1\n24 * 1 = 24\n8 - 7 = 1\n24 * 1 = 24\n10 - 9 = 1\n24 * 1 = 24\n12 - 11 = 1\n24 * 1 = 24\n14 - 13 = 1\n24 * 1 = 24\n16 - 15 = 1\n24 * 1 = 24\n18 - 17 = 1\n24 * 1 = 24\n20 - 19 = 1\n24 * 1 = 24\n22 - 21 = 1\n24 * 1 = ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office.\n\nAll children love to cry loudly at the reception at the dentist. We enumerate th... | [{"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 "}, {"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImp likes his plush toy a lot.\n\n [Image] \n\nRecently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, ... | [{"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "No\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protected.\n\nThe pasture i... | [{"type": "stdin_stdout", "input": "10 10\n....W.W.W.\n.........S\n.S.S...S..\nW.......SS\n.W..W.....\n.W...W....\nS..S...S.S\n....W...S.\n..S..S.S.S\nSS.......S\n", "output": "Yes\nDDDDWDWDWD\nDDDDDDDDDS\nDSDSDDDSDD\nWDDDDDDDSS\nDWDDWDDDDD\nDWDDDWDDDD\nSDDSDDDSDS\nDDDDWDDDSD\nDDSDDSDSDS\nSSDDDDDDDS\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that removes every lone 9 that is inbetween 7s.\n\n```python\nseven_ate9('79712312') => '7712312'\nseven_ate9('79797') => '777'\n```\n\nInput: String\nOutput: String\n\nWrite your solution by modifying th... | [{"input": "\"165561786121789797\"", "output": "[\"16556178612178977\"]", "fn_name": "seven_ate9"}, {"input": "\"797 9 7\"", "output": "[\"77 9 7\"]", "fn_name": "seven_ate9"}, {"input": "\"7979797\"", "output": "[\"7777\"]", "fn_name": "seven_ate9"}, {"input": "\"17797a\"", "output": "[\"1777a\"]", "fn_name": "seven_a... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! \n\nMore formally, if you typed a word at second a and then the next word at second b, t... | [{"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n", "output": "2"}, {"type": "stdin_stdout", "input": "6 5\n1 5 8 14 19 20\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "5 10\n-1 1 22 32 34\n", "output": "3\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a long-established secondhand bookstore called JOI secondhand bookstore in your town, and you often use the JOI secondhand bookstore. Each book has a standard price, and you can buy it at that price if you go to ... | [{"type": "stdin_stdout", "input": "7 7\n4 1\n13 2\n18 3\n64 3\n13 2\n16 10\n11 2", "output": "147\n"}, {"type": "stdin_stdout", "input": "7 7\n4 1\n13 2\n12 3\n48 3\n8 2\n16 10\n11 2", "output": "120\n"}, {"type": "stdin_stdout", "input": "7 5\n4 1\n13 3\n12 3\n48 3\n8 3\n16 10\n11 2", "output": "109\n"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA monster is attacking the Cyberland!\n\nMaster Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).\n\nDuring the bat... | [{"type": "stdin_stdout", "input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100"}, {"type": "stdin_stdout", "input": "50 100 51\n100 100 100\n1 100 100\n", "output": "1384"}, {"type": "stdin_stdout", "input": "100 100 1\n100 100 100\n1 100 100\n", "output": "1891"}, {"type": "stdin_stdout", "input": "1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo celebrate today's launch of my Hero's new book: Alan Partridge: Nomad, We have a new series of kata arranged around the great man himself.\n\nGiven an array of terms, if any of those terms relate to Alan Partridge, ret... | [{"input": "[\"Grouse\", \"Partridge\", \"Pheasant\", \"Goose\", \"Starling\", \"Robin\", \"Thrush\", \"Emu\", \"PearTree\", \"Chat\", \"Dan\", \"Square\", \"Toblerone\", \"Lynn\", \"AlphaPapa\", \"BMW\", \"Graham\", \"Tool\", \"Nomad\", \"Finger\", \"Hamster\"]", "output": "[\"Mine's a Pint!!!!!!!!\"]", "fn_name": "pa... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. But it is not as easy as it sounds: the question Vladik face now is to find the cheapest way to get to the olympi... | [{"type": "stdin_stdout", "input": "16 4 12\n0000000011111111\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "16 1 12\n0000000011111111\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "16 1 12\n0100000011111111\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "16 2 12\n0100000011111111\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become... | [{"type": "stdin_stdout", "input": "2\n3 3 3 3 -3 3 2 -5 3 2 -5 -3 0\n3 5 3 -2 4 -3 -2 -2 -1 0", "output": "1 2 4 6\n2 1 3 8\n3 2 4 7\n4 1 3 5\n5 4 6 7\n6 1 5\n7 3 5 8\n8 2 7\n1 2 2 3 4\n2 1 1 3 4 4\n3 1 2 4\n4 1 2 2 3\n"}, {"type": "stdin_stdout", "input": "2\n3 3 3 3 -3 3 2 -5 3 2 -5 -3 0\n3 5 4 -2 4 -1 -2 -2 -1 0", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come up with a new game. Vova suggested to ... | [{"type": "stdin_stdout", "input": "12 -11 20 200\n11 189\n12 108\n19 190\n21 27\n24 193\n26 86\n26 123\n31 180\n39 196\n107 193\n122 46\n129 103\n131 129\n132 135\n142 51\n157 22\n161 27\n195 163\n198 55\n199 64\n", "output": "Anton\n"}, {"type": "stdin_stdout", "input": "12 -11 20 200\n11 189\n12 108\n19 190\n42 27\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nЗавтра у хоккейной команды, которой руководит Евгений, важный матч. Евгению нужно выбрать шесть игроков, которые выйдут на лед в стартовом составе: один вратарь, два защитника и три нападающих.\n\nТак как это стартовый со... | [{"type": "stdin_stdout", "input": "29 42 50\n605 254 369 842 889 103 937 235 135 698 482 883 738 467 848 70 1000 129 970 58 94 873 140 363 133 913 834 727 185\n17 676 703 245 149 296 800 106 153 111 285 382 12 704 830 664 30 533 604 380 469 155 216 466 36 347 270 170 10 349 86 5 164 599 517 593 373 461 908 34 569 573\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# The President's phone is broken\n\nHe is not very happy.\n\nThe only letters still working are uppercase ```E```, ```F```, ```I```, ```R```, ```U```, ```Y```.\n\nAn angry tweet is sent to the department responsible for ... | [{"input": "\"FIREYYFURYYFURYYFURRYFIRE\"", "output": "[\"You are fired! I am really furious. You are fired!\"]", "fn_name": "fire_and_fury"}, {"input": "\"FIREFIREFIREFIREFIRE\"", "output": "[\"You and you and you and you and you are fired!\"]", "fn_name": "fire_and_fury"}, {"input": "\"FURYFURYFURYFURYFURY\"", "outpu... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn order to pass the entrance examination tomorrow, Taro has to study for T more hours.\nFortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).\nWhile (X \\times t) hours ... | [{"type": "stdin_stdout", "input": "-1 011", "output": "-0.0909090909091\n"}, {"type": "stdin_stdout", "input": "1 106", "output": "0.00943396226415\n"}, {"type": "stdin_stdout", "input": "100 1\n", "output": "100.0000000000\n"}, {"type": "stdin_stdout", "input": "1 011", "output": "0.0909090909091\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPirates have notorious difficulty with enunciating. They tend to blur all the letters together and scream at people.\n\nAt long last, we need a way to unscramble what these pirates are saying.\n\nWrite a function that wil... | [{"input": "\"ortsp\"\n[\"sport\", \"parrot\", \"ports\", \"matey\"]", "output": "[[\"sport\", \"ports\"]]", "fn_name": "grabscrab"}, {"input": "\"oolp\"\n[\"donkey\", \"pool\", \"horse\", \"loop\"]", "output": "[[\"pool\", \"loop\"]]", "fn_name": "grabscrab"}, {"input": "\"ainstuomn\"\n[\"mountains\", \"hills\", \"mes... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlan's child can be annoying at times.\n\nWhen Alan comes home and tells his kid what he has accomplished today, his kid never believes him. \n\nBe that kid.\n\nYour function 'AlanAnnoyingKid' takes as input a sentence sp... | [{"input": "\"Today I didn't attempt to hardcode this Kata.\"", "output": "[\"I don't think you didn't attempt to hardcode this Kata today, I think you did attempt it!\"]", "fn_name": "alan_annoying_kid"}, {"input": "\"Today I learned to code like a pro.\"", "output": "[\"I don't think you learned to code like a pro to... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAny resemblance to any real championship and sport is accidental.\n\nThe Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local champi... | [{"type": "stdin_stdout", "input": "MYCXFLPTHVGWDSRXCOI BERLAND 5:9\nSPSHVVQLXQNRUB BERLAND 0:5\nSPSHVVQLXQNRUB MYCXFLPTHVGWDSRXCOI 4:6\nZPIIZCGCLCHNLIXCPBRM MYCXFLPTHVGWDSRXCOI 7:5\nZPIIZCGCLCHNLIXCPBRM SPSHVVQLXQNRUB 3:9\n", "output": "1:0"}, {"type": "stdin_stdout", "input": "VJWNNQCMHKJVXAPRVAD BERLAND 9:3\nVJWNNQC... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has recently bought some land and decided to surround it with a wooden fence.\n\nHe went to a company called \"Wooden board\" that produces wooden boards for fences. Vasya read in the catalog of products that the co... | [{"type": "stdin_stdout", "input": "100 3000\n1 4\n2 1\n3 3\n1 1\n5 4\n4 1\n2 1\n5 4\n1 1\n3 3\n4 3\n3 4\n4 2\n2 4\n1 2\n3 4\n5 3\n1 4\n2 4\n4 5\n1 2\n5 2\n2 2\n3 2\n4 4\n1 4\n5 5\n3 4\n4 1\n3 3\n5 2\n3 3\n4 1\n1 5\n4 3\n5 3\n4 2\n3 3\n3 5\n5 1\n5 1\n3 3\n4 3\n1 3\n4 1\n2 3\n1 3\n1 2\n5 5\n5 2\n1 5\n4 2\n1 1\n1 1\n1 2\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolate out of boredom.\n\nA bar of chocolate can be presented as an n × n table, where each cell represents one piece... | [{"type": "stdin_stdout", "input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"type": "stdin_stdout", "input": "10 10\n5 6 U\n4 7 U\n8 3 L\n8 3 L\n1 10 U\n9 2 U\n10 1 L\n10 1 L\n8 3 U\n8 3 U\n", "output": "6\n7\n3\n0\n10\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with the same task if you... | [{"type": "stdin_stdout", "input": "925819493 47350513 28377591 119226256 49881078\n", "output": "510796638\n"}, {"type": "stdin_stdout", "input": "930064129 32726326 25428197 158103592 64501049\n", "output": "355994758\n"}, {"type": "stdin_stdout", "input": "930064129 32726326 25428197 83013449 64501049\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.\n... | [{"type": "stdin_stdout", "input": "25\n26668 10412 12658\n25216 11939 10247\n28514 22515 5833\n4955 19029 22405\n12552 6903 19634\n12315 1671 505\n20848 9175 6060\n12990 5827 16433\n9184 30621 25596\n31818 7826 11221\n18090 4476 30078\n30915 11014 16950\n3119 29529 21390\n775 4290 11723\n29679 14840 3566\n4491 29480 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string s and m queries. For each query delete the K-th occurence of a character x.\n\nInput:\nThe first line contains the string s followed by an integer m.\nThe string consists of lowercase letters.\nAfter that m... | [{"type": "stdin_stdout", "input": "bcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacabbcbccaacab\n40\n37 c\n21 a\n18 a\n5 b\n1 a\n8 c\n9 a\n38 c\n10 b\n12 c\n18 a\n23 a\n20 c\n7 b\n33 c\n4 c\n22 c\n28 c\n9 a\n12 a\n22 a\n1 b\n6 a\n31 c\n19 b\n19 a\n15 a\n6 c\n11 c\n18 b\n19 c\n24... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a grid with n rows and m columns. Every cell of the grid should be colored either blue or yellow.\n\nA coloring of the grid is called stupid if every row has exactly one segment of blue cells and every column has... | [{"type": "stdin_stdout", "input": "1848 1937\n", "output": "337952422\n"}, {"type": "stdin_stdout", "input": "2000 2000\n", "output": "111024599\n"}, {"type": "stdin_stdout", "input": "2021 2021\n", "output": "138387540\n"}, {"type": "stdin_stdout", "input": "1001 1000\n", "output": "450544063\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe three friends, Kuro, Shiro, and Katie, met up again! It's time for a party...\n\nWhat the cats do when they unite? Right, they have a party. Since they wanted to have as much fun as possible, they invited all their fr... | [{"type": "stdin_stdout", "input": "1000 843\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "1000 488\n", "output": "488\n"}, {"type": "stdin_stdout", "input": "1000 843\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "1000 488\n", "output": "488\n"}, {"type": "stdin_stdout", "input": "1000 733\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWelcome\n\nThis kata is inspired by This Kata\n\n\nWe have a string s\n\nWe have a number n\n\nHere is a function that takes your string, concatenates the even-indexed chars to the front, odd-indexed chars to the back.\n\... | [{"input": "\"this_test_will_hurt_you\"\n12345678987654321", "output": "[\"ti_etwl_utyuhsts_ilhr_o\"]", "fn_name": "jumbled_string"}, {"input": "\"codingisfornerdsyounerd\"\n10101010", "output": "[\"criyinodedsgufrnodnoser\"]", "fn_name": "jumbled_string"}, {"input": "\"better example\"\n2", "output": "[\"bexltept mera... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a mysterious language (codenamed \"Secret\") available in \"Custom Invocation\" tab. Figure out what this language is and write a program which prints its name. Note that the program must be written in this ... | [{"type": "stdin_stdout", "input": "-111\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-165\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-137\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-116\n", "output": "INTERCAL\n"}, {"type": "stdin_stdout", "input": "-14\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce at a team training Vasya, Petya and Sasha got a problem on implementing linear search in an array.\n\nAccording to the boys, linear search works as follows. The array elements in a pre-selected order are in turn comp... | [{"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 9 2 9 2 10 9 8\n", "output": "40 59\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n3 1 9 2 9 2 10 9 8\n", "output": "43 56\n"}, {"type": "stdin_stdout", "input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 6 2 9 2 10 9 8\n", "output": "42 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each co... | [{"type": "stdin_stdout", "input": "-841 -205\n590 -205\n-1000 -1000\n-364 1385\n-682 113\n-841 -1000\n-1000 -205\n908 1067\n", "output": "YES\n2 4 5 8 \n1 3 6 7 \n"}, {"type": "stdin_stdout", "input": "-850 -1000\n-475 -325\n1025 800\n-325 575\n-325 -850\n-1000 -475\n-100 -775\n1250 -550\n", "output": "YES\n1 2 5 6 \n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently, Masha was presented with a chessboard with a height of $n$ and a width of $m$.\n\nThe rows on the chessboard are numbered from $1$ to $n$ from bottom to top. The columns are numbered from $1$ to $m$ from left to... | [{"type": "stdin_stdout", "input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 4\n2 2 3 3\n3 1 4 3\n1 5\n1 1 3 1\n3 1 5 1\n6 4\n1 1 4 2\n1 3 4 4\n3 4\n1 2 4 2\n2 1 3 3\n", "output": "0 4\n4 8\n2 3\n12 12\n4 8\n"}, {"type": "stdin_stdout", "input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 5\n2 2 3 2\n3 1 4 3\n1 5\n1 1 5 1\n3 1 5 1\n4 4\n1 1 4 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPositive integers have so many gorgeous features. \nSome of them could be expressed as a sum of two or more consecutive positive numbers.\n___\n\n# Consider an Example :\n\n* `10` , could be expressed as a sum of `1 + 2 +... | [{"input": "5263987", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "382131", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "118070", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "32768", "output": "[false]", "fn_name": "consecutive_ducks"}, {"input": "161997", "outpu... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGoa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis land. In order to save his ... | [{"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n7 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n5 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel... | [{"type": "stdin_stdout", "input": "25\n1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976\n", "output": "999975\n"}, {"type": "stdin_stdout", "input": "25\n58115 794098 753382 484882 238434 6742... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled \"a\" to \"z\", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos bein... | [{"type": "stdin_stdout", "input": "xulsyfkuizjauadjjopu\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "cskgsxywlvfeicoueglr\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "gggggggggggggggggggg\n", "output": "526\n"}, {"type": "stdin_stdout", "input": "qdqdddqddqqddqddqdqd\n", "output": "526\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe snail crawls up the column. During the day it crawls up some distance. During the night she sleeps, so she slides down for some distance (less than crawls up during the day).\n\nYour function takes three arguments:\n1... | [{"input": "100\n20\n5", "output": "[7]", "fn_name": "snail"}, {"input": "10\n3\n1", "output": "[5]", "fn_name": "snail"}, {"input": "10\n3\n2", "output": "[8]", "fn_name": "snail"}, {"input": "5\n10\n3", "output": "[1]", "fn_name": "snail"}, {"input": "3\n2\n1", "output": "[2]", "fn_name": "snail"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKarafs is some kind of vegetable in shape of an 1 × h rectangle. Tavaspolis people love Karafs and they use Karafs in almost any kind of food. Tavas, himself, is crazy about Karafs.\n\n<image>\n\nEach Karafs has a positiv... | [{"type": "stdin_stdout", "input": "469 128038 4\n143 914502 747\n74 1244223 74477\n835 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "469 128038 4\n82 914502 747\n80 1244223 74477\n1360 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life «interesting graph and apples». An undirected graph is called interesting, if each of i... | [{"type": "stdin_stdout", "input": "50 21\n27 16\n42 35\n15 28\n46 17\n30 39\n47 18\n35 25\n26 24\n24 30\n28 41\n40 38\n11 21\n33 20\n43 10\n37 14\n1 43\n32 49\n49 6\n10 45\n21 50\n39 3\n", "output": "YES\n29\n1 2\n2 3\n4 5\n4 6\n5 7\n7 8\n8 9\n9 11\n12 13\n12 14\n13 15\n16 17\n18 19\n19 20\n22 23\n22 25\n23 26\n27 29\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA priority queue is a data structure which maintains a set $S$ of elements, each of with an associated value (key), and supports the following operations:\n\n* $insert(S, k)$: insert an element $k$ into the set $S$\n* $ex... | [{"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": "Solve the following coding problem using the programming language python:\n\nA ticket is a string consisting of six digits. A ticket is considered lucky if the sum of the first three digits is equal to the sum of the last three digits. Given a ticket, output if it is lucky or not. Note that a tick... | [{"type": "stdin_stdout", "input": "5\n213132\n973894\n045207\n000000\n055776\n", "output": "YES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "2\n193758\n123456\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n192758\n123456\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "1\n11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $n$ ($n \\ge 0$) represented with $k$ digits in base (radix) $b$. So,\n\n$$n = a_1 \\cdot b^{k-1} + a_2 \\cdot b^{k-2} + \\ldots a_{k-1} \\cdot b + a_k.$$\n\nFor example, if $b=17, k=3$ and $a=[11... | [{"type": "stdin_stdout", "input": "97 100\n93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTask:\nGiven an array arr of strings complete the function landPerimeter by calculating the total perimeter of all the islands. Each piece of land will be marked with 'X' while the water fields are represented as 'O'. Con... | [{"input": "[\"OXOOOX\", \"OXOXOO\", \"XXOOOX\", \"OXXXOO\", \"OOXOOX\", \"OXOOOO\", \"OOXOOX\", \"OOXOOO\", \"OXOOOO\", \"OXOOXX\"]", "output": "[\"Total land perimeter: 60\"]", "fn_name": "land_perimeter"}, {"input": "[\"OXOOO\", \"OOXXX\", \"OXXOO\", \"XOOOO\", \"XOOOO\", \"XXXOO\", \"XOXOO\", \"OOOXO\", \"OXOOX\", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSergei B., the young coach of Pokemons, has found the big house which consists of n flats ordered in a row from left to right. It is possible to enter each flat from the street. It is possible to go out from each flat. Al... | [{"type": "stdin_stdout", "input": "100\nfAfhfNNNhfffAfNffNANhffNffffffNfffffhNfffNfefNfffNfNNNffNfffNfhNNNffffNfNfffAffNffNffNNfhfffNhNffNNN\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "100\nfAfhfNNNhfffAfNffNANhffNffffffNfffffhNfffNfffNfffNfNNNffNfffNfhNNNffffNfNfffAffNffNffNNfhfffNhNffNNN\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer found N rectangle lying on the table, each with height 1.\nIf we consider the surface of the desk as a two-dimensional plane, the i-th rectangle i(1≤i≤N) covers the vertical range of [i-1,i] and the hori... | [{"type": "stdin_stdout", "input": "5\n999999999 1000000000\n1 2\n314 315\n500000 500001\n999999999 1000000000\n", "output": "1999999680\n"}, {"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 106\n500000 500001\n999999999 1000000000", "output": "1999999892\n"}, {"type": "stdin_stdout", "input": "5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup ... | [{"type": "stdin_stdout", "input": "4\n-71868244 -24941524 -24941524 -24941524 -24941524 -24941524 -24941524 -6170836 21985196 21985196 21985196 21985196 40755884 40755884 40755884 68911916\n", "output": "12858032\n-24941524 -71868244 68911916 40755884\n21985196 40755884 -24941524 -24941524\n40755884 21985196 -24941524... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCurrently, people's entertainment is limited to programming contests. The activity of the entertainment club of a junior high school to which she belongs is to plan and run a programming contest. Her job is not to create ... | [{"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 1 0 1 3 1\n0 2 0 2 -1 0\n0 0 1 1 0 7\n2 0 0 1 0 0\n0 0 0 0 0 0", "output": "1\n0\n1\n1\n3\n0\n2\n1\n"}, {"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 0 0 1 3 1\n0 2 0 2 -1 0\n0 0 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\n* F... | [{"type": "stdin_stdout", "input": "15 1\n4 1 4 0 6 9 2 6 5 3 5 7 9 1 9", "output": "No\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\nYes\nYes\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "15 1\n3 0 8 1 6 9 1 6 5 5 9 7 2 7 16", "output": "No\nYes\nNo\nYes\nYes\nNo\nYes\nNo\nNo\nYes\nNo\nNo\nYes\nYes\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA plurality of trampolines are arranged in a line at 10 m intervals. Each trampoline has its own maximum horizontal distance within which the jumper can jump safely. Starting from the left-most trampoline, the jumper jump... | [{"type": "stdin_stdout", "input": "4\n163\n51\n2\n32", "output": "yes\n"}, {"type": "stdin_stdout", "input": "4\n001\n103\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n136\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n155\n-1\n0", "output": "no\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata you should simply determine, whether a given year is a leap year or not. In case you don't know the rules, here they are:\n\n* years divisible by 4 are leap years\n* but years divisible by 100 are **not** lea... | [{"input": "1234", "output": "[false]", "fn_name": "isLeapYear"}, {"input": "1100", "output": "[false]", "fn_name": "isLeapYear"}, {"input": "1194", "output": "[false]", "fn_name": "isLeapYear"}, {"input": "1984", "output": "[true]", "fn_name": "isLeapYear"}, {"input": "2000", "output": "[true]", "fn_name": "isLeapYear... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnn has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a special ticket for m rides (she can buy it several times). It costs b rubles. A... | [{"type": "stdin_stdout", "input": "1000 1 1000 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000 1 1000 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000 3 1000 1000\n", "output": "334000\n"}, {"type": "stdin_stdout", "input": "1000 3 1000 1000\n", "output": "334000\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.\n\n-----Constraints-----\n - C is a lowercase English letter that is not z.\n\n-----Input-----\nInput is given fr... | [{"type": "stdin_stdout", "input": "a\n", "output": "b\n"}, {"type": "stdin_stdout", "input": "y\n", "output": "z\n"}, {"type": "stdin_stdout", "input": "c\n", "output": "d\n"}, {"type": "stdin_stdout", "input": "p\n", "output": "q\n"}, {"type": "stdin_stdout", "input": "d\n", "output": "e\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are an integer N and four characters c_{\\mathrm{AA}}, c_{\\mathrm{AB}}, c_{\\mathrm{BA}}, and c_{\\mathrm{BB}}.\nHere, it is guaranteed that each of those four characters is A or B.\nSnuke has a string s, which is ... | [{"type": "stdin_stdout", "input": "1000\nB\nA\nA\nA\n", "output": "589888339\n"}, {"type": "stdin_stdout", "input": "1000\nA\nB\nA\nA\n", "output": "336052903\n"}, {"type": "stdin_stdout", "input": "1000\nB\nB\nA\nA\n", "output": "336052903\n"}, {"type": "stdin_stdout", "input": "1000\nB\nA\nB\nA\n", "output": "336052... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn autumn sports festival is held. There are four events: foot race, ball-carrying, obstacle race, and relay. There are n teams participating, and we would like to commend the team with the shortest total time in this 4th... | [{"type": "stdin_stdout", "input": "8\n65541 3 20 3 8 6 27 2 25\n20941 3 5 2 41 7 19 2 42\n90585 4 8 3 12 11 46 2 34\n92201 3 28 2 47 6 37 2 58\n10001 3 50 2 42 7 12 4 54\n63812 4 11 3 11 6 98 2 22\n54092 3 33 2 54 6 18 2 19\n25012 3 44 2 58 6 45 2 46\n4\n1 3 23 1 23 1 34 4 69\n2 5 12 2 12 3 41 2 29\n3 5 24 1 24 2 0 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given nonnegative integers a and b (a ≤ b), and a positive integer x.\nAmong the integers between a and b, inclusive, how many are divisible by x?\n\n-----Constraints-----\n - 0 ≤ a ≤ b ≤ 10^{18}\n - 1 ≤ x ≤ 10^{1... | [{"type": "stdin_stdout", "input": "1 1000000000000000000 3\n", "output": "333333333333333333\n"}, {"type": "stdin_stdout", "input": "-1 1010010100000100000 4", "output": "252502525000025001\n"}, {"type": "stdin_stdout", "input": "-1 1010010110000100000 3", "output": "336670036666700001\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou were dreaming that you are traveling to a planet named Planetforces on your personal spaceship. Unfortunately, its piloting system was corrupted and now you need to fix it in order to reach Planetforces.\n\nSpace can ... | [{"type": "stdin_stdout", "input": "6\n10 5\nRRRRRRRRRRUUUUU\n1 -1\nUDDDRLLL\n-3 -5\nLDLDLDDDR\n-1 2\nUULLLL\n6 -2\nRDULRLLDR\n-1 6\nRUDURUUUUR\n", "output": "YES\nYES\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "6\n10 5\nRRRRRRRRRRUUUUU\n1 -1\nUDDDRLLL\n-3 -5\nLDLDLDDDR\n0 2\nUULLLL\n6 -2\nRDULRLLDR\n-1 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter his wife's tragic death, Eurydice, Orpheus descended to the realm of death to see her. Reaching its gates was uneasy, but passing through them proved to be even more challenging. Mostly because of Cerberus, the thre... | [{"type": "stdin_stdout", "input": "7\nbabba\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "\n1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nbabba\nabaac\ncodeforces\nzeroorez\nabcdcba\nbbbbbbb\na\n", "output": "1\n1\n0\n1\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "7\nabbab\nabaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYet another round on DecoForces is coming! Grandpa Maks wanted to participate in it but someone has stolen his precious sofa! And how can one perform well with such a major loss?\n\nFortunately, the thief had left a note ... | [{"type": "stdin_stdout", "input": "6\n10 10\n3 6 3 7\n4 9 5 9\n5 4 5 3\n7 1 8 1\n9 10 8 10\n7 7 7 8\n0 5 2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n10 10\n3 6 3 7\n4 9 5 9\n5 4 5 3\n7 1 8 1\n9 10 8 10\n7 7 7 8\n0 5 2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n4 6\n4 3 3 3\n4 2 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nn evenly spaced points have been marked around the edge of a circle. There is a number written at each point. You choose a positive real number k. Then you may repeatedly select a set of 2 or more points which are evenly ... | [{"type": "stdin_stdout", "input": "488\n453349582488862562152454328120974624021885842759505659322561694358728150516204337664755243733316681382547751353198982127441183878962690095592236469807087207161691714104527568781618875688104415243715506909284770554256616642020503116458540489226220383015748323400356936736149732496... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which solve a simultaneous equation:\n\nax + by = c\ndx + ey = f\n\nThe program should print x and y for given a, b, c, d, e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000). You can suppose that given equation h... | [{"type": "stdin_stdout", "input": "3 -1 -3 1 0 -3\n2 -1 -3 -9 18 27", "output": "-3.000 -6.000\n-1.000 1.000\n"}, {"type": "stdin_stdout", "input": "3 -2 -3 1 0 -3\n2 -1 -3 -9 18 27", "output": "-3.000 -3.000\n-1.000 1.000\n"}, {"type": "stdin_stdout", "input": "3 -1 -3 1 0 -3\n2 -1 -3 -9 13 27", "output": "-3.000 -6.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $a$, consisting of $n$ characters, $n$ is even. For each $i$ from $1$ to $n$ $a_i$ is one of 'A', 'B' or 'C'.\n\nA bracket sequence is a string containing only characters \"(\" and \")\". A regular ... | [{"type": "stdin_stdout", "input": "28\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nBBBBAC\nABCA\nAABBAC\nCACA\nAABBAC\nCACA\n", "output": "YES\nYES\nNO\nNO\nYES\nYES\nNO\nNO\nYES\nYES\nNO\nNO\nYES\nYES\nNO\nNO... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought $n$ integers, now it's time to distribute them between his friends rationally...\n\nLee has $n$ integers $a_1, a_2, \\... | [{"type": "stdin_stdout", "input": "3\n4 2\n1 13 7 17\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 1000000000\n1 1 1 1\n", "output": "48\n42\n8000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 2\n1 13 12 1\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 10000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nM-kun is a competitor in AtCoder, whose highest rating is X.\nIn this site, a competitor is given a kyu (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given:\n\n* Fr... | [{"type": "stdin_stdout", "input": "1359", "output": "4\n"}, {"type": "stdin_stdout", "input": "1855", "output": "1\n"}, {"type": "stdin_stdout", "input": "1485", "output": "3\n"}, {"type": "stdin_stdout", "input": "1125", "output": "5\n"}, {"type": "stdin_stdout", "input": "1764", "output": "2\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers. Each $a_i$ is one of the six following numbers: $4, 8, 15, 16, 23, 42$.\n\nYour task is to remove the minimum number of elements to make this array good.\n\nAn array ... | [{"type": "stdin_stdout", "input": "100\n4 42 23 23 16 42 16 23 42 16 42 8 4 23 4 4 23 42 16 42 23 23 23 42 4 42 8 8 16 23 15 23 16 4 42 15 15 23 16 15 16 4 4 15 23 42 42 15 8 23 8 23 4 15 16 15 42 8 23 16 15 42 23 8 4 16 15 16 23 16 16 4 23 16 8 23 16 15 23 4 4 8 15 4 4 15 8 23 23 4 4 8 8 4 42 15 4 4 42 16\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohn has some amount of money of which he wants to deposit a part `f0` to the bank at the beginning\nof year `1`. He wants to withdraw each year for his living an amount `c0`.\n\nHere is his banker plan:\n\n- deposit `f0`... | [{"input": "100000000\n1.5\n10000000\n50\n1", "output": "[false]", "fn_name": "fortune"}, {"input": "9998.5\n61.8155\n10000.0\n3\n0", "output": "[false]", "fn_name": "fortune"}, {"input": "9999\n61.8161\n10000.0\n3\n0", "output": "[false]", "fn_name": "fortune"}, {"input": "100000000\n5\n1000000\n50\n1", "output": "[tr... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nManao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either stays pressed into the... | [{"type": "stdin_stdout", "input": "2000\n", "output": "1333335000\n"}, {"type": "stdin_stdout", "input": "1999\n", "output": "1331335999\n"}, {"type": "stdin_stdout", "input": "1837\n", "output": "1033182073\n"}, {"type": "stdin_stdout", "input": "2000\n", "output": "1333335000\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe next lecture in a high school requires two topics to be discussed. The $i$-th topic is interesting by $a_i$ units for the teacher and by $b_i$ units for the students.\n\nThe pair of topics $i$ and $j$ ($i < j$) is cal... | [{"type": "stdin_stdout", "input": "14\n137698508 528184026 54130884 239033739 1038011779 720680829 605286542 89272810 284191042 179359950 186766648 570400677 107541072 25121211\n195343970 709242622 422954170 980941827 265963618 812646456 943660193 344102432 295006337 221455256 203711937 632473368 334173424 49206958\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt has been noted that if some ants are put in the junctions of the graphene integer lattice then they will act in the following fashion: every minute at each junction (x, y) containing at least four ants a group of four ... | [{"type": "stdin_stdout", "input": "30000 39\n2650 -1515\n-3169 4818\n-1896 2727\n1323 -2335\n-387 901\n-4299 1481\n-2114 4435\n3654 -2730\n4569 3801\n-3815 -3355\n4777 1749\n4486 -780\n-3936 -158\n717 -3518\n4765 -909\n-3032 3726\n-2970 3346\n2067 -1560\n-521 -1331\n-4953 -2098\n-849 580\n-4941 4018\n1338 -2629\n-1444... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a list of numbers from $1$ to $n$ written from left to right on the blackboard.\n\nYou perform an algorithm consisting of several steps (steps are $1$-indexed). On the $i$-th step you wipe the $i$-th number (cons... | [{"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n4 2\n69 6\n", "output": "2\n4\n12\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '$\\sqrt{}$' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels ... | [{"type": "stdin_stdout", "input": "6723\n", "output": "2\n17\n46\n97\n176\n289\n442\n641\n892\n1201\n1574\n2017\n2536\n3137\n3826\n4609\n5492\n6481\n7582\n8801\n10144\n11617\n13226\n14977\n16876\n18929\n21142\n23521\n26072\n28801\n31714\n34817\n38116\n41617\n45326\n49249\n53392\n57761\n62362\n67201\n72284\n77617\n8320... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the State of Takahashi in AtCoderian Federation, there are N cities, numbered 1, 2, ..., N.\nM bidirectional roads connect these cities.\nThe i-th road connects City A_i and City B_i.\nEvery road connects two distinct ... | [{"type": "stdin_stdout", "input": "10 39\n7 2\n7 1\n5 6\n5 8\n9 10\n2 8\n8 7\n3 10\n10 1\n8 10\n2 3\n7 4\n3 9\n4 10\n3 4\n6 1\n6 7\n9 5\n9 7\n6 9\n9 4\n4 6\n7 5\n8 3\n2 5\n9 2\n10 7\n8 6\n8 9\n7 3\n5 3\n4 5\n6 3\n2 10\n5 10\n4 2\n6 2\n8 4\n10 6\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "10 39\n7 2\n7 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe will call a non-negative integer increasing if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, 1558, 11, 3 and 0 are al... | [{"type": "stdin_stdout", "input": "3704579452095997258280591217784156184311155893966777597430447796450532", "output": "32\n"}, {"type": "stdin_stdout", "input": "4271374355872521214646189206931447259915557225329718337053006899386612", "output": "33\n"}, {"type": "stdin_stdout", "input": "463636595558318557723662913943... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.\n\nThe interior of the square is consider... | [{"type": "stdin_stdout", "input": "-17 -91 -17 -27 -81 -27 -81 -91\n-48 -21 -12 -57 -48 -93 -84 -57\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 -99 -99 -99 -99 -100\n-10 -10 -9 -9 -10 -8 -11 -9\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-100 -100 -100 100 100 100 100 -100\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe following sorting operation is repeated for the stacked blocks as shown in Fig. A.\n\n1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step ... | [{"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": "Solve the following coding problem using the programming language python:\n\nTranslator's note: in Russia's most widespread grading system, there are four grades: 5, 4, 3, 2, the higher the better, roughly corresponding to A, B, C and F respectively in American grading system.\n\nThe term is comin... | [{"type": "stdin_stdout", "input": "100\n3 2 4 3 3 3 4 2 3 5 5 2 5 2 3 2 4 4 4 5 5 4 2 5 4 3 2 5 3 4 3 4 2 4 5 4 2 4 3 4 5 2 5 3 3 4 2 2 4 4 4 5 4 3 3 3 2 5 2 2 2 3 5 4 3 2 4 5 5 5 2 2 4 2 3 3 3 5 3 2 2 4 5 5 4 5 5 4 2 3 2 2 2 2 5 3 5 2 3 4\n", "output": "40\n"}, {"type": "stdin_stdout", "input": "100\n2 2 2 2 2 2 2 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCompute A \\times B.\n\n-----Constraints-----\n - 1 \\leq A \\leq 100\n - 1 \\leq B \\leq 100\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Input in the following format:\nA B\n\n-... | [{"type": "stdin_stdout", "input": "100 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "101 110", "output": "11110\n"}, {"type": "stdin_stdout", "input": "101 111", "output": "11211\n"}, {"type": "stdin_stdout", "input": "101 101", "output": "10201\n"}, {"type": "stdin_stdout", "input": "100 110", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTonio has a keyboard with only two letters, \"V\" and \"K\".\n\nOne day, he has typed out a string s with only these two letters. He really likes it when the string \"VK\" appears, so he wishes to change at most one lette... | [{"type": "stdin_stdout", "input": "VVKKVKKVVKKVKKVKVVKKVKKVVKKVKVVKKVKKVKVVKKVVKKVKVVKKVKVVKKVVKVVKKVKKVKKVKKVKKVKVVKKVKKVKKVKKVKKVVKVK\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "VVVVVKKVKVKVKVVKVVKKVVKVKKKKKKKVKKKVVVVVVKKVVVKVKVVKVKKVVKVVVKKKKKVVVVVKVVVVKVVVKKVKKVKKKVKKVKKVVKKV\n", "output": "25\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\nWe know that some numbers can be split into two primes. ie. `5 = 2 + 3, 10 = 3 + 7`. But some numbers are not. ie. `17, 27, 35`, etc.. \n\nGiven a positive integer `n`. Determine whether it can be split into two p... | [{"input": "100", "output": "[2491]", "fn_name": "prime_product"}, {"input": "10", "output": "[25]", "fn_name": "prime_product"}, {"input": "12", "output": "[35]", "fn_name": "prime_product"}, {"input": "20", "output": "[91]", "fn_name": "prime_product"}, {"input": "7", "output": "[10]", "fn_name": "prime_product"}, {"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to th... | [{"type": "stdin_stdout", "input": "100\n27 95 57 29 91 85 83 36 72 86 39 5 79 61 78 93 100 97 73 23 82 66 41 92 38 92 100 96 48 23 66 47 5 32 69 13 95 23 46 62 99 83 57 66 98 82 81 57 37 37 81 64 45 76 72 43 99 76 86 22 37 39 93 80 99 36 53 83 3 32 52 9 78 34 47 100 33 72 19 40 29 56 77 32 79 72 15 88 100 98 56 50 22 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya thinks that lucky tickets are the tickets whose numbers are divisible by 3. He gathered quite a large collection of such tickets but one day his younger brother Leonid was having a sulk and decided to destroy the co... | [{"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 84393937 43832346\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\n146767769 71795210 50866429 35232438 22664883 56785812 91050433 75677099 18053121 43832346\n", "output": "4\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.\nGiven an integer N, determine whether it is a Harshad number.\n\n-----Constraints-----\... | [{"type": "stdin_stdout", "input": "12\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "148\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "112", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "224", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "133", "output": "Yes\n"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Story&Task\n There are three parties in parliament. The \"Conservative Party\", the \"Reformist Party\", and a group of independants.\n\n You are a member of the “Conservative Party” and you party is trying to pass a bi... | [{"input": "13\n4\n7", "output": "[-1]", "fn_name": "pass_the_bill"}, {"input": "11\n4\n6", "output": "[-1]", "fn_name": "pass_the_bill"}, {"input": "16\n7\n8", "output": "[-1]", "fn_name": "pass_the_bill"}, {"input": "16\n1\n8", "output": "[-1]", "fn_name": "pass_the_bill"}, {"input": "11\n4\n1", "output": "[2]", "fn_... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn army of n droids is lined up in one row. Each droid is described by m integers a_1, a_2, ..., a_{m}, where a_{i} is the number of details of the i-th type in this droid's mechanism. R2-D2 wants to destroy the sequence ... | [{"type": "stdin_stdout", "input": "49 2 1971\n794 866\n401 575\n341 83\n103 208\n352 134\n260 878\n497 931\n630 570\n885 464\n23 663\n60 1461\n416 870\n955 405\n392 961\n530 258\n73 404\n736 923\n44 436\n594 314\n904 138\n980 163\n76 720\n879 809\n81 838\n263 599\n218 139\n659 493\n1044 754\n679 302\n490 7\n204 530\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a game called Packet Monster. A game that catches, raises, fights and exchanges monsters, and is very popular all over Japan. Of course, in my class. That's why I also raise monsters so that I can play with every... | [{"type": "stdin_stdout", "input": "10\n4 17 1 9 5 18 2 3 2 1\n8 12 6 5 10 5 4 4 7 6\n5\n4 3 2 1 1\n2 4 4 4 4\n4\n1 1 3 2\n5 3 2 1\n0", "output": "1\nNA\nNA\n"}, {"type": "stdin_stdout", "input": "10\n4 17 1 9 5 18 2 3 2 1\n8 12 6 5 10 5 4 4 7 6\n5\n4 3 2 1 1\n2 4 4 4 4\n4\n2 1 3 2\n5 3 2 1\n0", "output": "1\nNA\nNA\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a game, wherein the player has to guess a target word. All the player knows is the length of the target word.\n\nTo help them in their goal, the game will accept guesses, and return the number of letters that are... | [{"input": "\"abcde\"\n\"abcde\"", "output": "[5]", "fn_name": "count_correct_characters"}, {"input": "\"same\"\n\"same\"", "output": "[4]", "fn_name": "count_correct_characters"}, {"input": "\"dog\"\n\"car\"", "output": "[0]", "fn_name": "count_correct_characters"}, {"input": "\"dog\"\n\"god\"", "output": "[1]", "fn_n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNew Year is coming! Vasya has prepared a New Year's verse and wants to recite it in front of Santa Claus.\n\nVasya's verse contains $n$ parts. It takes $a_i$ seconds to recite the $i$-th part. Vasya can't change the order... | [{"type": "stdin_stdout", "input": "1\n50 1\n2 1 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 1... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.