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\nFor some reason in many American cartoons anvils fall from time to time onto heroes' heads. Of course, safes, wardrobes, cruisers, planes fall sometimes too... But anvils do so most of all.\n\nAnvils come in different siz... | [{"type": "stdin_stdout", "input": "90\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n1 2\n2 2\n3 2\n4 2\n5 2\n6 2\n7 2\n8 2\n9 2\n1 3\n2 3\n3 3\n4 3\n5 3\n6 3\n7 3\n8 3\n9 3\n1 4\n2 4\n3 4\n4 4\n5 4\n6 4\n7 4\n8 4\n9 4\n1 5\n2 5\n3 5\n4 5\n5 5\n6 5\n7 5\n8 5\n9 5\n1 6\n2 6\n3 6\n4 6\n5 6\n6 6\n7 6\n8 6\n9 6\n1 7\n2 7\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a_1, a_2, \\dots, a_n$. You can perform the following operation any number of times: Choose a pair of two neighboring equal elements $a_i = a_{i + 1}$ (if there is at least one such pair). Replac... | [{"type": "stdin_stdout", "input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of ... | [{"type": "stdin_stdout", "input": "50\n48 45 42\n32 45 8\n15 41 47\n32 29 38\n7 16 48\n19 9 21\n18 40 5\n39 40 7\n37 0 6\n42 15 37\n9 33 37\n40 41 33\n25 43 2\n23 21 38\n30 20 32\n28 15 5\n47 9 19\n47 22 26\n26 9 18\n24 23 24\n11 29 5\n38 44 9\n49 22 42\n1 15 32\n18 25 21\n8 48 39\n48 7 26\n3 30 26\n34 21 47\n34 14 4\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement a function called makeAcronym that returns the first letters of each word in a passed in string.\n\nMake sure the letters returned are uppercase.\n\nIf the value passed in is not a string return 'Not a string'.\... | [{"input": "\"How much wood would a woodchuck chuck if a woodchuck could chuck wood\"", "output": "[\"HMWWAWCIAWCCW\"]", "fn_name": "make_acronym"}, {"input": "\"Please excuse my dear aunt Sally\"", "output": "[\"PEMDAS\"]", "fn_name": "make_acronym"}, {"input": "\"Unique New York\"", "output": "[\"UNY\"]", "fn_name": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen little Petya grew up and entered the university, he started to take part in АСМ contests. Later he realized that he doesn't like how the АСМ contests are organised: the team could only have three members (and he coul... | [{"type": "stdin_stdout", "input": "16 25\nbBZ\nEr\nZ\nrYJmfZLgmx\nPaJNrF\naHtRqSxOO\nD\nhsagsG\nMDuBOXrmWH\nSgjMQZ\nYXgWq\nxDwpppG\nSDY\nJwZWx\ncOzrgrBaE\nFJYX\nYXgWq SgjMQZ\nSDY PaJNrF\nFJYX rYJmfZLgmx\nhsagsG Er\nxDwpppG rYJmfZLgmx\naHtRqSxOO rYJmfZLgmx\nhsagsG bBZ\nJwZWx hsagsG\nFJYX cOzrgrBaE\nSDY YXgWq\nFJYX Z\nJ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that takes an array/list of numbers and returns a number such that \n\nExplanation\ntotal([1,2,3,4,5]) => 48\n\n1+2=3--\\ 3+5 => 8 \\\n2+3=5--/ \\ == 8+12=>20\\ \n ==>5+7=> 12... | [{"input": "[-1, -1, -10, 42, 92, 1, 23, 6, -3]", "output": "[9248]", "fn_name": "total"}, {"input": "[4, 4, 52, 23, 32, 1, -1]", "output": "[1753]", "fn_name": "total"}, {"input": "[1, 2, 3, 4, 5]", "output": "[48]", "fn_name": "total"}, {"input": "[4, 4, 5, -1]", "output": "[30]", "fn_name": "total"}, {"input": "[-1,... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA faro shuffle of a deck of playing cards is a shuffle in which the deck is split exactly in half and then the cards in the two halves are perfectly interwoven, such that the original bottom card is still on the bottom an... | [{"input": "1250", "output": "[156]", "fn_name": "faro_cycles"}, {"input": "542", "output": "[540]", "fn_name": "faro_cycles"}, {"input": "1954", "output": "[30]", "fn_name": "faro_cycles"}, {"input": "52", "output": "[8]", "fn_name": "faro_cycles"}, {"input": "2", "output": "[1]", "fn_name": "faro_cycles"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive).\nThere are K^N such sequences. Find the sum of \\gcd(A_1, ..., A_N) over all of them.\nSince this sum can be enormous, p... | [{"type": "stdin_stdout", "input": "100000 100000\n", "output": "742202979\n"}, {"type": "stdin_stdout", "input": "101000 100000", "output": "817082185\n"}, {"type": "stdin_stdout", "input": "101010 100000", "output": "781111243\n"}, {"type": "stdin_stdout", "input": "99991 99989\n", "output": "215961669\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor each k=1, ..., N, solve the problem below:\n - Consider writing a number on each vertex in the tree in the follo... | [{"type": "stdin_stdout", "input": "8\n1 3\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8", "output": "240\n240\n1680\n240\n240\n1008\n144\n144\n"}, {"type": "stdin_stdout", "input": "8\n1 3\n2 3\n5 4\n3 5\n3 6\n3 7\n3 8", "output": "360\n360\n2520\n120\n840\n360\n360\n360\n"}, {"type": "stdin_stdout", "input": "8\n1 2\n2 3\n2 4\n3 5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every grandma knows that one should treat warts when the moon goes down. Thus, Vitya has to catch the moment when the ... | [{"type": "stdin_stdout", "input": "92\n13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12\n", "output": "DOWN\n"}, {"type": "stdin_stdout", "input": "9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$ consisting of zeros. You perform $n$ actions with this array: during the $i$-th action, the following sequence of operations appears: Choose the maximum by length subarray (contin... | [{"type": "stdin_stdout", "input": "6\n4\n4\n2\n26\n2\n10\n", "output": "3 1 2 4\n3 1 2 4\n1 2\n11 16 7 12 17 3 13 18 4 19 8 20 1 14 21 5 22 9 23 2 15 24 6 25 10 26\n1 2\n7 3 4 8 1 5 9 2 6 10\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n2\n16\n3\n21\n", "output": "1 2\n1 2\n1 2\n9 5 10 3 11 6 12 1 13 7 14 2 15 4 8 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe all love the future president (or Führer or duce or sōtō as he could find them more fitting) donald trump, but we might fear that some of his many fans like John Miller or John Barron are not making him justice, soundi... | [{"input": "\"listen migrants: IIII KIIIDD YOOOUUU NOOOOOOTTT\"", "output": "[1.56]", "fn_name": "trump_detector"}, {"input": "\"America NUUUUUKEEEE Oooobaaaamaaaaa\"", "output": "[1.89]", "fn_name": "trump_detector"}, {"input": "\"MEXICAAAAAAAANS GOOOO HOOOMEEEE\"", "output": "[2.5]", "fn_name": "trump_detector"}, {"i... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou probably know the \"like\" system from Facebook and other pages. People can \"like\" blog posts, pictures or other items. We want to create the text that should be displayed next to such an item.\n\nImplement a functi... | [{"input": "[\"Alex\", \"Jacob\", \"Mark\", \"Max\"]", "output": "[\"Alex, Jacob and 2 others like this\"]", "fn_name": "likes"}, {"input": "[\"Max\", \"John\", \"Mark\"]", "output": "[\"Max, John and Mark like this\"]", "fn_name": "likes"}, {"input": "[\"Jacob\", \"Alex\"]", "output": "[\"Jacob and Alex like this\"]",... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows that both these species enjoy destroying everything they encounter. However, a little-known fact about them is that they both also love ... | [{"type": "stdin_stdout", "input": "10\n11 11\n11 12\n11 15\n11 17\n11 18\n11 19\n11 28\n11 33\n11 38\n11 40\n12 11\n15 46\n17 11\n17 46\n18 46\n19 11\n19 46\n20 11\n20 46\n24 46\n25 46\n26 11\n32 11\n32 46\n33 11\n34 46\n36 11\n39 11\n40 46\n43 11\n44 0\n46 14\n46 15\n46 17\n46 22\n46 26\n46 28\n46 32\n46 43\n46 45\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCasimir has a string $s$ which consists of capital Latin letters 'A', 'B', and 'C' only. Each turn he can choose to do one of the two following actions:\n\nhe can either erase exactly one letter 'A' and exactly one letter... | [{"type": "stdin_stdout", "input": "6\nABABAB\nABBA\nBC\nABC\nCABBCB\nBBCBCBCBCBCCCBCB\n", "output": "YES\nYES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\nBBAACB\nABBA\nBC\nABA\nACBCBB\nCBCBCBCBCBCBCBCB\n", "output": "YES\nYES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\nABACAB\nABBA\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke found a random number generator. It generates an integer between 0 and 2^N-1 (inclusive). An integer sequence A_0, A_1, \\cdots, A_{2^N-1} represents the probability that each of these integers is generated. The int... | [{"type": "stdin_stdout", "input": "4\n337 780 799 18 796 875 331 223 1804 67 268 483 390 565 116 355", "output": "0\n870892872\n738673049\n866136893\n809360917\n134965576\n496873404\n200938352\n392063026\n225113281\n769068776\n945265000\n612087551\n845908556\n726467732\n606029955\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMole is hungry again. He found one ant colony, consisting of n ants, ordered in a row. Each ant i (1 ≤ i ≤ n) has a strength si.\n\nIn order to make his dinner more interesting, Mole organizes a version of «Hunger Games» ... | [{"type": "stdin_stdout", "input": "5\n1 5 2 4 2\n4\n1 5\n2 5\n3 5\n4 5\n", "output": "4\n4\n1\n1\n"}, {"type": "stdin_stdout", "input": "5\n1 3 4 4 2\n4\n1 5\n2 5\n3 5\n4 5\n", "output": "4\n4\n2\n1\n"}, {"type": "stdin_stdout", "input": "5\n1 3 4 4 2\n4\n1 5\n2 5\n3 5\n2 5\n", "output": "4\n4\n2\n4\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Elephant is playing a game with arrays. He is given an array A0, A1, ..., AN−1 of N integers. And then Q queries are given, each containing an integer K. He has to tell how many subarrays satisfy the condition: the... | [{"type": "stdin_stdout", "input": "5\n4 1 2 3 4\n4\n3\n4\n6\n1\n\n\n", "output": "2\n2\n0\n8\n"}, {"type": "stdin_stdout", "input": "5\n4 1 1 6 4\n4\n1\n0\n1\n-1", "output": "11\n0\n11\n0\n"}, {"type": "stdin_stdout", "input": "5\n4 1 1 6 4\n4\n0\n5\n1\n-1", "output": "0\n0\n11\n0\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya’s elder brother Petya loves playing computer games. In one of his favourite computer games Petya reached the final level where a fight with the boss take place.\n\nWhile playing the game Petya found spell scrolls an... | [{"type": "stdin_stdout", "input": "70 1000 1\n91 2\n43 1\n100 1\n79 2\n26 1\n68 2\n4 2\n64 1\n100 1\n80 2\n20 2\n70 1\n25 1\n99 1\n64 1\n35 2\n60 1\n63 2\n93 1\n40 2\n100 1\n54 1\n100 1\n15 2\n72 1\n28 1\n5 1\n93 1\n100 2\n39 2\n54 2\n100 1\n55 1\n43 1\n20 1\n28 2\n21 1\n100 2\n98 1\n35 1\n12 2\n50 2\n7 2\n7 2\n12 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the following well known rules:\n\n- A number is divisible by 3 if the sum of its digits is divisible by 3. Let's call '3' a \"1-sum\" prime\n- For 37, we take numbers in groups of threes from the right and check... | [{"input": "45939401", "output": "[\"11484850-altsum\"]", "fn_name": "solve"}, {"input": "24701723", "output": "[\"12350861-sum\"]", "fn_name": "solve"}, {"input": "376049", "output": "[\"47006-altsum\"]", "fn_name": "solve"}, {"input": "999883", "output": "[\"499941-sum\"]", "fn_name": "solve"}, {"input": "47", "outpu... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBorn a misinterpretation of [this kata](https://www.codewars.com/kata/simple-fun-number-334-two-beggars-and-gold/), your task here is pretty simple: given an array of values and an amount of beggars, you are supposed to r... | [{"input": "[1, 2, 3, 4, 5]\n6", "output": "[[1, 2, 3, 4, 5, 0]]", "fn_name": "beggars"}, {"input": "[1, 2, 3, 4, 5]\n3", "output": "[[5, 7, 3]]", "fn_name": "beggars"}, {"input": "[1, 2, 3, 4, 5]\n2", "output": "[[9, 6]]", "fn_name": "beggars"}, {"input": "[1, 2, 3, 4, 5]\n1", "output": "[[15]]", "fn_name": "beggars"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence A, where its elements are either in the form + x or -, where x is an integer.\n\nFor such a sequence S where its elements are either in the form + x or -, define f(S) as follows:\n\n * iterate th... | [{"type": "stdin_stdout", "input": "15\n+ 2101039\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "output": "431927902\n"}, {"type": "stdin_stdout", "input": "15\n+ 2168539\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRoger is a robot. He has an arm that is a series of n segments connected to each other. The endpoints of the i-th segment are initially located at points (i - 1, 0) and (i, 0). The endpoint at (i - 1, 0) is colored red an... | [{"type": "stdin_stdout", "input": "50 50\n1 41 261\n2 47 324\n1 41 256\n1 31 339\n2 23 116\n2 44 184\n2 32 115\n1 40 301\n2 40 303\n1 29 309\n2 49 348\n2 47 356\n1 41 263\n2 42 276\n1 45 135\n1 33 226\n2 31 166\n1 50 171\n2 47 166\n2 50 146\n2 25 324\n2 48 307\n2 41 176\n1 50 353\n1 45 323\n2 50 343\n1 47 200\n2 48 26... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nC: Skewering\n\nproblem\n\nOne day, when Homura was playing with blocks, Tempura came. Homura decided to play with blocks with Tempura.\n\nThere is a rectangular parallelepiped of A \\ times B \\ times C, which is made by... | [{"type": "stdin_stdout", "input": "28 11 20", "output": "Tem\n"}, {"type": "stdin_stdout", "input": "28 11 17", "output": "Hom\n"}, {"type": "stdin_stdout", "input": "54 11 17", "output": "Hom\n"}, {"type": "stdin_stdout", "input": "12 6 20", "output": "Tem\n"}, {"type": "stdin_stdout", "input": "24 6 20", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Your story\nYou've always loved both Fizz Buzz katas and cuckoo clocks, and when you walked by a garage sale and saw an ornate cuckoo clock with a missing pendulum, and a \"Beyond-Ultimate Raspberry Pi Starter Kit\" fi... | [{"input": "\"00:00\"", "output": "[\"Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo\"]", "fn_name": "fizz_buzz_cuckoo_clock"}, {"input": "\"12:00\"", "output": "[\"Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo\"]", "fn_name": "fizz_buzz_cuckoo_... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt the end of last year, Santa Claus forgot to give Christmas presents to the children in JOI village. Therefore, I decided to deliver the chocolate cake to the children as an apology. The day to deliver is approaching to... | [{"type": "stdin_stdout", "input": "12 8\n3\n-1 1\n3 4\n18 6", "output": "31\n3 4\n"}, {"type": "stdin_stdout", "input": "1 4\n3\n1 -1\n0 6\n2 -1", "output": "10\n1 -1\n"}, {"type": "stdin_stdout", "input": "12 8\n3\n-1 1\n3 4\n18 5", "output": "30\n3 4\n"}, {"type": "stdin_stdout", "input": "12 8\n3\n-1 1\n5 4\n10 5",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA [Power Law](https://en.wikipedia.org/wiki/Power_law) distribution occurs whenever \"a relative change in one quantity results in a proportional relative change in the other quantity.\" For example, if *y* = 120 when *x*... | [{"input": "[1, 120]\n[1, 120]\n1", "output": "[120]", "fn_name": "power_law"}, {"input": "[1, 120]\n[3, 60]\n27", "output": "[15]", "fn_name": "power_law"}, {"input": "[1, 120]\n[9, 30]\n27", "output": "[15]", "fn_name": "power_law"}, {"input": "[1, 120]\n[2, 60]\n4", "output": "[30]", "fn_name": "power_law"}, {"input... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs we all know, F.C. Barcelona is the best soccer team of our era! Their entangling and mesmerizing game style usually translates into very high ball possession, consecutive counter-attack plays and goals. Lots of goals, ... | [{"type": "stdin_stdout", "input": "2\n28 3\n8 2", "output": "198073708\n86\n"}, {"type": "stdin_stdout", "input": "2\n28 3\n8 1", "output": "198073708\n1\n"}, {"type": "stdin_stdout", "input": "2\n28 3\n8 0", "output": "198073708\n0\n"}, {"type": "stdin_stdout", "input": "2\n16 3\n8 2", "output": "10761681\n86\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLimak is a little polar bear. He has n balls, the i-th ball has size t_{i}.\n\nLimak wants to give one ball to each of his three friends. Giving gifts isn't easy — there are two rules Limak must obey to make friends happy... | [{"type": "stdin_stdout", "input": "50\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "output": "NO\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are two towers consisting of blocks of two colors: red and blue. Both towers are represented by strings of characters B and/or R denoting the order of blocks in them from the bottom to the top, where B corresponds t... | [{"type": "stdin_stdout", "input": "23\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n1 1\nR\nB\n", "output": "YES\nYES\nYES... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call the string beautiful if it does not contain a substring of length at least $2$, which is a palindrome. Recall that a palindrome is a string that reads the same way from the first character to the last and from ... | [{"type": "stdin_stdout", "input": "10 3\naaabababaa\n1 1\n2 10\n1 2\n", "output": "0\n6\n1\n"}, {"type": "stdin_stdout", "input": "10 3\naaabababaa\n1 1\n3 10\n1 2\n", "output": "0\n5\n1\n"}, {"type": "stdin_stdout", "input": "10 3\naaabababaa\n1 1\n2 10\n1 4\n", "output": "0\n6\n2\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya studies at university. The current academic year finishes with $n$ special days. Petya needs to pass $m$ exams in those special days. The special days in this problem are numbered from $1$ to $n$.\n\nThere are three... | [{"type": "stdin_stdout", "input": "100 43\n76 77 1\n24 25 1\n2 3 1\n85 86 1\n49 50 1\n15 16 1\n30 31 1\n78 79 1\n54 55 1\n58 59 1\n17 18 1\n67 68 1\n21 22 1\n80 81 1\n35 36 1\n8 9 1\n83 84 1\n44 45 1\n62 63 1\n64 65 1\n72 73 1\n27 28 1\n56 57 1\n12 13 1\n40 41 1\n32 33 1\n52 53 1\n70 71 1\n97 98 1\n37 38 1\n87 88 1\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA core idea of several left-wing ideologies is that the wealthiest should *support* the poorest, no matter what and that is exactly what you are called to do using this kata (which, on a side note, was born out of the nec... | [{"input": "[24, 48, 22, 19, 37]\n30", "output": "[[30, 30, 30, 30, 30]]", "fn_name": "socialist_distribution"}, {"input": "[2, 3, 5, 15, 75]\n20", "output": "[[20, 20, 20, 20, 20]]", "fn_name": "socialist_distribution"}, {"input": "[2, 3, 5, 15, 75]\n5", "output": "[[5, 5, 5, 15, 70]]", "fn_name": "socialist_distribut... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between the easy and hard versions are the locations you can teleport to.\n\nConsider the points $0,1,\\dots,n+1$ on the number line. There is a teleporter located on each of the points $1,2,\\dots,n$.... | [{"type": "stdin_stdout", "input": "1\n100 123\n398 282 403 364 468 174 143 360 217 340 354 195 84 253 114 421 494 370 104 214 149 469 446 362 108 106 115 402 253 461 483 59 365 94 281 84 248 321 228 196 96 360 321 357 151 250 496 207 425 397 114 345 252 489 30 345 182 310 440 392 111 361 49 307 328 84 201 339 351 459 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSince I got tired to write long problem statements, I decided to make this problem statement short. For given positive integer L, how many pairs of positive integers a, b (a ≤ b) such that LCM(a, b) = L are there? Here, L... | [{"type": "stdin_stdout", "input": "12\n7\n24\n0", "output": "8\n2\n11\n"}, {"type": "stdin_stdout", "input": "12\n11\n2\n0", "output": "8\n2\n2\n"}, {"type": "stdin_stdout", "input": "12\n15\n2\n0", "output": "8\n5\n2\n"}, {"type": "stdin_stdout", "input": "12\n11\n4\n0", "output": "8\n2\n3\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMin Element\n\nGiven the sequence a_1, a_2, .., a_N.\n\nFind the minimum number in this sequence.\n\nIf the minimum value is in more than one place, answer the one with the lowest number.\n\ninput\n\n\nN\na_1 a_2 ... a_N\... | [{"type": "stdin_stdout", "input": "6\n10 17 3 2 6 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 33 0 2 10 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 55 0 2 10 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 55 0 4 10 -1", "output": "6\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSoon after the Chunga-Changa island was discovered, it started to acquire some forms of civilization and even market economy. A new currency arose, colloquially called \"chizhik\". One has to pay in chizhiks to buy a coco... | [{"type": "stdin_stdout", "input": "500000000000000000 500000000000000000 1000000000000000000\n", "output": "1 500000000000000000\n"}, {"type": "stdin_stdout", "input": "500000000000000000 500000000000000000 1000000000000000000\n", "output": "1 500000000000000000\n"}, {"type": "stdin_stdout", "input": "3509193081606779... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement function which will return sum of roots of a quadratic equation rounded to 2 decimal places, if there are any possible roots, else return **None/null/nil/nothing**. If you use discriminant,when discriminant = 0,... | [{"input": "1\n-1.6666666666666667\n-26", "output": "[1.67]", "fn_name": "roots"}, {"input": "8\n47\n41", "output": "[-5.88]", "fn_name": "roots"}, {"input": "1\n-35\n-23", "output": "[35]", "fn_name": "roots"}, {"input": "3\n11\n6", "output": "[-3.67]", "fn_name": "roots"}, {"input": "7\n-2\n-5", "output": "[0.29]", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of a journey in London, UK. The sequence will contain bus **numbers** and TFL tube names as **strings** e.g.\n\n```python\n['Northern', 'Central', 243, 1, 'Victoria']\n```\nJourneys will always on... | [{"input": "[\"Northern\", \"Central\", \"Circle\"]", "output": "[\"\\u00a37.20\"]", "fn_name": "london_city_hacker"}, {"input": "[12, \"Central\", \"Circle\", 21]", "output": "[\"\\u00a37.80\"]", "fn_name": "london_city_hacker"}, {"input": "[\"Piccidilly\", 56, 93, 243]", "output": "[\"\\u00a35.40\"]", "fn_name": "lon... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the advanced algorithm class, n2 students sit in n rows and n columns. One day, a professor who teaches this subject comes into the class, asks the shortest student in each row to lift up his left hand, and the tallest... | [{"type": "stdin_stdout", "input": "3\n1 2 5\n11 3 6\n12 5 9\n3\n1 11 3\n13 11 14\n4 8 6\n0", "output": "5\n11\n"}, {"type": "stdin_stdout", "input": "3\n2 1 3\n4 2 11\n7 0 4\n3\n1 4 12\n14 10 18\n4 8 10\n0", "output": "2\n10\n"}, {"type": "stdin_stdout", "input": "3\n1 2 10\n11 3 6\n12 9 15\n3\n1 11 3\n13 11 9\n7 8 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program that reads the coordinates of the vertices of a convex n-sided polygon (a polygon whose internal angles are less than 180 degrees, that is, a polygon that is not dented) and outputs its area. The vertices ... | [{"type": "stdin_stdout", "input": "0.0,0.0\n0.0,1.0\n1.0,1.0\n2.0,0.0\n1.0,-1.0", "output": "2.500000"}, {"type": "stdin_stdout", "input": "0.0,0.0\n0.0,1.0\n0.0,.11\n2.1,0.0\n1.1,-1.0", "output": "1.1655\n"}, {"type": "stdin_stdout", "input": "0.1,0.0\n0.0,1.0\n1.01,.0\n2.0,0.0\n1.0,-0.0", "output": "0.455\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ positive integers $a_1, \\ldots, a_n$, and an integer $k \\geq 2$. Count the number of pairs $i, j$ such that $1 \\leq i < j \\leq n$, and there exists an integer $x$ such that $a_i \\cdot a_j = x^k$.\n\... | [{"type": "stdin_stdout", "input": "100 3\n94 94 149 27 80 73 61 38 34 139 72 96 59 36 113 15 83 78 39 22 21 57 54 20 9 32 81 64 55 90 67 41 18 57 93 76 44 62 77 66 31 70 39 73 81 57 43 31 20 104 62 26 44 26 23 23 66 53 3 14 10 170 53 19 43 81 98 12 91 15 122 90 89 86 58 30 67 73 46 69 68 47 30 7 89 35 17 93 45 6 4 23 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a regular polygon with $n$ vertices labeled from $1$ to $n$ in counter-clockwise order. The triangulation of a given polygon is a set of triangles such that each vertex of each triangle is a vertex of the in... | [{"type": "stdin_stdout", "input": "500\n", "output": "41666498\n"}, {"type": "stdin_stdout", "input": "497\n", "output": "40920990\n"}, {"type": "stdin_stdout", "input": "494\n", "output": "40184428\n"}, {"type": "stdin_stdout", "input": "491\n", "output": "39456758\n"}, {"type": "stdin_stdout", "input": "488\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA binary string is a string that consists of characters $0$ and $1$. A bi-table is a table that has exactly two rows of equal length, each being a binary string.\n\nLet $\\operatorname{MEX}$ of a bi-table be the smallest ... | [{"type": "stdin_stdout", "input": "4\n7\n0001000\n1101100\n5\n01001\n10110\n2\n01\n01\n6\n010000\n011111\n", "output": "10\n10\n2\n10\n"}, {"type": "stdin_stdout", "input": "4\n7\n0101000\n1100100\n5\n01100\n10101\n2\n01\n01\n6\n000100\n111111\n", "output": "10\n8\n2\n10\n"}, {"type": "stdin_stdout", "input": "4\n7\n0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA grid is a perfect starting point for many games (Chess, battleships, Candy Crush!).\n\nMaking a digital chessboard I think is an interesting way of visualising how loops can work together.\n\nYour task is to write a fun... | [{"input": "6\n6", "output": "[[[\"O\", \"X\", \"O\", \"X\", \"O\", \"X\"], [\"X\", \"O\", \"X\", \"O\", \"X\", \"O\"], [\"O\", \"X\", \"O\", \"X\", \"O\", \"X\"], [\"X\", \"O\", \"X\", \"O\", \"X\", \"O\"], [\"O\", \"X\", \"O\", \"X\", \"O\", \"X\"], [\"X\", \"O\", \"X\", \"O\", \"X\", \"O\"]]]", "fn_name": "chess_boa... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA tutorial for this problem is now available on our blog. Click here to read it. \n\nYou are asked to calculate factorials of some small positive integers.\n\n------ Input ------ \n\nAn integer t, 1≤t≤100, denoting the n... | [{"type": "stdin_stdout", "input": "4\n1\n2\n4\n57", "output": "1\n2\n24\n40526919504877216755680601905432322134980384796226602145184481280000000000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n3\n10\n29", "output": "120\n6\n3628800\n8841761993739701954543616000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n4\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe police department of your city has just started its journey. Initially, they don’t have any manpower. So, they started hiring new recruits in groups.\n\nMeanwhile, crimes keeps occurring within the city. One member of... | [{"type": "stdin_stdout", "input": "146\n4 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 3 -1 3 -1 -1 1 4 -1 2 -1 -1 3 -1 -1 -1 4 1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 3 2 -1 3 2 4 5 2 4 1 5 -1 -1 2 -1 -1 1 -1 5 3 -1 1 2 2 3 5 3 -1 -1 3 -1 -1 3 5 5 -1 -1 5 -1 4 4 1 -1 -1 -1 2 1 -1 -1 -1 2 5 3 -1 -1 -1 3 -1 5 4 -1 1 -1 -1 3 -1 -1 3 1 1 2 -1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDuring a voyage of the starship Hakodate-maru (see Problem A), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of \"super stars\". Do not take this... | [{"type": "stdin_stdout", "input": "4\n10.431258066320945 10.00000 10.963374203026609\n21.297630146026126 10.00000 10.00000\n20.00000 20.997700286656844 10.00000\n11.414338431837134 20.00000 10.00000\n4\n11.03531062521475 12.469639655902677 10.968703737628516\n10.00000 51.12714506944212 50.70404839090845\n51.1844286530... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has a pile, that consists of some number of stones. $n$ times he either took one stone from the pile or added one stone to the pile. The pile was non-empty before each operation of taking one stone from the pile.\n\... | [{"type": "stdin_stdout", "input": "100\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is known that each weight of 1 gram, 3 gram, 9 gram, and 27 gram can be weighed from 1 gram to 40 gram in 1 gram increments using a balance. For example, if you put a weight of 3 grams and a weight you want to weigh on... | [{"type": "stdin_stdout", "input": "1204", "output": "+--00--+\n"}, {"type": "stdin_stdout", "input": "1942", "output": "+0-000-+\n"}, {"type": "stdin_stdout", "input": "384", "output": "+---+-0\n"}, {"type": "stdin_stdout", "input": "567", "output": "+-+0000\n"}, {"type": "stdin_stdout", "input": "397", "output": "+--... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday Pari and Arya are playing a game called Remainders.\n\nPari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value <image>. There are n ancient numbers c1, c2, ..., cn and Pari... | [{"type": "stdin_stdout", "input": "61 531012\n698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 963349 698043 698043 698043 698043 966694 698043 698043 698043 698043 698043 698043 636247 698043 963349 698043 698043 698043 698043 697838 698043 989253 698043 698043 966694 698043 698043 698043 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe King of Flatland will organize a knights' tournament! The winner will get half the kingdom and the favor of the princess of legendary beauty and wisdom. The final test of the applicants' courage and strength will be a... | [{"type": "stdin_stdout", "input": "847094637 -152905363 -1000000000 -1000000000\n", "output": "FIRST\n-152905363\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000000000 1230987 17135570\n", "output": "FIRST\n-983588156\n"}, {"type": "stdin_stdout", "input": "547686188 61562151 -496372503 -115242932\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n numbers a_1, a_2, ..., a_{n}. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make [Image] as large as possible, where $1$ denotes the bitwise ... | [{"type": "stdin_stdout", "input": "5 10 8\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "1073741825000000000\n"}, {"type": "stdin_stdout", "input": "5 10 8\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "1073741825000000000\n"}, {"type": "stdin_stdout", "input": "5 10 8\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSpace Coconut Crab\n\nSpace coconut crab\n\nEnglish text is not available in this practice contest.\n\nKen Marine Blue is a space hunter who travels through the entire galaxy in search of space coconut crabs. The space co... | [{"type": "stdin_stdout", "input": "1\n2\n4\n48\n266\n1236\n0", "output": "1\n2\n2\n12\n14\n36\n"}, {"type": "stdin_stdout", "input": "1\n2\n4\n48\n266\n1300\n0", "output": "1\n2\n2\n12\n14\n38\n"}, {"type": "stdin_stdout", "input": "1\n2\n4\n27\n557\n1250\n0", "output": "1\n2\n2\n3\n23\n44\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.\n\nGiven a sequence a consisting of n integers. The player can m... | [{"type": "stdin_stdout", "input": "100\n4 8 10 1 8 8 8 1 10 3 1 8 6 8 6 1 10 3 3 3 3 7 2 1 1 6 10 1 7 9 8 10 3 8 6 2 1 6 5 6 10 8 9 7 4 3 10 5 3 9 10 5 10 8 8 5 7 8 9 5 3 18 9 2 7 8 2 10 4 9 2 8 10 10 5 8 5 1 7 3 4 5 2 2 9 3 2 5 6 2 3 10 1 5 9 6 10 4 10 8\n", "output": "392\n"}, {"type": "stdin_stdout", "input": "100\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMany computer strategy games require building cities, recruiting army, conquering tribes, collecting resources. Sometimes it leads to interesting problems. \n\nLet's suppose that your task is to build a square city. The w... | [{"type": "stdin_stdout", "input": "10\n-260530833 169589238\n-681955770 -35391010\n223450511 24504262\n479795061 -26191863\n-291344265 21153856\n714700263 -328447419\n-858655942 161086142\n-270884153 462537328\n-501424901 977460517\n115284904 -151626824\n", "output": "2475449747812002025\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have an array $a$ of length $n$. For every positive integer $x$ you are going to perform the following operation during the $x$-th second:\n\n Select some distinct indices $i_{1}, i_{2}, \\ldots, i_{k}$ which are bet... | [{"type": "stdin_stdout", "input": "6\n3\n1000000000 -1 -1000000000\n1\n6\n2\n-1000000000 1000000000\n2\n1000000000 -1000000000\n2\n1000000000 1000000000\n2\n-1000000000 -1000000000\n", "output": "31\n0\n0\n31\n0\n0\n"}, {"type": "stdin_stdout", "input": "6\n3\n1000000000 0 -1000000000\n1\n6\n2\n-1000000000 1000000000\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n```if-not:ruby\nCreate a function, that accepts an arbitrary number of arrays and returns a single array generated by alternately appending elements from the passed in arguments. If one of them is shorter than the others,... | [{"input": "[null]\n[null, null]\n[null, null, null]", "output": "[[null, null, null, null, null, null, null, null, null]]", "fn_name": "interleave"}, {"input": "[1, 2, 3]\n[4, 5, 6]\n[7, 8, 9]", "output": "[[1, 4, 7, 2, 5, 8, 3, 6, 9]]", "fn_name": "interleave"}, {"input": "[1, 2, 3]\n[\"c\", \"d\", \"e\"]", "output":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn 2937, DISCO creates a new universe called DISCOSMOS to celebrate its 1000-th anniversary.\n\nDISCOSMOS can be described as an H \\times W grid. Let (i, j) (1 \\leq i \\leq H, 1 \\leq j \\leq W) denote the square at the... | [{"type": "stdin_stdout", "input": "1486 120 1001", "output": "960152848\n"}, {"type": "stdin_stdout", "input": "328 102 1011", "output": "261361566\n"}, {"type": "stdin_stdout", "input": "328 102 1111", "output": "647647330\n"}, {"type": "stdin_stdout", "input": "328 117 1011", "output": "407646568\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRoma is programmer and he likes memes about IT, \nMaxim is chemist and he likes memes about chemistry, \nDanik is designer and he likes memes about design, \nand Vlad likes all other memes.\n\n___\n\nYou will be given ... | [{"input": "\"This could be chemistry meme but our gey word boom is too late\"", "output": "[\"Roma\"]", "fn_name": "memesorting"}, {"input": "\"This is also programbur meme gecause it has needed key word\"", "output": "[\"Roma\"]", "fn_name": "memesorting"}, {"input": "\"This is edsigner meme cause it has key word\"",... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKamil likes streaming the competitive programming videos. His MeTube channel has recently reached 100 million subscribers. In order to celebrate this, he posted a video with an interesting problem he couldn't solve yet. C... | [{"type": "stdin_stdout", "input": "32\n402528994560 0 0 0 0 0 0 932646223872 893192888700 0 813583026900 0 0 0 0 143521875000 0 177570054144 186624000000 0 517655600000 202145625000 341007975000 0 116252718750 0 148561875000 0 304819200000 248474688000 0 103125000000\n29 25\n20 24\n8 21\n23 3\n32 14\n29 30\n31 24\n28 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPasha got a very beautiful string s for his birthday, the string consists of lowercase Latin letters. The letters in the string are numbered from 1 to |s| from left to right, where |s| is the length of the given string.\n... | [{"type": "stdin_stdout", "input": "xwcxggxvfqbdklewbxkjzibmufnaywuxsqvwakefxbbkfandvigasbhbatsxyqxicrosatfsfybedklsaztyyiuurfbrzmwumujy\n100\n14 43 30 13 8 19 33 7 16 14 15 35 5 18 44 1 35 1 18 7 50 47 9 49 28 29 39 37 27 17 19 12 5 24 37 42 37 23 35 31 10 26 5 38 40 34 42 47 2 40 43 32 16 25 14 45 35 38 46 48 49 27 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFizzBuzz is a game in which integers of 1 or more are spoken in order according to the following rules.\n\n* \"Fizz\" when divisible by 3\n\n* \"Buzz\" when divisible by 5\n\n* \"FizzBuzz\" when divisible by both 3 and 5\... | [{"type": "stdin_stdout", "input": "10010000000", "output": "990079BuzzFizz141999\n"}, {"type": "stdin_stdout", "input": "10010000001", "output": "90079BuzzFizz1419990\n"}, {"type": "stdin_stdout", "input": "10000000001", "output": "3FizzBuzz1418650796F\n"}, {"type": "stdin_stdout", "input": "10000001001", "output": "4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSometimes some words like \"localization\" or \"internationalization\" are so long that writing them many times in one text is quite tiresome.\n\nLet's consider a word too long, if its length is strictly more than 10 char... | [{"type": "stdin_stdout", "input": "20\nlkpmx\nkovxmxorlgwaomlswjxlpnbvltfv\nhykasjxqyjrmybejnmeumzha\ntuevlumpqbbhbww\nqgqsphvrmupxxc\ntrissbaf\nqfgrlinkzvzqdryckaizutd\nzzqtoaxkvwoscyx\noswytrlnhpjvvnwookx\nlpuzqgec\ngyzqfwxggtvpjhzmzmdw\nrlxjgmvdftvrmvbdwudra\nvsntnjpepnvdaxiporggmglhagv\nxlvcqkqgcrbgtgglj\nlyxwxbis... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIahub and Sorin are the best competitive programmers in their town. However, they can't both qualify to an important contest. The selection will be made with the help of a single problem. Blatnatalag, a friend of Iahub, m... | [{"type": "stdin_stdout", "input": "100\n-57 -64 83 76 80 27 60 76 -80 -56 52 72 -17 92 -96 87 41 -88 94 89 12 42 36 34 -100 -43 -42 62 3 87 -69 -6 -27 -59 -7 5 -90 -23 63 -87 -60 -92 -40 54 -16 -47 67 -64 10 33 -19 53 -7 -62 16 -74 -36 4 -75 -55 92 3 -22 43 -30 48 -27 88 -58 41 36 8 -40 -30 -18 16 22 -66 -91 -46 48 -6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro had his own personal computer and set a password for login. However, Taro inadvertently forgot the password. Then, remembering that there was a piece of paper with the password written down, Taro found the paper and ... | [{"type": "stdin_stdout", "input": "KUSATSU\nLSATSU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__PC", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "KUSATSU\nLSATRU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__OC", "output": "Yes\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is one card each with the numbers from \"1\" to \"10\", for a total of 10 cards. This card has numbers on the front and nothing on the back. Using this card, you and your opponent will play the game according to the... | [{"type": "stdin_stdout", "input": "1 2 3\n4 1 10\n5 1 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 2 3\n5 6 10\n4 9 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 2 3\n7 1 10\n5 1 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 4 3\n5 6 10\n4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe map of Bertown can be represented as a set of $n$ intersections, numbered from $1$ to $n$ and connected by $m$ one-way roads. It is possible to move along the roads from any intersection to any other intersection. The... | [{"type": "stdin_stdout", "input": "20 50\n20 3\n5 16\n1 3\n10 11\n10 15\n15 9\n20 9\n14 6\n16 5\n13 4\n11 5\n3 20\n13 17\n11 8\n11 6\n12 14\n16 18\n17 13\n18 7\n3 1\n8 10\n17 15\n7 2\n9 13\n5 11\n6 1\n2 16\n8 18\n10 8\n4 13\n9 15\n14 12\n1 6\n9 20\n7 18\n6 14\n7 6\n18 16\n2 7\n3 11\n15 17\n3 12\n14 10\n4 14\n19 4\n11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and $Q$ integers $x_i$ as queries, for each query, print the number of combinations of two integers $(l, r)$ which satisfies the condition: $1 \\leq l \\leq r \... | [{"type": "stdin_stdout", "input": "6 5\n1 2 3 2 7 6\n12 12 12 21 15", "output": "14\n14\n14\n21\n18\n"}, {"type": "stdin_stdout", "input": "6 5\n1 4 3 2 12 6\n10 1 22 25 23", "output": "11\n1\n18\n19\n19\n"}, {"type": "stdin_stdout", "input": "6 5\n1 4 3 2 12 1\n10 1 22 25 23", "output": "11\n2\n20\n21\n21\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCurrently, XXOC's rap is a string consisting of zeroes, ones, and question marks. Unfortunately, haters gonna hate. They will write $x$ angry comments for every occurrence of subsequence 01 and $y$ angry comments for ever... | [{"type": "stdin_stdout", "input": "?00?0?0??00100?00?001111?11???1010110100?00?0?1?1?1001??001010?011???0000???????1111?1?101100110?001\n801448 0\n", "output": "819079856\n"}, {"type": "stdin_stdout", "input": "10001?0011?0??1?1001??001?001?0100??00???0???011?00111???1?1?0?0?0??1?1?1?1?1010?1101?0000?1??11?101\n0 1\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPasha has many hamsters and he makes them work out. Today, n hamsters (n is even) came to work out. The hamsters lined up and each hamster either sat down or stood up.\n\nFor another exercise, Pasha needs exactly $\\frac{... | [{"type": "stdin_stdout", "input": "200\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "100\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDuring the quarantine, Sicromoft has more free time to create the new functions in \"Celex-2021\". The developers made a new function GAZ-GIZ, which infinitely fills an infinite table to the right and down from the upper ... | [{"type": "stdin_stdout", "input": "1\n118730819 699217111 1229905591 978426672\n", "output": "310250620284395093\n"}, {"type": "stdin_stdout", "input": "1\n118730819 699217111 995255402 1762535216\n", "output": "932024458581475216\n"}, {"type": "stdin_stdout", "input": "1\n118730819 699217111 1571293294 978426672\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGildong is experimenting with an interesting machine Graph Traveler. In Graph Traveler, there is a directed graph consisting of n vertices numbered from 1 to n. The i-th vertex has m_i outgoing edges that are labeled as e... | [{"type": "stdin_stdout", "input": "4\n4 -9 -1 -1\n2\n2 3\n1\n2\n3\n2 4 1\n4\n3 1 2 1\n6\n1 -1\n3 -1\n3 -1\n4 -4\n2 1\n1 5\n", "output": "1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "4\n4 -9 -1 -1\n2\n2 3\n1\n2\n3\n2 4 1\n4\n3 1 2 1\n6\n1 -1\n3 0\n3 -1\n4 -4\n2 1\n1 5\n", "output": "1\n1\n1\n1\n1\n1\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImagine there's a big cube consisting of n^3 small cubes. Calculate, how many small cubes are not visible from outside.\n\nFor example, if we have a cube which has 4 cubes in a row, then the function should return 8, beca... | [{"input": "10002", "output": "[1000000000000]", "fn_name": "not_visible_cubes"}, {"input": "12", "output": "[1000]", "fn_name": "not_visible_cubes"}, {"input": "18", "output": "[4096]", "fn_name": "not_visible_cubes"}, {"input": "7", "output": "[125]", "fn_name": "not_visible_cubes"}, {"input": "5", "output": "[27]", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's been almost a week since Polycarp couldn't get rid of insomnia. And as you may already know, one week in Berland lasts k days!\n\nWhen Polycarp went to a doctor with his problem, the doctor asked him about his sleepi... | [{"type": "stdin_stdout", "input": "10 5\n1384 1129 1780 1960 1567 1928 12 1523 1165 344\n", "output": "6931.333333333333030"}, {"type": "stdin_stdout", "input": "10 4\n127 1459 718 1183 880 1044 1857 1340 725 1496\n", "output": "4574.428571428571558"}, {"type": "stdin_stdout", "input": "10 5\n1384 1129 1780 1960 1567 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter all the events in Orlando we all know, Sasha and Roma decided to find out who is still the team's biggest loser. Thankfully, Masha found somewhere a revolver with a rotating cylinder of n bullet slots able to contai... | [{"type": "stdin_stdout", "input": "15 10 15\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n", "output": ".X.X.X.X.XXXXXX\n"}, {"type": "stdin_stdout", "input": "15 10 15\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n1\n14\n15\n", "output": ".X.X.X.X.XXX.XX"}, {"type": "stdin_stdout", "input": "15 10 15\n1\n2\n3\n3\n5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTom gives a number N to Roy and ask him to tell the total number of even divisors of the number N. Help Roy to answer the question of Tom.\n\nINPUT:\n\nFirst line contains the number of testcases T, followed by T lines ea... | [{"type": "stdin_stdout", "input": "100\n221614680\n613118744\n825161854\n393619966\n433416647\n918290125\n875590062\n364287285\n540653024\n282896407\n834916465\n819950927\n260491958\n606161260\n616177142\n575204996\n709562762\n710833433\n425478909\n578641871\n461777994\n818969932\n542538037\n994852175\n474901231\n3567... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFolding a Ribbon\n\nThink of repetitively folding a very long and thin ribbon. First, the ribbon is spread out from left to right, then it is creased at its center, and one half of the ribbon is laid over the other. You c... | [{"type": "stdin_stdout", "input": "4 3 2\n30 578 1954\n59 471605241352156968 431565444592236940\n0 0 0", "output": "LRRR\nLLLLLRLLRLLLLLLLLLLRRRRLRLLLLL\nLRRRLRRLLRRRRLLLLRLLRRRLRRLLRLLLLLLRLRLLRLRLLLRLRLLRLLRRRLL\n"}, {"type": "stdin_stdout", "input": "4 3 2\n20 578 1954\n59 471605241352156968 431565444592236940\n0 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEhab has an array $a$ of length $n$. He has just enough free time to make a new array consisting of $n$ copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subseque... | [{"type": "stdin_stdout", "input": "4\n7\n6 6 12 8 6 6 6\n1\n2\n5\n4 5 9 2 7\n7\n1 2 7 1 6 20 2\n", "output": "3\n1\n5\n5\n"}, {"type": "stdin_stdout", "input": "4\n7\n6 6 12 8 6 5 6\n1\n2\n5\n4 5 9 2 7\n7\n1 2 7 1 6 20 2\n", "output": "4\n1\n5\n5\n"}, {"type": "stdin_stdout", "input": "4\n7\n6 6 8 8 6 6 6\n1\n2\n5\n4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNot so long ago company R2 bought company R1 and consequently, all its developments in the field of multicore processors. Now the R2 laboratory is testing one of the R1 processors.\n\nThe testing goes in n steps, at each ... | [{"type": "stdin_stdout", "input": "100 99 1 2\n2 1 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 2 1 1 0 1 1 2 2 2 1 1 1 1 2 2 2 2 1 1 2 2 2\n", "output": "Incorrect\n"}, {"type": "stdin_stdout", "input": "100 99 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us.\n\n [Image] \n\nThe girl lives in house m of a village. There are n houses in that village, lining in a s... | [{"type": "stdin_stdout", "input": "100 1 100\n0 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 110 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\nIn BerSoft $n$ programmers work, the programmer $i$ is characterized by a skill $r_i$.\n\nA programmer $a$ can be a mentor of a programmer $b$ if and only if the skill of the programmer $a$ is strictly greater than the sk... | [{"type": "stdin_stdout", "input": "10 35\n322022227 751269818 629795150 369443545 344607287 250044294 476897672 184054549 986884572 917181121\n6 3\n7 3\n1 9\n7 9\n10 7\n3 4\n8 6\n7 4\n6 10\n7 2\n3 5\n6 9\n3 10\n8 7\n6 5\n8 1\n8 5\n1 7\n8 10\n8 2\n1 5\n10 4\n6 7\n4 6\n2 6\n5 4\n9 10\n9 2\n4 8\n5 9\n4 1\n3 2\n2 1\n4 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n cities in Bearland, numbered 1 through n. Cities are arranged in one long row. The distance between cities i and j is equal to |i - j|.\n\nLimak is a police officer. He lives in a city a. His job is to catch c... | [{"type": "stdin_stdout", "input": "100 100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100\n1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYurii is sure he can do everything. Can he solve this task, though?\n\nHe has an array $a$ consisting of $n$ positive integers. Let's call a subarray $a[l...r]$ good if the following conditions are simultaneously satisfie... | [{"type": "stdin_stdout", "input": "10\n997230370 58052053 240970544 715275815 250707702 156801523 44100666 64791577 43523002 480196854\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n997230370 58052053 240970544 715275815 250707702 156801523 44100666 64791577 43523002 480196854\n", "output": "2"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou just got done with your set at the gym, and you are wondering how much weight you could lift if you did a single repetition. Thankfully, a few scholars have devised formulas for this purpose (from [Wikipedia](https://... | [{"input": "135\n20", "output": "[282]", "fn_name": "calculate_1RM"}, {"input": "200\n8", "output": "[253]", "fn_name": "calculate_1RM"}, {"input": "270\n2", "output": "[289]", "fn_name": "calculate_1RM"}, {"input": "360\n1", "output": "[360]", "fn_name": "calculate_1RM"}, {"input": "400\n0", "output": "[0]", "fn_name"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t_1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, ins... | [{"type": "stdin_stdout", "input": "1000 812 976\n230 1000\n1006 -1\n", "output": "164000\n"}, {"type": "stdin_stdout", "input": "1000 394 798\n155 1242\n954 -1\n", "output": "271560\n"}, {"type": "stdin_stdout", "input": "1000 812 976\n230 1000\n696 -1\n", "output": "164000\n"}, {"type": "stdin_stdout", "input": "1000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white i... | [{"type": "stdin_stdout", "input": "01010000100110111100010011111100001010101111001100001010101000100101100011110011111110100011000001111011010011100010010111011001011000010110011100111010111111010100010111100100110000100010010011101001001110000100110101011001100000010111101101100100010011110010110010101100100011001010... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N, and a positive integer K.\nFind the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K i... | [{"type": "stdin_stdout", "input": "10 3\n14 26 111 65 35 89 184 32 38 46", "output": "4\n"}, {"type": "stdin_stdout", "input": "10 11\n14 26 111 0 35 27 95 13 38 63", "output": "12\n"}, {"type": "stdin_stdout", "input": "10 13\n14 15 101 65 35 89 95 32 38 46", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 7\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ slimes in a row. Each slime has an integer value (possibly negative or zero) associated with it.\n\nAny slime can eat its adjacent slime (the closest slime to its left or to its right, assuming that this sli... | [{"type": "stdin_stdout", "input": "10\n-20 1 3 -5 -27 18 -3 -9 -7 9\n", "output": "102\n"}, {"type": "stdin_stdout", "input": "10\n-20 0 3 -5 -18 15 -3 -9 -7 9\n", "output": "89\n"}, {"type": "stdin_stdout", "input": "10\n-20 0 3 -5 -27 15 -3 -9 -7 9\n", "output": "98\n"}, {"type": "stdin_stdout", "input": "10\n-20 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe sequence of $m$ integers is called the permutation if it contains all integers from $1$ to $m$ exactly once. The number $m$ is called the length of the permutation.\n\nDreamoon has two permutations $p_1$ and $p_2$ of ... | [{"type": "stdin_stdout", "input": "6\n5\n1 4 3 2 1\n6\n2 4 1 3 3 1\n4\n2 1 1 2\n4\n1 3 3 1\n12\n2 1 3 5 5 6 7 8 9 1 10 2\n3\n1 2 1\n", "output": "2\n1 4\n4 1\n0\n1\n2 2\n0\n0\n2\n1 2\n2 1\n"}, {"type": "stdin_stdout", "input": "6\n5\n1 4 3 2 1\n6\n2 4 1 3 2 1\n4\n2 1 1 3\n4\n1 3 3 1\n12\n2 1 3 4 5 6 7 8 9 1 10 2\n3\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are going to be given a word. Your job is to return the middle character of the word. If the word's length is odd, return the middle character. If the word's length is even, return the middle 2 characters.\n\n#Example... | [{"input": "\"testing\"", "output": "[\"t\"]", "fn_name": "get_middle"}, {"input": "\"middle\"", "output": "[\"dd\"]", "fn_name": "get_middle"}, {"input": "\"test\"", "output": "[\"es\"]", "fn_name": "get_middle"}, {"input": "\"of\"", "output": "[\"of\"]", "fn_name": "get_middle"}, {"input": "\"A\"", "output": "[\"A\"]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence.\n\nConstraints\n\n* $0 < n \\leq 10000$\n* $-1000000 \\leq a_i \\leq 100... | [{"type": "stdin_stdout", "input": "5\n114 0 -15 -1 2", "output": "-15 114 100\n"}, {"type": "stdin_stdout", "input": "5\n114 -1 -15 -1 2", "output": "-15 114 99\n"}, {"type": "stdin_stdout", "input": "5\n112 -1 -15 -1 2", "output": "-15 112 97\n"}, {"type": "stdin_stdout", "input": "5\n112 1 -14 -1 2", "output": "-14 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMadoka wants to enter to \"Novosibirsk State University\", but in the entrance exam she came across a very difficult task:\n\nGiven an integer $n$, it is required to calculate $\\sum{\\operatorname{lcm}(c, \\gcd(a, b))}$,... | [{"type": "stdin_stdout", "input": "100000\n", "output": "454535891\n"}, {"type": "stdin_stdout", "input": "69228\n", "output": "778304278\n"}, {"type": "stdin_stdout", "input": "94874\n", "output": "584783437\n"}, {"type": "stdin_stdout", "input": "99413\n", "output": "461761995\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Quarkgo Empire Expeditionary Force is an evil organization that plans to invade the Earth. In keeping with the tradition of the invaders, they continued to send monsters at a pace of one every week, targeting the area... | [{"type": "stdin_stdout", "input": "1204648530", "output": "20\n"}, {"type": "stdin_stdout", "input": "3727082973", "output": "21\n"}, {"type": "stdin_stdout", "input": "1369610954", "output": "20\n"}, {"type": "stdin_stdout", "input": "2281056559", "output": "20\n"}, {"type": "stdin_stdout", "input": "104442668", "out... | 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"}, {"type": "stdin_stdout", "input": "498454011879264 806515... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYes, that's another problem with definition of \"beautiful\" numbers.\n\nLet's call a positive integer x beautiful if its decimal representation without leading zeroes contains even number of digits, and there exists a pe... | [{"type": "stdin_stdout", "input": "60\n799032\n1880\n489633\n167604\n641858\n521214\n951107\n121088\n952294\n514428\n890184\n883033\n317778\n456130\n373364\n404297\n757369\n815335\n317046\n148887\n834163\n990592\n721319\n402371\n458279\n570263\n887791\n365893\n433095\n463049\n457336\n669570\n803506\n178817\n214599\n21... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.\n\nThere are n solutions, the i-th of them should be tested on a_i tests, testing one solution... | [{"type": "stdin_stdout", "input": "100 10\n3 114 77 78 105 87 6 122 141 100 75 118 64 18 88 37 109 72 31 101 36 10 62 18 52 17 149 115 22 150 138 48 46 42 104 8 63 21 117 58 87 80 7 131 125 118 67 13 144 43 59 67 74 13 124 77 86 148 107 11 51 9 87 52 147 22 7 22 143 12 121 123 17 35 33 87 91 140 92 38 106 10 66 26 40 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKontti language is a finnish word play game.\n\nYou add `-kontti` to the end of each word and then swap their characters until and including the first vowel (\"aeiouy\"); \n\nFor example the word `tame` becomes `kome-tant... | [{"input": "\"lamppu sofia\"", "output": "[\"komppu-lantti kofia-sontti\"]", "fn_name": "kontti"}, {"input": "\"silly game\"", "output": "[\"kolly-sintti kome-gantti\"]", "fn_name": "kontti"}, {"input": "\"xyz lamppu\"", "output": "[\"koz-xyntti komppu-lantti\"]", "fn_name": "kontti"}, {"input": "\"silly grrr\"", "outp... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe year 2015 is almost over.\n\nLimak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary system — 2015_10 = 1... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "500000000000000000 1000000000000000000\n", "output": "58\n"}, {"type": "stdin_stdout", "input": "500000000000000000 1000000000000000000\n", "output": "58\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this Kata we focus on finding a sum S(n) which is the total number of divisors taken for all natural numbers less or equal to n. More formally, we investigate the sum of n components denoted by d(1) + d(2) + ... + d(n)... | [{"input": "9999999999999", "output": "[300880375389561]", "fn_name": "count_divisors"}, {"input": "9999999999998", "output": "[300880375389537]", "fn_name": "count_divisors"}, {"input": "9999999999995", "output": "[300880375389493]", "fn_name": "count_divisors"}, {"input": "9999999949950", "output": "[300880373832097]... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.