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\nNN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles: [Image] \n\nIt turned out... | [{"type": "stdin_stdout", "input": "249 35\n", "output": "0.44721996534695957\n"}, {"type": "stdin_stdout", "input": "87 010\n", "output": "0.37454615226200993\n"}, {"type": "stdin_stdout", "input": "101 100\n", "output": "3.2098109040106433\n"}, {"type": "stdin_stdout", "input": "263 35\n", "output": "0.42312695404372... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn atom of element X can exist in n distinct states with energies E1 < E2 < ... < En. Arkady wants to build a laser on this element, using a three-level scheme. Here is a simplified description of the scheme. \n\nThree di... | [{"type": "stdin_stdout", "input": "50 42\n257 258 350 375 1014 1017 1051 1097 1169 1177 1223 1836 1942 1983 2111 2131 2341 2418 2593 2902 2948 3157 3243 3523 3566 4079 4499 4754 5060 5624 6279 6976 7011 7071 7278 7366 7408 7466 7526 7837 7934 8532 8577 8680 9221 9271 9327 9411 9590 9794\n", "output": "0.918918918919\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every $a$ and $b$ such that $1 \\leq a \\leq b \\leq 6$, there is exactly one domino with $a$ dots on one half and $b$ dots on... | [{"type": "stdin_stdout", "input": "7 21\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n4 5\n4 6\n4 7\n5 6\n5 7\n6 7\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "7 21\n3 5\n7 2\n2 3\n6 5\n5 2\n4 7\n2 6\n2 4\n6 7\n5 1\n1 4\n4 5\n5 7\n4 6\n3 1\n1 2\n3 4\n7 1\n3 7\n6 1\n3 6\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHow many integer sequences A_1,A_2,\\ldots,A_N of length N satisfy all of the following conditions?\n - 0 \\leq A_i \\leq 9\n - There exists some i such that A_i=0 holds.\n - There exists some i such that A_i=9 holds.\nTh... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "787616419\n"}, {"type": "stdin_stdout", "input": "260522\n", "output": "765255076\n"}, {"type": "stdin_stdout", "input": "914575\n", "output": "875983450\n"}, {"type": "stdin_stdout", "input": "436426\n", "output": "851976198\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\n-----Constraints-----\n - 1 \\leq ... | [{"type": "stdin_stdout", "input": "8\nfubfalo\nbuefalo\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "output": "buefalo\nbuffalo\nbuffamo\nbuofalf\nfubfalo\nolaffub\nomaffub\nouafflb\n"}, {"type": "stdin_stdout", "input": "8\nfubfalo\nbuefola\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJenny is 9 years old. She is the youngest detective in North America. Jenny is a 3rd grader student, so when a new mission comes up, she gets a code to decipher in a form of a sticker (with numbers) in her math notebook a... | [{"input": "[1, 16, 21]\n\"A purple pig and a green donkey flew a kite in the middle of the night\"", "output": "[\"pen\"]", "fn_name": "missing"}, {"input": "[18, 25, 45]\n\"are you going to have a funnel birthday cake for your next birthday\"", "output": "[\"fix\"]", "fn_name": "missing"}, {"input": "[35, 8, 20]\n\"A... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nB: Periodic Sequence-\n\nproblem\n\nDr. Period, a professor at H University, is studying a property called the cycle that is supposed to be hidden in all things. As a generally known basic cycle, a cycle hidden in a seque... | [{"type": "stdin_stdout", "input": "6\n-1 -14 10 -3 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -14 18 -3 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -14 18 -1 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -10 18 -1 2 -1", "output": "1\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGenerous sponsors of the olympiad in which Chloe and Vladik took part allowed all the participants to choose a prize for them on their own. Christmas is coming, so sponsors decided to decorate the Christmas tree with thei... | [{"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000\n7 8\n5 10\n8 6\n1 5\n7 9\n3 9\n2 10\n2 6\n4 3\n", "output": "Impossible"}, {"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -10000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBeroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.\n\nBeroffice works only with small English letters (... | [{"type": "stdin_stdout", "input": "bababcdfabbcabcdfacbbabcdfacacabcdfacbcabcdfaccbabcdfacaaabcdfabacabcdfabcbabcdfacbaabcdfabaaabcdfabbaabcdfacababcdfabbbabcdfabcaabcdfaaababcdfabccabcdfacccabcdfaacbabcdfaabaabcdfaabcabcdfaaacabcdfaccaabcdfaabbabcdfaaaaabcdfaacaabcdfaacc\n", "output": "bababc dfabb cabc dfacb babc df... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function which accepts one arbitrary string as an argument, and return a string of length 26.\n\nThe objective is to set each of the 26 characters of the output string to either `'1'` or `'0'` based on the fact w... | [{"input": "\"&%&%/$%$%$%$%GYtf67fg34678hgfdyd\"", "output": "[\"00010111000000000001000010\"]", "fn_name": "change"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[\"11111111111111111111111111\"]", "fn_name": "change"}, {"input": "\"Abc e $$ z\"", "output": "[\"11101000000000000000000001\"]", "fn_name": "c... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Kefa found n baloons. For convenience, we denote color of i-th baloon as s_{i} — lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get two baloons of the same color. Kefa... | [{"type": "stdin_stdout", "input": "100 100\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 100\njhpyiuuzizhubhhpxbbhpyxzhbpjphzppuhiahihiappbhuypyauhizpbibzixjbzxzpbphuiaypyujappuxiyuyaajaxjupbahb\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (an... | [{"type": "stdin_stdout", "input": "vxpqullmcbegsdskddortcvxyqlbvxmmkhevovnezubvpvnrcajpxraeaxizgaowtfkzywvhnbgzsxbhkaipcmoumtikkiyyaivg\ngviayyikkitmuomcpiakhbxszgbnhvwyzkftwoagzixaearxpjacrnvpvbuzenvovehkmmxvblqyxvctroddksdsgebcmlluqpxv\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "dgxmzbqofstzcdgthbaewb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob decided to eat some fruit. In the kitchen they found a large bag of oranges and apples. Alice immediately took an orange for herself, Bob took an apple. To make the process of sharing the remaining fruit mor... | [{"type": "stdin_stdout", "input": "420196140727489673 679891637638612258\n", "output": "1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B\n"}, {"type": "stdin_stdout", "input": "420196140727489673 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two lists of segments $[al_1, ar_1], [al_2, ar_2], \\dots, [al_n, ar_n]$ and $[bl_1, br_1], [bl_2, br_2], \\dots, [bl_n, br_n]$.\n\nInitially, all segments $[al_i, ar_i]$ are equal to $[l_1, r_1]$ and all se... | [{"type": "stdin_stdout", "input": "3\n3 5\n1 2\n3 4\n2 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"type": "stdin_stdout", "input": "3\n3 5\n1 2\n3 4\n1 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is a balmy spring afternoon, and Farmer John's n cows are ruminating about link-cut cacti in their stalls. The cows, labeled 1 through n, are arranged so that the i-th cow occupies the i-th stall from the left. However... | [{"type": "stdin_stdout", "input": "100000 100000\n", "output": "4999950000\n"}, {"type": "stdin_stdout", "input": "100000 100000\n", "output": "4999950000\n"}, {"type": "stdin_stdout", "input": "100000 40000\n", "output": "4799960000\n"}, {"type": "stdin_stdout", "input": "100000 50000\n", "output": "4999950000\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given a number and your task will be to rearrange the number so that it is divisible by `25`, but without leading zeros. Return the minimum number of digit moves that are needed to make this poss... | [{"input": "5000033333337", "output": "[16]", "fn_name": "solve"}, {"input": "7000033333335", "output": "[8]", "fn_name": "solve"}, {"input": "50011111112", "output": "[12]", "fn_name": "solve"}, {"input": "50001111312", "output": "[13]", "fn_name": "solve"}, {"input": "72046951686", "output": "[12]", "fn_name": "solve... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a part to play in the Wars to Come.\n\nAs everyone knows, Lord Stannis Baratheon (First of His Name, King of the Andals and the First Men, Lord of the Seven Kingdoms and Protector of the Realm) is one true king. ... | [{"type": "stdin_stdout", "input": "1000\n84 87 78 16 94 36 87 93 50 22 63 28 91 60 64 27 41 27 73 37 12 69 68 30 83 31 63 24 68 36 30 3 23 59 70 68 94 57 12 43 30 74 22 20 85 38 99 25 16 71 14 27 92 81 57 74 63 71 97 82 6 26 85 28 37 6 47 30 14 58 25 96 83 46 15 68 35 65 44 51 88 9 77 79 89 85 4 52 55 100 33 61 77 69 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAsterix, Obelix and their temporary buddies Suffix and Prefix has finally found the Harmony temple. However, its doors were firmly locked and even Obelix had no luck opening them.\n\nA little later they found a string s, ... | [{"type": "stdin_stdout", "input": "btbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpmvbxbyszdugvmoyjeeqsywcvuqskcjotyhvdijyslgfvyujxthngnonasgnbzzygyikheelirdfsvuicbiazfdeqecbtbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmm... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task is to write an update for a lottery machine. Its current version produces a sequence of random letters and integers (passed as a string to the function). Your code must filter out all letters and return **unique... | [{"input": "\"ffaQtaRFKeGIIBIcSJtg\"", "output": "[\"One more run!\"]", "fn_name": "lottery"}, {"input": "\"wQ8Hy0y5m5oshQPeRCkG\"", "output": "[\"805\"]", "fn_name": "lottery"}, {"input": "\"20191224isXmas\"", "output": "[\"20194\"]", "fn_name": "lottery"}, {"input": "\"HappyNewYear2020\"", "output": "[\"20\"]", "fn_n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where each letter of English alphabet appears exactly once. In partic... | [{"type": "stdin_stdout", "input": "LLVYUOXHBHUZSAPUMQEKWSQAFRKSMEENXDQYOPQFXNNFXSRBGXFUIRBFJDSDKQIDMCPPTWRJOZCRHZYZPBVUJPQXHNALAOCJDTTBDZWYDBVPMNSQNVMLHHUJAOIWFSEJEJSRBYREOZKHEXTBAXPTISPGIPOYBFFEJNAKKXAEPNGKWYGEJTNEZIXAWRSCEIRTKNEWSKSGKNIKDEOVXGYVEVFRGTNDFNWIFDRZQEJQZYIWNZXCONVZAKKKETPTPPXZMIVDWPGXOFODRNJZBATKGXAPXYHT... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation is a sequence of integers from 1 to n of length n containing each number exactly once. For example, (1), (4, 3, 5, 1, 2), (3, 2, 1) are permutations, and (1, 1), (4, 3, 1), (2, 3, 4) are not. \n\nThere are m... | [{"type": "stdin_stdout", "input": "100\n9 6 3 28 10 2 2 11 2 1 25 3 13 5 14 13 4 14 2 16 12 27 8 1 7 9 8 19 33 23 4 1 15 6 7 12 2 8 30 4 1 31 6 1 15 5 18 3 2 24 7 3 1 20 10 8 26 22 3 3 9 6 1 10 1 5 1 3 7 6 11 10 1 16 19 5 9 4 4 4 2 18 12 21 11 5 2 32 17 29 2 4 8 1 7 5 3 2 17 1\n", "output": "12\n1 1 1 1 1 1 2 1 3 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBarney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. There exists a bidirectional road between intersections i and 2i and another road between i and 2i + 1 for eve... | [{"type": "stdin_stdout", "input": "10\n2 37526406560905229 37526426361107171\n2 37526424114740747 18763396439955441\n2 300485276957081578 301492476099962199\n1 75035386466351570 441803674395985082 642312512\n2 300197522144700185 220954108245114486\n1 150105696341181576 559187296 100113944\n1 300197522135707767 1502426... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya got really tired of these credits (from problem F) and now wants to earn the money himself! He decided to make a contest to gain a profit.\n\nVasya has $n$ problems to choose from. They are numbered from $1$ to $n$.... | [{"type": "stdin_stdout", "input": "22 936\n20 743\n55 46\n83 282\n157 3\n168 979\n241 338\n293 113\n312 292\n333 509\n339 632\n345 149\n347 109\n384 846\n420 151\n619 923\n647 336\n706 935\n726 600\n760 45\n804 126\n810 739\n906 341\n", "output": " 3371\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a permutation p consisting of n integers 1, 2, ..., n (a permutation is an array where each element from 1 to n occurs exactly once).\n\nLet's call an array a bipartite if the following undirected graph is b... | [{"type": "stdin_stdout", "input": "4\n3\n1 2 1\n6\n1 3 2 6 2 4\n4\n4 1 3 2\n8\n3 2 1 6 7 8 2 4\n", "output": "YES\n-1 -2 1\nYES\n-1 -3 2 6 2 4\nYES\n-4 -1 -3 2\nYES\n-3 -2 1 6 7 -8 2 4\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 3\n6\n1 0 2 6 5 4\n4\n4 1 3 2\n8\n3 2 1 6 7 8 5 4\n", "output": "YES\n1 2 3\nYES\n-1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\n-----Constraints-----\n - 2 ≤ N ≤ 200000\n - 1 ≤ A_i ≤ 10^9\n - All values in input are intege... | [{"type": "stdin_stdout", "input": "2\n10000000 10000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2\n10000100 10000000", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n10000100 10001000", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n10000100 10101000", "output": "YES\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTokitsukaze has two colorful tapes. There are $n$ distinct colors, numbered $1$ through $n$, and each color appears exactly once on each of the two tapes. Denote the color of the $i$-th position of the first tape as $ca_i... | [{"type": "stdin_stdout", "input": "1\n50\n4 50 11 27 15 29 2 9 12 39 31 1 6 17 32 28 7 24 36 3 18 49 37 35 33 21 48 19 26 5 20 45 14 13 34 40 42 16 44 43 41 25 38 23 30 10 22 8 47 46\n10 43 29 5 47 12 39 26 31 15 33 18 13 21 11 22 44 4 38 30 41 25 1 24 14 8 27 36 20 45 23 48 2 42 46 19 32 17 7 50 40 49 37 9 3 35 28 6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLena is the most economical girl in Moscow. So, when her dad asks her to buy some food for a trip to the country, she goes to the best store — \"PriceFixed\". Here are some rules of that store:\n\nThe store has an infini... | [{"type": "stdin_stdout", "input": "15\n1 18646259228611\n1 76062756486449\n1 5817259716888\n1 22110867828535\n1 100627485465221\n1 40799537235509\n1 56529154503793\n1 56148198559428\n1 77940886559829\n1 74079407528201\n1 6574734766207\n1 79264199999788\n1 19171266033881\n1 38437872037474\n1 34320923862986\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer X.\nFind the largest perfect power that is at most X.\nHere, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not les... | [{"type": "stdin_stdout", "input": "1074", "output": "1024\n"}, {"type": "stdin_stdout", "input": "1023", "output": "1000\n"}, {"type": "stdin_stdout", "input": "1298", "output": "1296\n"}, {"type": "stdin_stdout", "input": "1357", "output": "1331\n"}, {"type": "stdin_stdout", "input": "1746", "output": "1728\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the previous Kata we discussed the OR case.\n\nWe will now discuss the AND case, where rather than calculating the probablility for either of two (or more) possible results, we will calculate the probability of receivi... | [{"input": "[[\"red\", \"blue\", \"yellow\", \"green\", \"red\", \"blue\", \"yellow\", \"green\", \"red\", \"blue\"], [\"red\", \"red\"], false]", "output": "[0.067]", "fn_name": "ball_probability"}, {"input": "[[\"red\", \"blue\", \"yellow\", \"green\", \"red\", \"blue\", \"yellow\", \"green\", \"red\", \"blue\"], [\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHaving read half of the book called \"Storm and Calm\" on the IT lesson, Innocentius was absolutely determined to finish the book on the maths lessons. All was fine until the math teacher Ms. Watkins saw Innocentius readi... | [{"type": "stdin_stdout", "input": "DaABYAOivguEueXufuoUeoiLiuEuEIeZAdoPgaUIIrUtoodAALPESiUaEbqitAphOIIEAogrjUBZLnIALGbazIermGEiAAdDAOFaaizopuUuuEugOHsXTAelFxAyZXWQXiEEKkGiIVdUmwiThDOiEyiuOEaiIAAjEQyaEuOiUGOuuzvaIEUEAhXEuOliOeEkJuJaUaszUKePiQuwXSuoQYEeUOgOeuyvOwhUuitEEKDVOaUaoiaIyiAEkyXeuiEkUorUYCaOXEAiUYPnUMaURebouLUO... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob and Alice are often participating in various programming competitions. Like many competitive programmers, Alice and Bob have good and bad days. They noticed, that their lucky and unlucky days are repeating with some p... | [{"type": "stdin_stdout", "input": "372839920 992839201 1000000000\n100293021 1262614379 999999993\n", "output": "619999282\n"}, {"type": "stdin_stdout", "input": "372839920 992839201 1000000000\n100293021 773829394 999999993\n", "output": "619999282\n"}, {"type": "stdin_stdout", "input": "372839920 992839201 100000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOf course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains a_{i} animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Nat... | [{"type": "stdin_stdout", "input": "10 19\n13637 26970 19043 3616 12880 19387 12539 25190 2452 1261\n1 2\n1 3\n1 4\n2 5\n3 6\n6 7\n3 8\n5 9\n3 10\n4 10\n9 3\n2 8\n4 3\n2 3\n7 10\n7 8\n5 10\n5 6\n7 4\n", "output": "8241.4222222222\n"}, {"type": "stdin_stdout", "input": "10 19\n15704 19758 26631 25050 22778 15041 8487 26... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDice Stamp\n\nDice stamp\n\nAt a local fair, you found a game store you've never seen before. This is a game in which N 6-sided dice are dropped and rolled on the board. More precisely, N buttons are tied to N dice on a o... | [{"type": "stdin_stdout", "input": "1\n0 0\n1 2 3 4 5 6\nRRRRBBBBLLLLFFFF\n2\n0 0\n1 1 1 1 1 1\nRRR\n2 2\n100 100 100 100 100 101\nFFF\n1\n1010 -1000\n1 2 3 4 5 6\nLFRB\n4\n-3 -4\n1 2 3 4 5 6\nBBBBBBBB\n4 -3\n11 12 13 14 15 16\nLLLLLLLL\n3 4\n21 22 23 24 25 26\nFFFFFFFF\n-4 3\n31 32 33 34 35 36\nRRRRRRRR\n3\n-2 -2\n9 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a given sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in A.\n\nAn increasing subsequence of A is defined by a subsequence {ai0, ai1, ... , aik} where 0 ≤ i0 < i1 < ... ... | [{"type": "stdin_stdout", "input": "5\n5\n1\n2\n-1\n10", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n5\n1\n0\n-1\n10", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n5\n1\n0\n-1\n11", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n8\n1\n0\n-1\n11", "output": "2\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Snail Sort\n\nGiven an `n x n` array, return the array elements arranged from outermost elements to the middle element, traveling clockwise.\n\n```\narray = [[1,2,3],\n [4,5,6],\n [7,8,9]]\nsnail(array)... | [{"input": "[[1, 2, 3, 4, 5, 6], [20, 21, 22, 23, 24, 7], [19, 32, 33, 34, 25, 8], [18, 31, 36, 35, 26, 9], [17, 30, 29, 28, 27, 10], [16, 15, 14, 13, 12, 11]]", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36]]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Petya has already written the code that im... | [{"type": "stdin_stdout", "input": "150\n48 115 13 9 105 117 41 136 123 32 84 95 62 50 140 106 145 91 57 141 139 35 45 27 129 63 137 10 37 60 44 30 101 119 138 78 22 103 39 134 49 36 25 12 28 67 69 99 148 26 16 87 146 65 8 74 14 38 47 89 81 19 40 11 64 43 110 66 102 3 122 124 100 2 125 42 97 73 121 7 52 23 29 109 1 70 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn a certain meeting of a ruling party \"A\" minister Pavel suggested to improve the sewer system and to create a new pipe in the city.\n\nThe city is an n × m rectangular squared field. Each square of the field is either... | [{"type": "stdin_stdout", "input": "9 37\n.......#................#.##...#.....\n..#......................##..........\n..#......#.........#.................\n..........#..#..#..#...........#.....\n...#............#..##.#.....##.......\n......................#..............\n......#........##....#......#........\n........ | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess.\n\nThe queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. I... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1000000010\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1823733270\n", "output": "white\n1 2\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus is sure that his life fits the description: \"first there is a white stripe, then a black one, then a white one again\". So, Polycarpus is sure that this rule is going to fulfill during the next n days. Polycar... | [{"type": "stdin_stdout", "input": "4000 2000 2219\n", "output": " 865711019"}, {"type": "stdin_stdout", "input": "4000 1244 4000\n", "output": " 344837886"}, {"type": "stdin_stdout", "input": "4000 1244 2881\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for $n$ flowers and so it looks like a pipe with $n$ holes. Arkady can only use the water that flows from the firs... | [{"type": "stdin_stdout", "input": "10 300 100\n35 25 110 40 60 7 44 145 23 96\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 300 100\n35 42 110 40 60 7 44 145 23 96\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 300 100\n35 42 110 40 60 7 26 145 23 96\n", "output": "6\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA lot of people in Berland hates rain, but you do not. Rain pacifies, puts your thoughts in order. By these years you have developed a good tradition — when it rains, you go on the street and stay silent for a moment, con... | [{"type": "stdin_stdout", "input": "20 5750 12756 15\n", "output": "YES\n224.57771408997397\n"}, {"type": "stdin_stdout", "input": "20 2910 12756 15\n", "output": "YES\n113.65585182640422\n"}, {"type": "stdin_stdout", "input": "20 2726 12756 15\n", "output": "YES\n106.46936497552505\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBerland year consists of $m$ months with $d$ days each. Months are numbered from $1$ to $m$. Berland week consists of $w$ days. The first day of the year is also the first day of the week. Note that the last week of the y... | [{"type": "stdin_stdout", "input": "5\n6 7 1\n10 12 11\n12 30 6\n1 1 1\n3247834 10298779 625324\n", "output": "15\n45\n6\n0\n116461800\n"}, {"type": "stdin_stdout", "input": "5\n6 7 4\n10 9 16\n12 17 4\n0 1 1\n7341628 25065973 296620\n", "output": "6\n16\n66\n0\n359753922\n"}, {"type": "stdin_stdout", "input": "5\n6 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA stick is balanced horizontally on a support. Will it topple over or stay balanced? (This is a physics problem: imagine a real wooden stick balanced horizontally on someone's finger or on a narrow table, for example). \n... | [{"input": "[9, 1, 1, 7]\n[1, 1, 0, 0]", "output": "[false]", "fn_name": "will_it_balance"}, {"input": "[9, 7, 1, 1]\n[1, 1, 0, 0]", "output": "[true]", "fn_name": "will_it_balance"}, {"input": "[5, 1, 1]\n[0, 1, 0]", "output": "[false]", "fn_name": "will_it_balance"}, {"input": "[3, 3, 4]\n[0, 1, 0]", "output": "[fals... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of those digits together to form one... | [{"type": "stdin_stdout", "input": "100 1000000000 42 97\n2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2\n", "output": "590949100\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a sequence made up of the consecutive prime numbers. This infinite sequence would start with: \n```python\n\"2357111317192329313741434753596167717379...\"\n```\n\nYou will be given two numbers: `a` and `b`, and y... | [{"input": "30\n12", "output": "[\"616771737983\"]", "fn_name": "solve"}, {"input": "20\n9", "output": "[\"414347535\"]", "fn_name": "solve"}, {"input": "40\n8", "output": "[\"83899710\"]", "fn_name": "solve"}, {"input": "10000\n5", "output": "[\"02192\"]", "fn_name": "solve"}, {"input": "20000\n5", "output": "[\"09334... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya has recently started attending a programming club. Naturally he is facing the problem of choosing a programming language. After long considerations he realized that Java is the best choice. The main argument ... | [{"type": "stdin_stdout", "input": "14391752689956519300788497161416904648305096969559656916798920426154191397931561980203179360129309381\n", "output": "BigInteger\n"}, {"type": "stdin_stdout", "input": "11271203439111662452647816080492937379011458047735472400976277474953429583477559167812276320735634783\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCount the number of divisors of a positive integer `n`.\n\nRandom tests go up to `n = 500000`.\n\n## Examples\n```python\ndivisors(4) == 3 # 1, 2, 4\ndivisors(5) == 2 # 1, 5\ndivisors(12) == 6 # 1, 2, 3, 4, 6, 12\ndi... | [{"input": "4096", "output": "[13]", "fn_name": "divisors"}, {"input": "12", "output": "[6]", "fn_name": "divisors"}, {"input": "25", "output": "[3]", "fn_name": "divisors"}, {"input": "30", "output": "[8]", "fn_name": "divisors"}, {"input": "1", "output": "[1]", "fn_name": "divisors"}, {"input": "4", "output": "[3]", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMany cats live on the campus of a school. Natsume's daily routine is to pet those cats. However, the cats may be capricious and go for a walk off campus.\n\nThe campus site is a rectangle with each side parallel to the x-... | [{"type": "stdin_stdout", "input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n41 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "2\n1 3 20 10\n4\n21 13\n1 15\n10 10\n55 10\n1 3 20 10\n4\n21 13\n1 15\n10 10\n25 10", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## The Story\nGreen Lantern's long hours of study and practice with his ring have really paid off -- his skills, focus, and control have improved so much that now he can even use his ring to update and redesign his web si... | [{"input": "\"pAlEgOlDeNrOd\"", "output": "[\"LightGreen\"]", "fn_name": "yellow_be_gone"}, {"input": "\"lemonchiffon\"", "output": "[\"PaleGreen\"]", "fn_name": "yellow_be_gone"}, {"input": "\"BlueViolet\"", "output": "[\"BlueViolet\"]", "fn_name": "yellow_be_gone"}, {"input": "\"GOLD\"", "output": "[\"ForestGreen\"]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $ n $ acitivities with start times $ \\\\ {s_i \\\\} $ and finish times $ \\\\ {t_i \\\\} $. Assuming that a person can only work on a single activity at a time, find the maximum number of activities that can be... | [{"type": "stdin_stdout", "input": "5\n1 2\n10 2\n-1 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n10 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n12 2\n-2 4\n1 2\n3 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n10 2\n0 4\n1 2\n3 12"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function \n\n```python\nvowel_2_index```\n\nthat takes in a string and replaces all the vowels [a,e,i,o,u] with their respective positions within that string. \nE.g: \n\n```python\nvowel_2_index('this is my string... | [{"input": "\"90's cornhole Austin, pickled butcher yr messenger bag gastropub next level leggings listicle meditation try-hard Vice. Taxidermy gastropub gentrify, meh fap organic ennui fingerstache pickled vegan. Seitan sustainable PBR&B cornhole VHS. Jean shorts actually bitters ugh blog Intelligentsia. Artisan Kicks... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call an array $t$ dominated by value $v$ in the next situation.\n\nAt first, array $t$ should have at least $2$ elements. Now, let's calculate number of occurrences of each number $num$ in $t$ and define it as $occ(... | [{"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 1\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n6\n3\n2\n"}, {"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n5\n3\n2\n"}, {"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder and Chris the Baboon are travelling to Udayland! To get there, they have to get on the special IOI bus. The IOI bus has n rows of seats. There are 4 seats in each row, and the seats are separated into pairs b... | [{"type": "stdin_stdout", "input": "61\nOX|XX\nOX|XX\nOX|XX\nXO|XO\nXX|XO\nXX|XX\nXX|XX\nOX|XX\nXO|XO\nOX|XO\nXO|OX\nXX|XX\nXX|XX\nOX|OX\nXX|OX\nOX|XO\nOX|XO\nXO|OX\nXO|XX\nOX|XX\nOX|XX\nXO|OX\nXO|XX\nXO|XX\nOX|XX\nXX|XX\nXX|XO\nXO|XX\nXX|XX\nXO|OX\nXX|XO\nXO|XX\nXO|XO\nXO|OX\nXX|OX\nXO|OX\nOX|XX\nXX|OX\nXX|XX\nOX|XO\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a given weighted graph G(V, E) and a source r, find the source shortest path to each vertex from the source (SSSP: Single Source Shortest Path).\n\nConstraints\n\n* 1 ≤ |V| ≤ 100000\n* 0 ≤ di ≤ 10000\n* 0 ≤ |E| ≤ 5000... | [{"type": "stdin_stdout", "input": "8 6 1\n0 1 1\n0 2 4\n2 0 1\n0 2 2\n3 1 1\n3 2 5", "output": "INF\n0\nINF\nINF\nINF\nINF\nINF\nINF\n"}, {"type": "stdin_stdout", "input": "8 6 1\n0 1 1\n0 2 4\n0 0 1\n1 2 2\n3 0 2\n3 2 5", "output": "INF\n0\n2\nINF\nINF\nINF\nINF\nINF\n"}, {"type": "stdin_stdout", "input": "8 6 2\n0 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToad Pimple has an array of integers $a_1, a_2, \\ldots, a_n$.\n\nWe say that $y$ is reachable from $x$ if $x<y$ and there exists an integer array $p$ such that $x = p_1 < p_2 < \\ldots < p_k=y$, and $a_{p_i}\\, \\&\\, a_... | [{"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 4\n", "output": "Shi\nShi\nShi\n"}, {"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 5\n", "output": "Shi\nShi\nShi\n"}, {"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 1\n1 3\n2 4\n1 4\n", "output": "Shi\nShi\nShi\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers. For each $i$ ($1 \\le i \\le n$) the following inequality is true: $-2 \\le a_i \\le 2$.\n\nYou can remove any number (possibly $0$) of elements from the beginning of... | [{"type": "stdin_stdout", "input": "1\n100\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2\n", "output": "0 4\n"}, {"type": "stdin_stdout", "input": "5\n4\n1 2 -1 2\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSometimes, I want to quickly be able to convert miles per imperial gallon into kilometers per liter.\n\nCreate an application that will display the number of kilometers per liter (output) based on the number of miles per ... | [{"input": "30", "output": "[10.62]", "fn_name": "converter"}, {"input": "36", "output": "[12.74]", "fn_name": "converter"}, {"input": "10", "output": "[3.54]", "fn_name": "converter"}, {"input": "20", "output": "[7.08]", "fn_name": "converter"}, {"input": "24", "output": "[8.5]", "fn_name": "converter"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the 2050 Conference, some people from the competitive programming community meet together and are going to take a photo. The n people form a line. They are numbered from 1 to n from left to right. Each of them either h... | [{"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n4\n11 2 28 5\n1\n998244353\n", "output": "11\n8\n1\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 0 1\n4\n11 3 28 5\n1\n998244353\n", "output": "10\n8\n1\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n4\n11 2 15 5\n1\n998244353\n", "output": "11\n7\n1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nTaro bought 10 books. Later, I tried to find out the price based on the receipt, but the receipt was dirty and I could not read the price of a book. We decided to calculate the price of the book from the total ... | [{"type": "stdin_stdout", "input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3134\n980\n0", "output": "-1078\n"}, {"type": "stdin_stdout", "input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3265\n980\n0", "output": "-1209\n"}, {"type": "stdin_stdout", "input": "9850\n1050\n800\n481\n380\n600\n1164\n2400\n3265\n98... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment c... | [{"type": "stdin_stdout", "input": "2\n-100 -20 100 20\n-20 -100 18 100\n2\n-100 -20 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"type": "stdin_stdout", "input": "2\n-100 -20 100 20\n-20 -100 20 100\n2\n-100 -34 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"type": "stdin_stdout", "input": "2\n-100 -20 100 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs usual, Sereja has array a, its elements are integers: a[1], a[2], ..., a[n]. Let's introduce notation:\n\n$f(a, l, r) = \\sum_{i = l}^{r} a [ i ] ; m(a) = \\operatorname{max}_{1 \\leq l \\leq r \\leq n} f(a, l, r)$\n\n... | [{"type": "stdin_stdout", "input": "116 10\n477 -765 -756 376 -48 -75 768 -658 263 -207 362 -535 96 -960 630 -686 609 -830 889 57 -239 346 -298 -18 -107 853 -607 -443 -517 371 657 105 479 498 -47 432 503 -917 -656 610 -466 216 -747 -587 -163 -174 493 -882 853 -582 -774 -477 -386 610 -58 557 968 196 69 610 -38 366 -79 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhile playing yet another strategy game, Mans has recruited $n$ Swedish heroes, whose powers which can be represented as an array $a$.\n\nUnfortunately, not all of those mighty heroes were created as capable as he wanted,... | [{"type": "stdin_stdout", "input": "11\n559227829 -118401759 491756598 -50857099 491152214 -500410377 141179566 -414122877 144131087 -460846619 791017750\n", "output": "3779030445\n"}, {"type": "stdin_stdout", "input": "11\n559227829 -118401759 491756598 -50857099 491152214 -500410377 141179566 -723654625 144131087 -46... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are 2^N players, numbered 1, 2, ..., 2^N. They decided to hold a tournament.\n\nThe tournament proceeds as follows:\n\n* Choose a permutation of 1, 2, ..., 2^N: p_1, p_2, ..., p_{2^N}.\n* The players stand in a row ... | [{"type": "stdin_stdout", "input": "16 16\n5489 5490 5491 5492 5493 5494 5495 5497 18993 18995 18997 18999 19000 19001 19002 19003", "output": "816646464"}, {"type": "stdin_stdout", "input": "4 2\n12 14 -1", "output": "217967722\n"}, {"type": "stdin_stdout", "input": "4 2\n10 14 0", "output": "866591435\n"}, {"type": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n- Input: Integer `n`\n- Output: String\n\nExample:\n\n`a(4)` prints as\n```\n A \n A A \n A A A \nA A\n```\n\n`a(8)` prints as\n```\n A \n A A \n A A \n A A \n A A A A... | [{"input": "30", "output": "[\" A \\n A A \\n A A \\n A A \\n A A ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA new Berland businessman Vitaly is going to open a household appliances' store. All he's got to do now is to hire the staff.\n\nThe store will work seven days a week, but not around the clock. Every day at least k people... | [{"type": "stdin_stdout", "input": "1000 2 1363\n", "output": "2726\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... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIvan wants to play a game with you. He picked some string $s$ of length $n$ consisting only of lowercase Latin letters. \n\nYou don't know this string. Ivan has informed you about all its improper prefixes and suffixes (i... | [{"type": "stdin_stdout", "input": "18\nd\nh\ndj\nxh\ndjs\njxh\ndjsh\nzjxh\ndjshf\nkzjxh\ndjshfk\nhkzjxh\ndjshfkj\nkhkzjxh\ndjshfkje\nskhkzjxh\ndjshfkjeh\ndskhkzjxh\ndjshfkjehd\nhdskhkzjxh\ndjshfkjehds\nehdskhkzjxh\ndjshfkjehdsk\njehdskhkzjxh\ndjshfkjehdskh\nkjehdskhkzjxh\ndjshfkjehdskhk\nfkjehdskhkzjxh\ndjshfkjehdskhk... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function that takes a Number as its argument and returns a Chinese numeral string. You don't need to validate the input argument, it will always be a Number in the range `[-99999.999, 99999.999]`, rounded to 8 de... | [{"input": "-99999.999", "output": "[\"\\u8d1f\\u4e5d\\u4e07\\u4e5d\\u5343\\u4e5d\\u767e\\u4e5d\\u5341\\u4e5d\\u70b9\\u4e5d\\u4e5d\\u4e5d\"]", "fn_name": "to_chinese_numeral"}, {"input": "99999.999", "output": "[\"\\u4e5d\\u4e07\\u4e5d\\u5343\\u4e5d\\u767e\\u4e5d\\u5341\\u4e5d\\u70b9\\u4e5d\\u4e5d\\u4e5d\"]", "fn_name"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings a and b. You have to remove the minimum possible number of consecutive (standing one after another) characters from string b in such a way that it becomes a subsequence of string a. It can happen... | [{"type": "stdin_stdout", "input": "bbbbaabbababbaaaaababbaaabbbbaaabbbababbbbabaabababaabaaabbbabababbbabababaababaaaaa\nbbabaaaabaaaabbaaabbbabaaabaabbbababbbbbbbbbbabbababbaababbbaaabababababbbbaaababaaaaab\n", "output": "bbbbbbbabbababbaababbbaaabababababbbbaaababaaaaab\n"}, {"type": "stdin_stdout", "input": "bbbba... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Aizu Wakamatsu city office decided to lay a hot water pipeline covering the whole area of the city to heat houses. The pipeline starts from some hot springs and connects every district in the city. The pipeline can fo... | [{"type": "stdin_stdout", "input": "3 5\n12 15 70 19 44\n16 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\n19 5\n21\n0 0", "output": "43\n"}, {"type": "stdin_stdout", "input": "3 5\n12 15 70 19 44\n30 13 16 0 17\n20 14 16 10 22\n17 27 18 16\n9 7 0\n19 5\n21\n0 0", "output": "43\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given a string containing a sequence of words separated with whitespaces. Let's say it is a sequence of patterns: a name and a corresponding number - like this:\n\n```\"red 1 yellow 2 black 3 white 4\"```\n\nYou wa... | [{"input": "\"#@&fhds 123F3f 2vn2# 2%y6D @%fd3 @!#4fs W@R^g WE56h%\"", "output": "[\"[{name : '#@&fhds', id : '123F3f'}, {name : '2vn2#', id : '2%y6D'}, {name : '@%fd3', id : '@!#4fs'}, {name : 'W@R^g', id : 'WE56h%'}]\"]", "fn_name": "words_to_object"}, {"input": "\"red 1 yellow 2 black 3 white 4\"", "output": "[\"[{n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIndian summer is such a beautiful time of the year! A girl named Alyona is walking in the forest and picking a bouquet from fallen leaves. Alyona is very choosy — she doesn't take a leaf if it matches the color and the sp... | [{"type": "stdin_stdout", "input": "17\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbltscqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq tosqzw\njtbctslqq ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently a top secret mission to Mars has taken place. As a result, scientists managed to obtain some information about the Martian DNA. Now we know that any Martian DNA contains at most m different nucleotides, numbered ... | [{"type": "stdin_stdout", "input": "853332331434235 35 77\nBy\nhs\nzB\njs\nIr\nEa\nHG\nxb\nxG\nFp\nAC\nDt\nwo\nFB\nzh\nim\ntx\nyi\ngC\nkp\njz\ndc\nwE\naa\nsG\nng\ncr\npB\nCg\ncv\nxs\nDn\ndg\nyj\nCd\naC\nIi\ngH\nml\nww\nAD\nir\nti\nEr\nCj\nHt\nAe\nsn\naH\nHv\nan\nDf\nGn\nfC\nay\ngB\nlh\nup\nda\nzs\nbh\nHB\nHd\nmg\nzy\nG... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\nGiven is a string S. Find the minimum number o... | [{"type": "stdin_stdout", "input": "cgayikejwockvntzlvpsfjtzlqfhoqoiahcodvinogbpuxhvohhcvhzmidloliztdhrntxqurzqjztjmwpylaknjncowkeuikhgc\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "pgfqwbxjygkpqanpkicpaxfgeembvdgtllvtiyamxfpwtknorxxvonpntkwcffyjtvwlqgvvbzmmgfgkwezkemmxpagyihbkqidk\n", "output": "32\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a rational number n\n\n``` n >= 0, with denominator strictly positive``` \n\n- as a string (example: \"2/3\" in Ruby, Python, Clojure, JS, CS, Go) \n- or as two strings (example: \"2\" \"3\" in Haskell, Java, CShar... | [{"input": "\"0.66\"", "output": "[[\"1/2\", \"1/7\", \"1/59\", \"1/5163\", \"1/53307975\"]]", "fn_name": "decompose"}, {"input": "\"16/17\"", "output": "[[\"1/2\", \"1/3\", \"1/10\", \"1/128\", \"1/32640\"]]", "fn_name": "decompose"}, {"input": "\"1001/3456\"", "output": "[[\"1/4\", \"1/26\", \"1/848\", \"1/2381184\"]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSolve the mystery.\n\nInput\n\nThe first line contains T, the number of test cases.\n\nT lines follow each containing a single integer N.\n\nOutput\n\nOutput the answer for each test case in a new line.\n\nConstraints\n\n... | [{"type": "stdin_stdout", "input": "10000\n66\n139\n189\n235\n50\n229\n303\n83\n204\n64\n250\n338\n168\n228\n129\n157\n204\n319\n146\n144\n94\n271\n286\n188\n277\n197\n343\n259\n105\n286\n113\n78\n335\n116\n100\n51\n20\n272\n336\n23\n129\n50\n74\n219\n19\n232\n252\n100\n236\n140\n65\n54\n127\n268\n29\n273\n110\n180\n22... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWay to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the midst of a clutch of hungry zombies is quite a risky endeavor. Hence Heidi wonders: what is the smallest number of b... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "231564544\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "231564544\n"}, {"type": "stdin_stdout", "input": "1000000100\n", "output": "231564594\n"}, {"type": "stdin_stdout", "input": "1000010100\n", "output": "231569594\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n3R2 - Standby for Action\n\nOur dear Cafe's owner, JOE Miller, will soon take part in a new game TV-show \"1 vs. $n$\"!\n\nThe game goes in rounds, where in each round the host asks JOE and his opponents a common question... | [{"type": "stdin_stdout", "input": "100000\n", "output": "12.090146129863335\n"}, {"type": "stdin_stdout", "input": "111735\n", "output": "12.201105415046918\n"}, {"type": "stdin_stdout", "input": "178482\n", "output": "12.669461501082823\n"}, {"type": "stdin_stdout", "input": "152946\n", "output": "12.515059130925348\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter years of hard work scientists invented an absolutely new e-reader display. The new display has a larger resolution, consumes less energy and its production is cheaper. And besides, one can bend it. The only inconven... | [{"type": "stdin_stdout", "input": "10\n1101010101\n1110101010\n0111010101\n1011101010\n0101110101\n1010111010\n0101011101\n1010101110\n0101010111\n1010101011\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "10\n1111100000\n0010100000\n0110111000\n0000001000\n1011001010\n0010100001\n0010111000\n0011001010\n00... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given a string and your task will be to return a list of ints detailing the count of uppercase letters, lowercase, numbers and special characters, as follows.\n\n```Haskell\nSolve(\"*'&ABCDabcde1... | [{"input": "\"RYT'>s&gO-.CM9AKeH?,5317tWGpS<*x2ukXZD\"", "output": "[[15, 8, 6, 9]]", "fn_name": "solve"}, {"input": "\"@mw>0=QD-iAx!rp9TaG?o&M%l$34L.nbft\"", "output": "[[7, 13, 4, 10]]", "fn_name": "solve"}, {"input": "\"P*K4%>mQUDaG$h=cx2?.Czt7!Zn16p@5H\"", "output": "[[9, 9, 6, 9]]", "fn_name": "solve"}, {"input": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle penguin Polo adores integer segments, that is, pairs of integers [l; r] (l ≤ r). \n\nHe has a set that consists of n integer segments: [l_1; r_1], [l_2; r_2], ..., [l_{n}; r_{n}]. We know that no two segments of th... | [{"type": "stdin_stdout", "input": "47 21\n3 5\n-422 -417\n60 60\n-348 -348\n-3 -3\n-364 -361\n-49 -41\n-436 -430\n-250 -244\n-33 -26\n-162 -158\n-90 -88\n-357 -352\n-339 -337\n-25 -19\n-69 -67\n-261 -260\n-292 -283\n12 18\n44 44\n-277 -275\n-301 -293\n-108 -98\n-180 -172\n-327 -318\n-314 -309\n-12 -7\n-134 -130\n33 35... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Berland, $n$ different types of banknotes are used. Banknotes of the $i$-th type have denomination $10^{a_i}$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly... | [{"type": "stdin_stdout", "input": "4\n3 27\n0 1 2\n2 777\n0 2\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9\n", "output": "1099\n67999\n148999\n999999920999999999\n"}, {"type": "stdin_stdout", "input": "4\n3 22\n0 1 4\n2 1121\n0 2\n3 192\n0 1 2\n10 1000000000\n0 1 2 3 4 5 6 7 8 9\n", "output": "149\n102399\n17599\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has a calculator. It has a display and two buttons.\n\nInitially, the display shows an integer x. Snuke wants to change this value into another integer y, by pressing the following two buttons some number of times i... | [{"type": "stdin_stdout", "input": "-10 -23", "output": "15\n"}, {"type": "stdin_stdout", "input": "110 -1", "output": "110\n"}, {"type": "stdin_stdout", "input": "-10 -63", "output": "55\n"}, {"type": "stdin_stdout", "input": "273 -1", "output": "273\n"}, {"type": "stdin_stdout", "input": "141 -1", "output": "141\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe marketing team is spending way too much time typing in hashtags. \nLet's help them with our own Hashtag Generator!\n\nHere's the deal:\n\n- It must start with a hashtag (`#`).\n- All words must have their first lett... | [{"input": "\"Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong Cat\"", "output": "[false]", "fn_name": "generate_hashtag"}, {"input": "\"codewars is nice\"", "output": "[\"#CodewarsIsNice\"]", "fn_name": "gen... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEntrance Examination\n\nThe International Competitive Programming College (ICPC) is famous for its research on competitive programming. Applicants to the college are required to take its entrance examination.\n\nThe succe... | [{"type": "stdin_stdout", "input": "5 2 4\n100\n90\n82\n70\n65\n5 2 4\n100\n170\n80\n75\n65\n3 1 2\n5000\n6502\n3000\n4 2 3\n10000\n10100\n8000\n8000\n4 2 3\n10000\n10000\n10000\n8000\n5 2 3\n100\n80\n136\n60\n111\n0 0 0", "output": "3\n2\n2\n2\n3\n3\n"}, {"type": "stdin_stdout", "input": "5 2 3\n100\n161\n82\n70\n65\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour goal is to create a function to format a number given a template; if the number is not present, use the digits `1234567890` to fill in the spaces.\n\nA few rules:\n\n* the template might consist of other numbers, spe... | [{"input": "\"+555 aaaa bbbb\"\n\"18031978\"", "output": "[\"+555 1803 1978\"]", "fn_name": "numeric_formatter"}, {"input": "\"xxx xxxxx xx\"\n\"5465253289\"", "output": "[\"546 52532 89\"]", "fn_name": "numeric_formatter"}, {"input": "\"+555 aaaa bbbb\"", "output": "[\"+555 1234 5678\"]", "fn_name": "numeric_formatter... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEach New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th vertex gets color ci.\n\nNow it's time for Timofey birthday, and his mo... | [{"type": "stdin_stdout", "input": "10\n5 7\n4 5\n10 2\n4 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 26 18 15 15\n", "output": "YES\n5\n"}, {"type": "stdin_stdout", "input": "10\n5 7\n4 5\n10 2\n4 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 42 18 15 15\n", "output": "YES\n5\n"}, {"type": "stdin_stdout", "input": "10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least k contains this character c.\n\nYou have to find minimum k such that there exis... | [{"type": "stdin_stdout", "input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmkhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmjhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA prime number is a number which has exactly two distinct divisors: one and itself. For example, numbers 2, 7, 3 are prime, and 1, 6, 4 are not.\n\nThe next prime number after x is the smallest prime number greater than x... | [{"type": "stdin_stdout", "input": "13 17\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "23 29\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "43 47\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "17 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11 13\n", "output": "YES... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there is no dent in the quadrangl... | [{"type": "stdin_stdout", "input": "1.0,0.0,0.1,0.1,0.0,0.1,0.0,0.0\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.1\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings of equal length $s$ and $t$ consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.\n\nDuring each operation you choose two adjacent charac... | [{"type": "stdin_stdout", "input": "3\nxabb\naabx\ntechnocup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\nxabb\naabx\nteohnccup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\nxabb\naabx\ntdohnccup\ntechnocup\na\nz\n", "output": "YES\nYE... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.\n\nA cableway is represented by some cablecars, hanged onto some cable stations by a ca... | [{"type": "stdin_stdout", "input": "100 100 100\n", "output": "179"}, {"type": "stdin_stdout", "input": "100 0 100\n", "output": "179"}, {"type": "stdin_stdout", "input": "100 100 0\n", "output": "178"}, {"type": "stdin_stdout", "input": "0 100 100\n", "output": "179"}, {"type": "stdin_stdout", "input": "45 52 14\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function that takes a list of one or more non-negative integers, and arranges them such that they form the largest possible number.\n\nExamples:\n\n`largestArrangement([4, 50, 8, 145])` returns 8504145 (8-50-4-14... | [{"input": "[422, 995, 500, 202, 772, 230, 258, 144, 752]", "output": "[995772752500422258230202144]", "fn_name": "largest_arrangement"}, {"input": "[451, 850, 85, 283, 4, 734, 605, 499, 249]", "output": "[858507346054994514283249]", "fn_name": "largest_arrangement"}, {"input": "[70, 7, 81, 28, 336, 246, 817, 77, 4, 55... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter passing a test, Vasya got himself a box of $n$ candies. He decided to eat an equal amount of candies each morning until there are no more candies. However, Petya also noticed the box and decided to get some candies ... | [{"type": "stdin_stdout", "input": "3345775397705614178\n", "output": "131353216887383264\n"}, {"type": "stdin_stdout", "input": "2750054323692292581\n", "output": "107965550311522536\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "39259424579862572\n"}, {"type": "stdin_stdout", "input": "100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKurt reaches nirvana when he finds the product of all the digits of some positive integer. Greater value of the product makes the nirvana deeper.\n\nHelp Kurt find the maximum possible product of digits among all integers... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "2000000000\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "1382011913\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "1999999999\n", "output": "387420489\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe will define Ginkgo numbers and multiplication on Ginkgo numbers.\n\nA Ginkgo number is a pair <m, n> where m and n are integers. For example, <1, 1>, <-2, 1> and <-3,-1> are Ginkgo numbers.\n\nThe multiplication on Gin... | [{"type": "stdin_stdout", "input": "8\n10 -1\n-2 12\n1 3\n6 -1\n1 -40\n-8 0\n-4 1\n2 -1", "output": "P\nC\nC\nP\nP\nC\nP\nP\n"}, {"type": "stdin_stdout", "input": "8\n10 -1\n0 2\n-1 2\n4 0\n0 -25\n-4 0\n-2 -1\n2 -1", "output": "P\nC\nP\nC\nC\nC\nP\nP\n"}, {"type": "stdin_stdout", "input": "8\n10 -1\n-1 4\n0 3\n6 -1\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJump is a simple one-player game:\n\nYou are initially at the first cell of an array of cells containing non-negative integers;\n\nAt each step you can jump ahead in the array as far as the integer at the current cell, or... | [{"input": "[11, 6, 11, 0, 2, 1, 14, 3, 7, 6, 2, 1, 10, 6, 0, 0, 8, 10, 2, 12, 13, 11, 14, 6, 1, 4, 14, 3, 10, 4, 14, 2, 3, 10, 8, 13, 14, 8, 2, 13, 11, 14, 0, 1, 6, 2, 1, 6, 8, 2, 0, 12, 4, 9, 2, 6, 8, 14, 4, 14, 4, 10, 8, 7, 12, 11, 0, 3, 8, 0, 13, 9, 9, 11, 10, 13, 12, 1, 0, 10, 14, 6, 1, 11, 7, 8, 6, 2, 1, 3, 1, 1,... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th element equals the arithmetic mean of all other elements (that is all elements except for this one).\n\nInput\n\nThe fi... | [{"type": "stdin_stdout", "input": "15\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "15\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n"}, {"type": "stdin_stdout", "input": "10\n3 3 3 3 3 4 3 3 3 2\n", "output": "8\n1 2 3 4 5 7 8 9\n"}, {"type": "stdin_stdout", "input": "10\n15 7 10 7 7 7 4 4 7 2\n", "output": "5\n2 4 5 6 9\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe sports centre needs repair. Vandals have been kicking balls so hard into the roof that some of the tiles have started sticking up. The roof is represented by r.\n\nAs a quick fix, the committee have decided to place a... | [{"input": "\" ikm il h llmmc a i\"\n\"__\\\\_______________________\"", "output": "[true]", "fn_name": "roof_fix"}, {"input": "\" cg dg em lfh cdam\"\n\"_______/____\\\\_____/_/\"", "output": "[false]", "fn_name": "roof_fix"}, {"input": "\" l f l k djmi k\"\n\"___\\\\_____//_____/_\"", "output": "[false]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of n problems, and they want to select any non-empty subset of it as a problemset.\n\nk expe... | [{"type": "stdin_stdout", "input": "10 4\n1 0 1 0\n1 0 0 1\n1 1 0 1\n1 0 1 1\n1 1 0 1\n1 0 1 0\n0 0 0 0\n0 0 1 0\n1 0 1 0\n0 0 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 4\n1 0 1 0\n1 0 1 0\n0 1 1 1\n1 0 1 1\n1 1 0 1\n1 0 0 1\n0 1 1 1\n0 0 0 1\n1 1 1 1\n1 0 1 0\n", "output": "YES\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make M by adding elements in A, otherwise \"no\". You can use an element only once.\n\nYou are given the sequence A a... | [{"type": "stdin_stdout", "input": "5\n-1 5 10 1 21\n8\n1 8 31 11 16 14 001 40", "output": "yes\nno\nyes\nyes\nyes\nyes\nyes\nno\n"}, {"type": "stdin_stdout", "input": "5\n1 5 13 3 21\n8\n0 4 17 11 22 21 010 42", "output": "yes\nyes\nyes\nno\nyes\nyes\nno\nyes\n"}, {"type": "stdin_stdout", "input": "5\n1 5 7 3 21\n8\n0... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.