messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 1
value |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n computers in the company network. They are numbered from 1 to n.\n\nFor each pair of two computers 1 β€ i < j β€ n you know the value a_{i,j}: the difficulty of sending data between computers i and j. All values... | [{"type": "stdin_stdout", "input": "10\n0 44 13 6 27 43 3 12 14 40\n44 0 28 20 17 16 5 33 45 15\n13 28 0 25 41 23 34 29 26 24\n6 20 25 0 18 32 11 37 2 38\n27 17 41 18 0 1 7 10 35 8\n43 16 23 32 1 0 19 21 42 22\n3 5 34 11 7 19 0 9 4 36\n12 33 29 37 10 21 9 0 31 39\n14 45 26 2 35 42 4 31 0 30\n40 15 24 38 8 22 36 39 30 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce upon a time in the Kingdom of Far Far Away lived Sam the Farmer. Sam had a cow named Dawn and he was deeply attached to her. Sam would spend the whole summer stocking hay to feed Dawn in winter. Sam scythed hay and p... | [{"type": "stdin_stdout", "input": "1256336691\n", "output": "2931452299 10050693537\n"}, {"type": "stdin_stdout", "input": "1359531323\n", "output": "6797656627 10876250593\n"}, {"type": "stdin_stdout", "input": "1544906479\n", "output": "1581910903 12359251841\n"}, {"type": "stdin_stdout", "input": "1278463385\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have n chains, the i-th chain consists of c_i vertices. Vertices in each chain are numbered independently from 1 to c_i along the chain. In other words, the i-th chain is the undirected graph with c_i vertices and (c_... | [{"type": "stdin_stdout", "input": "3\n4\n3 4 3 6\n-1 1 2 2\n-2 2 2 3\n2\n5 10\n-2 5\n-1 1\n3\n10 5 2\n-1 1 2\n-1 10 5\n", "output": "10\n15\n15\n"}, {"type": "stdin_stdout", "input": "3\n4\n3 4 3 6\n-1 1 2 2\n-1 2 2 3\n2\n5 10\n-1 5\n-1 1\n3\n6 5 2\n-1 1 2\n-1 5 5\n", "output": "10\n15\n10\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT com... | [{"type": "stdin_stdout", "input": "3\n6\n0 3 0 0 1 3\n10\n0 0 0 1 0 5 0 0 0 2\n3\n0 0 0\n", "output": "\n1 1 0 1 1 1 \n0 1 1 1 1 1 0 0 1 1 \n0 0 0 \n"}, {"type": "stdin_stdout", "input": "3\n6\n0 3 0 0 1 3\n10\n0 0 0 0 0 10 0 0 0 2\n3\n0 0 0\n", "output": "1 1 0 1 1 1\n1 1 1 1 1 1 0 0 1 1\n0 0 0\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter rejecting 10^{100} data structure problems, Errorgorn is very angry at Anton and decided to kill him.\n\nAnton's DNA can be represented as a string a which only contains the characters \"ANTON\" (there are only 4 di... | [{"type": "stdin_stdout", "input": "1\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"}, {"type": "stdin_stdout", "input": "4\nANTON\nNAAN\nAAAAAA\nOAANTTON\n", "output": "\nNNOTA\nAANN\nAAAAAA\nTNNTAOOA\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.\n\nIn Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the size and the... | [{"type": "stdin_stdout", "input": "129.400249 -44.695226\n122.278798 -53.696996\n44.828427 -83.507917\n", "output": "26227.478504758346\n"}, {"type": "stdin_stdout", "input": "115.715093 141.583620\n136.158119 -23.780834\n173.673212 64.802787\n", "output": "24043.740341410277\n"}, {"type": "stdin_stdout", "input": "-4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA subsequence of length |x| of string s = s1s2... s|s| (where |s| is the length of string s) is a string x = sk1sk2... sk|x| (1 β€ k1 < k2 < ... < k|x| β€ |s|).\n\nYou've got two strings β s and t. Let's consider all subseq... | [{"type": "stdin_stdout", "input": "ctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqegvwtbxlvvjhebshqaicsovtkcdovytimjggglyxlvglgunbohnkxargymbqvzgsnvjzgxivdgnaesgxqcruaopjuqsyyorrobnelehjnxcetveehlbmeskptivsuhuqupbieumycwczxyqjtwfofehfkpqmjngygwxkaviuyouiippgvlxjgtkxmhcwtzacbllsybgiujyryngapfwjkkyapfgxtcdpc\nctkhagrifaztmnxhm... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor he knew every Who down in Whoville beneath, Was busy now, hanging a mistletoe wreath. \"And they're hanging their stockings!\" he snarled with a sneer, \"Tomorrow is Christmas! It's practically here!\"\n\nDr. Suess, H... | [{"type": "stdin_stdout", "input": "336 336\nHHHHHHHHHS..S..HH..H.S.H..HHH.H.H.H.S.H.S.S.H.S..SS..H.SS.H.HH.HH..HH.H...H.H.H.HSS..H...HH..HH.H..H.S.S....S.H.HH..HS..S.S.S.H.H.S..S.H.HH.HH..HH.HH.HS.HH.HSSHHHHHHHHH.H.HH..HHH.H.H.S..H.HH.S.H..HH.HS.HH.S.H.H.H..H.HH.HS.HHHHH.HH.S.SSS.S.S.HH.HS.H.S.HH.H.HH.H.S.HH.HS.HH..HH... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Greg and his friends were walking in the forest. Overall there were n people walking, including Greg. Soon he found himself in front of a river. The guys immediately decided to get across the river. Luckily, there... | [{"type": "stdin_stdout", "input": "50 207\n50 100 100 100 100 50 100 100 100 50 100 100 100 50 100 100 50 100 50 100 50 100 100 100 50 100 50 50 100 50 100 100 50 100 100 100 100 50 100 100 100 100 50 50 50 100 100 50 100 100\n", "output": "55\n833060250"}, {"type": "stdin_stdout", "input": "50 125\n50 50 50 100 100 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt the beginning of the new semester there is new schedule in the Berland State University. According to this schedule, n groups have lessons at the room 31. For each group the starting time of the lesson and the finishin... | [{"type": "stdin_stdout", "input": "16\n203671 381501\n58867 59732\n817520 962123\n125391 163027\n601766 617692\n381501 444610\n761937 817520\n16 10551\n21096 38291\n718073 761937\n583868 601766\n554859 731755\n678098 718073\n962123 992003\n163027 203671\n87917 96397\n", "output": "1\n12 "}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInna loves sleeping very much, so she needs n alarm clocks in total to wake up. Let's suppose that Inna's room is a 100 Γ 100 square with the lower left corner at point (0, 0) and with the upper right corner at point (100... | [{"type": "stdin_stdout", "input": "42\n28 87\n26 16\n59 90\n47 61\n28 83\n36 30\n67 10\n6 95\n9 49\n86 94\n52 24\n97 9\n86 24\n28 51\n25 99\n40 98\n57 33\n18 96\n43 36\n3 79\n4 86\n38 61\n25 61\n6 100\n58 81\n28 19\n64 4\n3 40\n2 56\n41 49\n97 100\n86 34\n42 36\n44 40\n14 85\n21 60\n76 99\n64 47\n69 13\n49 37\n97 37\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKicker (table football) is a board game based on football, in which players control the footballers' figures mounted on rods by using bars to get the ball into the opponent's goal. When playing two on two, one player of e... | [{"type": "stdin_stdout", "input": "1 100\n100 1\n99 99\n99 99\n", "output": "Team 1\n"}, {"type": "stdin_stdout", "input": "21 22\n21 16\n32 14\n39 35\n", "output": "Team 2\n"}, {"type": "stdin_stdout", "input": "80 79\n79 30\n80 81\n40 80\n", "output": "Team 2\n"}, {"type": "stdin_stdout", "input": "86 95\n86 38\n59 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDevu is a dumb guy, his learning curve is very slow. You are supposed to teach him n subjects, the ith subject has ci chapters. When you teach him, you are supposed to teach all the chapters of a subject continuously.\n\n... | [{"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 10 1 4 1 5 3 5 9 2 2 8 0 2 3 3\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 13 1 4 6 5 3 5 9 2 2 8 0 2 3 3\n", "output": "121\n"}, {"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 10 1 4 6 5 3 5 9 2 2 8 0 2 3 3\n", "output": "118\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Victor adores the sets theory. Let us remind you that a set is a group of numbers where all numbers are pairwise distinct. Today Victor wants to find a set of integers S that has the following properties:\n\n * fo... | [{"type": "stdin_stdout", "input": "164985732640 164986732640 1000000\n", "output": "0\n4\n164985732640 164985732641 164985732642 164985732643\n"}, {"type": "stdin_stdout", "input": "164985732640 164986732640 1000001\n", "output": "0\n4\n164985732640 164985732641 164985732642 164985732643\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnya loves to watch horror movies. In the best traditions of horror, she will be visited by m ghosts tonight. Anya has lots of candles prepared for the visits, each candle can produce light for exactly t seconds. It takes... | [{"type": "stdin_stdout", "input": "138 245 30\n3 5 6 8 9 13 15 16 19 20 24 25 27 29 30 32 33 34 35 36 37 38 40 42 47 51 52 53 55 56 58 59 63 66 67 68 69 72 73 74 75 77 78 80 81 82 85 86 87 89 91 93 95 96 99 100 102 104 105 108 110 111 112 117 122 124 125 128 129 131 133 136 139 144 145 146 147 148 149 151 153 155 156 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter Vitaly was expelled from the university, he became interested in the graph theory.\n\nVitaly especially liked the cycles of an odd length in which each vertex occurs at most once.\n\nVitaly was wondering how to solv... | [{"type": "stdin_stdout", "input": "6 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "9 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1"}, {"type": "stdin_stdout", "input": "59139 1\n10301 2064\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRobot Doc is located in the hall, with n computers stand in a line, numbered from left to right from 1 to n. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computer... | [{"type": "stdin_stdout", "input": "100\n35 53 87 49 13 24 93 20 5 11 31 32 40 52 96 46 1 25 17 69 28 88 84 82 70 9 75 39 26 21 18 29 23 57 90 16 48 22 95 0 58 43 7 73 8 62 63 30 64 92 79 3 6 94 34 12 76 99 67 55 56 97 14 91 68 36 44 78 41 71 86 89 47 74 4 45 98 37 80 33 83 27 42 59 72 54 17 60 51 81 15 77 65 50 10 85 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitti... | [{"type": "stdin_stdout", "input": "10 15\n900000001 1\n900000001 1\n900000002 1\n1737646700 1\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000004 1\n900000000 1\n900000001 1\n", "output": "1 3\n1 4\n1 8\n1 10\n2 3\n1 5\n2 4\n3 4\n2 5\n1 6\n3 5\n4 5\n1 9\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohnny drives a truck and must deliver a package from his hometown to the district center. His hometown is located at point 0 on a number line, and the district center is located at the point d.\n\nJohnny's truck has a ga... | [{"type": "stdin_stdout", "input": "281 12 23\n178 650197\n129 251606\n34 924882\n43 472160\n207 957083\n103 724815\n167 308008\n135 906958\n74 242828\n229 146026\n85 241042\n22 39127\n62 47524\n113 760274\n156 562141\n10 209057\n50 714473\n201 164128\n97 624021\n120 102709\n147 388268\n219 933977\n190 950684\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the friends should not exceed h. If the height of some person is ... | [{"type": "stdin_stdout", "input": "100 342\n478 143 359 336 162 333 385 515 117 496 310 538 469 539 258 676 466 677 1 296 150 560 26 213 627 221 255 126 617 174 279 178 24 435 70 145 619 46 669 566 300 67 576 251 58 176 441 564 569 194 24 669 73 262 457 259 619 78 400 579 222 626 269 47 80 315 160 194 455 186 315 424 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was just to construct a tria... | [{"type": "stdin_stdout", "input": "100 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "52 10 19 139\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "110 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "11 30 79 43\n", "output": "IMPOSSIBLE\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Irina arrived to one of the most famous cities of Berland β the Berlatov city. There are n showplaces in the city, numbered from 1 to n, and some of them are connected by one-directional roads. The roads in Berla... | [{"type": "stdin_stdout", "input": "10 45 8\n1 2 1\n1 3 1\n1 4 1\n1 5 1\n1 6 1\n1 7 1\n1 8 1\n1 9 1\n1 10 1\n2 3 1\n2 4 1\n2 5 1\n2 6 1\n2 7 1\n2 8 1\n2 9 1\n2 10 1\n3 4 1\n3 5 1\n3 6 1\n3 7 1\n3 8 1\n3 9 1\n3 10 1\n4 5 1\n4 6 1\n4 7 1\n4 8 1\n4 9 1\n4 10 1\n5 6 1\n5 7 1\n5 8 1\n5 9 1\n5 10 1\n6 7 1\n6 8 1\n6 9 1\n6 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because some characters disappeared while writing ... | [{"type": "stdin_stdout", "input": "55\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\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\n", "output": "383381198\n55\n1\n"}, {"type": "stdin_stdout", "input": "55\naaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Easter Rabbit laid n eggs in a circle and is about to paint them. \n\nEach egg should be painted one color out of 7: red, orange, yellow, green, blue, indigo or violet. Also, the following conditions should be satisfi... | [{"type": "stdin_stdout", "input": "100\n", "output": "ROYGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVG"}, {"type": "stdin_stdout", "input": "99\n", "output": "ROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVG\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a text of single-space separated words, consisting of small and capital Latin letters.\n\nVolume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the... | [{"type": "stdin_stdout", "input": "200\nLBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "200\nAAAAAAAAAAAAAA... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of positive integers a1, a2, ..., an. \n\nWhile possible, you perform the following operation: find a pair of equal consecutive elements. If there are more than one such pair, find the leftmost (w... | [{"type": "stdin_stdout", "input": "4\n1101111010 1000000000 1000010000 1001001010\n", "output": "4\n1101111010 1000000000 1000010000 1001001010\n"}, {"type": "stdin_stdout", "input": "4\n1101111010 1000000000 1100010000 1001001010\n", "output": "4\n1101111010 1000000000 1100010000 1001001010\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given Q queries of the form (L, R). \n\nFor each query you have to find the number of such x that L β€ x β€ R and there exist integer numbers a > 0, p > 1 such that x = ap.\n\nInput\n\nThe first line contains the num... | [{"type": "stdin_stdout", "input": "20\n862 928\n758 964\n541 789\n622 943\n328 900\n14 764\n217 1554\n461 847\n442 468\n544 1157\n518 529\n938 993\n620 851\n690 944\n484 601\n320 910\n98 1355\n816 794\n765 880\n551 1280\n", "output": "1\n4\n5\n6\n14\n32\n30\n9\n0\n12\n1\n1\n5\n4\n4\n15\n35\n0\n2\n13\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRussian translation\n\nLet's consider some weird country with N cities and M bidirectional roads of 3 types. It's weird because of some unusual rules about using these roads: men can use roads of types 1 and 3 only and wo... | [{"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 3\n3 4 1\n5 3 2\n5 4 1\n5 2 6\n1 5 2\n\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 5\n3 4 1\n5 3 2\n5 4 1\n5 2 6\n1 5 2\n\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 5\n3 4 1\n5 3 2\n5 2 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBig P has recently become very famous among girls .\n\nBig P goes to a party and every girl present there wants to dance with him. However, Big P cannot dance with all of them, because there are many of them.\n\nNow if a ... | [{"type": "stdin_stdout", "input": "1000 1962\n3 391\n4 276\n5 309\n6 279\n7 675\n8 387\n9 241\n10 629\n11 500\n12 612\n13 35\n14 472\n15 85\n16 865\n17 547\n18 101\n19 919\n20 830\n21 463\n22 445\n23 423\n24 721\n25 36\n26 523\n27 463\n28 528\n29 934\n30 880\n31 349\n32 942\n33 560\n34 375\n35 133\n36 630\n37 387\n38 ... | 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\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.\n\n\... | [{"type": "stdin_stdout", "input": "226564", "output": "498733826\n"}, {"type": "stdin_stdout", "input": "241465", "output": "202510248\n"}, {"type": "stdin_stdout", "input": "127499", "output": "463923590\n"}, {"type": "stdin_stdout", "input": "112403", "output": "286663221\n"}, {"type": "stdin_stdout", "input": "7086... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N blocks arranged in a row. Let us paint these blocks.\n\nWe will consider two ways to paint the blocks different if and only if there is a block painted in different colors in those two ways.\n\nFind the number... | [{"type": "stdin_stdout", "input": "119754 114575 7559", "output": "612524154\n"}, {"type": "stdin_stdout", "input": "119754 114575 8988", "output": "536128558\n"}, {"type": "stdin_stdout", "input": "145188 114575 8988", "output": "964030371\n"}, {"type": "stdin_stdout", "input": "145188 114575 3371", "output": "263223... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\... | [{"type": "stdin_stdout", "input": "5 1000000000\n6 6 2 6 2", "output": "166666667"}, {"type": "stdin_stdout", "input": "3 000\n14 22 40", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 000\n14 16 40", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 010\n14 16 40", "output": "0\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are a prime number p and a sequence of p integers a_0, \\ldots, a_{p-1} consisting of zeros and ones.\n\nFind a polynomial of degree at most p-1, f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \\ldots + b_0, satisfying ... | [{"type": "stdin_stdout", "input": "5\n0 1 0 1 1", "output": "0 3 4 2 2\n"}, {"type": "stdin_stdout", "input": "5\n0 0 0 1 1", "output": "0 4 0 3 3\n"}, {"type": "stdin_stdout", "input": "5\n0 0 1 1 1", "output": "0 1 1 1 2\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 1 1", "output": "1 3 4 2 1\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than ... | [{"type": "stdin_stdout", "input": "SHINJUKV", "output": "0\n"}, {"type": "stdin_stdout", "input": "HATAGBYA", "output": "4\n"}, {"type": "stdin_stdout", "input": "HASAGBYA", "output": "2\n"}, {"type": "stdin_stdout", "input": "VKUJNIHT", "output": "1\n"}, {"type": "stdin_stdout", "input": "HATAGCYA", "output": "5\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length N and another string T of length M. These strings consist of lowercase English letters.\n\nA string X is called a good string when the following conditions are all met:\n\n* Let L be the... | [{"type": "stdin_stdout", "input": "15 16\ndnausrayukusiia\ndujrunuma", "output": "240\n"}, {"type": "stdin_stdout", "input": "16 9\ndnsusrayukuaiia\ndujrunuma", "output": "144\n"}, {"type": "stdin_stdout", "input": "15 8\ndnausrayukusii`\ndujrunuma", "output": "120\n"}, {"type": "stdin_stdout", "input": "12 10\ndnsusr... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.\n\nYou are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i =... | [{"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 -1", "output": "-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 0", "output": "-1\n0\n0\n0\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -2 -1 0 15 -2", "output": "-1\n0\n0\n-1\n-1\n0\n"}, {"type": "stdin_stdout", "input": "6\n5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately whe... | [{"type": "stdin_stdout", "input": "5 2 1\n105611412\n1737860309\n1010000000\n1000000101\n1100000000", "output": "969572082\n"}, {"type": "stdin_stdout", "input": "5 3 1\n105611412\n1151487296\n1010000000\n1000000101\n1100000000", "output": "710247900\n"}, {"type": "stdin_stdout", "input": "5 2 1\n105611412\n1737860309... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_... | [{"type": "stdin_stdout", "input": "25 4 4\n1 2\n3 3\n2 5\n6 7\n3 5\n4 3\n3 4\n6 7", "output": "1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "27 0 1\n0 0\n2 10\n3 -1\n1 0", "output": "1 1 1 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"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.\n\nOne day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its un... | [{"type": "stdin_stdout", "input": "500\n1000\n0", "output": "850\n1520\n"}, {"type": "stdin_stdout", "input": "500\n1100\n0", "output": "850\n1950\n"}, {"type": "stdin_stdout", "input": "500\n2200\n0", "output": "850\n3390"}, {"type": "stdin_stdout", "input": "500\n0000\n-12", "output": "850\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInterest rates are attached to the money deposited in banks, and the calculation method and interest rates vary from bank to bank. The combination of interest and principal is called principal and interest, but as a metho... | [{"type": "stdin_stdout", "input": "2\n7\n1 5 2\n-1 9 2\n2\n14\n1 5 2\n-1 13 1\n0", "output": "-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\n7\n1 5 2\n-1 12 2\n2\n14\n0 5 2\n0 10 1\n0", "output": "-1\n0\n"}, {"type": "stdin_stdout", "input": "2\n14\n1 3 0\n17 6 2\n2\n12\n1 5 2\n1 12 1\n0", "output": "17\n1\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGas stations in the White Tiger service area have $ N $ lanes assigned numbers from $ 1 $ to $ N $. The first car in each lane can refuel.\n\nCars entering the gas station will choose the lane with the fewest cars in line... | [{"type": "stdin_stdout", "input": "2 7\n1 1180\n1 1000\n0 2\n1 1001\n1 1002\n0 2\n0 1", "output": "1000\n1001\n1180\n"}, {"type": "stdin_stdout", "input": "2 7\n1 1353\n1 1000\n0 1\n1 1000\n1 1002\n0 1\n0 2", "output": "1353\n1000\n1000\n"}, {"type": "stdin_stdout", "input": "2 7\n1 1383\n1 1001\n0 1\n1 1001\n1 1002\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a cube which consists of n Γ n Γ n small cubes. Small cubes have marks on their surfaces. An example where n = 4 is shown in the following figure.\n\n\n<image>\n\n\nThen, as shown in the figure above (right), mak... | [{"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nxy 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n310\n"}, {"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nyx 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n315\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA wise king declared a new calendar. \"Tomorrow shall be the first day of the calendar, that is, the day 1 of the month 1 of the year 1. Each year consists of 10 months, from month 1 through month 10, and starts from a bi... | [{"type": "stdin_stdout", "input": "8\n-1 1 1\n344 4 0\n738 4 2\n182 9 5\n992 5 6\n344 5 26\n696 6 19\n231 8 25", "output": "196865\n128957\n51469\n160715\n1492\n128912\n59672\n151076\n"}, {"type": "stdin_stdout", "input": "8\n-1 1 1\n344 3 0\n738 4 2\n182 9 5\n998 5 7\n344 5 26\n696 6 19\n231 10 25", "output": "196865... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSuppose that P1 is an infinite-height prism whose axis is parallel to the z-axis, and P2 is also an infinite-height prism whose axis is parallel to the y-axis. P1 is defined by the polygon C1 which is the cross section of... | [{"type": "stdin_stdout", "input": "4 3\n7 4\n3 3\n0 0\n3 1\n4 4\n0 0\n8 1\n4 4\n0 2\n30 12\n2 12\n4 2\n15 2\n30 15\n13 25\n1 0\n8 5\n14 5\n21 3\n21 13\n18 15\n11 15\n6 5\n6 8\n11 4\n17 12\n9 9\n15 6\n20 10\n18 12\n3 3\n5 5\n10 2\n10 10\n20 2\n10 15\n10 8\n4 4\n-133 137\n-99 -104\n55 -98\n36 97\n-99 16\n-98 -98\n113 -9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChampernown constant is an irrational number represented in decimal by \"0.\" followed by concatenation of all positive integers in the increasing order. The first few digits of this constant are: 0.123456789101112...\n\n... | [{"type": "stdin_stdout", "input": "11 17\n11 14\n0 0", "output": "01112131415161718\n01112131415161\n"}, {"type": "stdin_stdout", "input": "4 7\n2 26\n0 0", "output": "4567891\n23456789101112131415161718\n"}, {"type": "stdin_stdout", "input": "2 5\n1 26\n0 0", "output": "23456\n12345678910111213141516171\n"}, {"type":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Akita, who lives in the neighborhood, is a historical researcher in the field and recently discovered a new ancient document about Ono no Komachi.\n\nIt is widely known that Ono no Komachi has given General Fukakusa, ... | [{"type": "stdin_stdout", "input": "1 1\n3 2\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n92\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n94\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\n3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which manipulates a sequence A = {a0, a1, . . . , an-1} with the following operations:\n\n* find(s, t): report the minimum element in as, as+1, . . . ,at.\n* update(i, x): change ai to x.\n\n\n\nNote that ... | [{"type": "stdin_stdout", "input": "5 5\n0 0 0\n1 2 4\n1 0 0\n1 1 9\n1 1 2", "output": "2147483647\n0\n2147483647\n2147483647\n"}, {"type": "stdin_stdout", "input": "6 5\n1 0 0\n0 1 2\n1 2 3\n1 0 2\n1 2 2", "output": "2147483647\n2147483647\n2\n2147483647\n"}, {"type": "stdin_stdout", "input": "3 5\n0 0 1\n1 1 2\n1 2 2... | 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 slime... | [{"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\nYou are given an integer sequence 1, 2, ..., n. You have to divide it into two sets A and B in such a way that each element belongs to exactly one set and |sum(A) - sum(B)| is minimum possible.\n\nThe value |x| is the abs... | [{"type": "stdin_stdout", "input": "1000003346\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000070102\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000271094\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1244164813\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1465465413\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Alice was cleaning up her basement when she noticed something very curious: an infinite set of wooden pieces! Each piece was made of five square tiles, with four tiles adjacent to the fifth center tile: \n\n<image... | [{"type": "stdin_stdout", "input": "21\n##.######.###.#####.#\n#...##.#.......#.#...\n##..#...#.....#.....#\n#....#..###.###.....#\n....#....####....#.##\n#..#....##.#....#.###\n#...#.###...#.##....#\n#..#.##.##.##.##.....\n..........##......#.#\n#.##.#......#.#..##.#\n#.##.............#...\n..........#.....##..#\n#.#.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is constraints.\n\nNauuo is a girl who loves random picture websites.\n\nOne day she made a random picture website by herself which includes n pictures.\n\nWhen Nauuo vis... | [{"type": "stdin_stdout", "input": "100 3000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n10 8 1 9 7 5 12 9 15 7 16 5 17 5 17 21 11 3 4 4 30 17 3 84 12 30 2 8 2 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of n digits d_1d_2 ... d_{n}. You need to paint all the digits in two colors so that:\n\n * each digit is painted either in the color 1 or in the color 2; \n * if you write in a row from left to... | [{"type": "stdin_stdout", "input": "5\n12\n040425524644\n1\n0\n9\n123456789\n2\n98\n3\n442\n", "output": "121212211211\n1\n111111111\n21\n221\n"}, {"type": "stdin_stdout", "input": "5\n12\n040425524644\n1\n0\n9\n123456789\n2\n98\n3\n713\n", "output": "121212211211\n1\n111111111\n21\n211\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSuppose there is a h Γ w grid consisting of empty or full cells. Let's make some definitions:\n\n * r_{i} is the number of consecutive full cells connected to the left side in the i-th row (1 β€ i β€ h). In particular, r_i... | [{"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 12 16 10 11 15 4\n", "output": "974740338\n"}, {"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 9 16 10 11 15 4\n", "output": "797922655\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor an array a of integers let's denote its maximal element as max(a), and minimal as min(a). We will call an array a of k integers interesting if max(a) - min(a) β₯ k. For example, array [1, 3, 4, 3] isn't interesting as ... | [{"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 5 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 4 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 2 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n[SIHanatsuka - EMber](https://soundcloud.com/hanatsuka/sihanatsuka-ember)\n\n[SIHanatsuka - ATONEMENT](https://soundcloud.com/hanatsuka/sihanatsuka-atonement)\n\nBack in time, the seven-year-old Nora used to play lots of ... | [{"type": "stdin_stdout", "input": "60\n51 18 41 48 9 10 7 2 34 23 31 55 28 29 47 42 14 30 60 43 16 21 1 33 6 36 58 35 50 19 40 27 26 25 20 38 8 53 22 13 45 4 24 49 56 39 15 3 57 17 59 11 52 5 44 54 37 46 32 12\n", "output": "133605669\n"}, {"type": "stdin_stdout", "input": "59\n43 38 39 8 13 54 3 51 28 11 46 41 14 20 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a set of strings S. Each string consists of lowercase Latin letters.\n\nFor each string in this set, you want to calculate the minimum number of seconds required to type this string. To type a string, you ha... | [{"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n5 h\n3 p\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 3 "}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n5 h\n3 o\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 3\n"}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMadeline has an array a of n integers. A pair (u, v) of integers forms an inversion in a if:\n\n * 1 β€ u < v β€ n. \n * a_u > a_v. \n\n\n\nMadeline recently found a magical paper, which allows her to write two indices u ... | [{"type": "stdin_stdout", "input": "100\n32 85 33 27 35 48 64 40 45 120 68 58 108 115 99 71 47 82 42 34 63 49 102 30 88 70 73 52 51 95 104 41 38 59 91 21 43 107 44 113 109 25 55 118 112 90 37 106 103 100 114 78 31 26 92 79 89 105 62 54 72 69 101 36 98 77 93 97 75 96 22 76 86 57 46 110 65 61 23 50 83 87 39 74 111 67 29 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given the array a consisting of n positive (greater than zero) integers.\n\nIn one move, you can choose two indices i and j (i β j) such that the absolute difference between a_i and a_j is no more than one (|a_i -... | [{"type": "stdin_stdout", "input": "5\n2\n2 6\n4\n2 2 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n2 6\n4\n2 0 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n2 3\n4\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYura has been walking for some time already and is planning to return home. He needs to get home as fast as possible. To do this, Yura can use the instant-movement locations around the city.\n\nLet's represent the city as... | [{"type": "stdin_stdout", "input": "995078784 16\n623812784 347467913 233267735 582455459\n355611107 277980472\n78770458 786182235\n815219022 611815511\n786044046 363376661\n290398527 1777289213\n846155104 388600335\n143085949 155695413\n287078777 918827034\n432395923 126620751\n52941102 329010981\n237509699 571287936\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the easy version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem.\n\nYou are ... | [{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n110\n4 4\n1111\n0110\n0110\n1111\n5 5\n01011\n11001\n00010\n11011\n10000\n2 3\n011\n101\n", "output": "9\n1 1 2 1 2 2 \n1 1 1 2 2 2 \n1 1 2 1 1 2 \n2 1 1 1 1 2 \n2 1 2 2 1 2 \n2 1 1 1 2 2 \n2 2 1 2 1 1 \n2 2 2 1 1 1 \n2 2 1 2 2 1 \n18\n1 2 2 2 2 3 \n1 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBaby Ehab has a piece of Cut and Stick with an array a of length n written on it. He plans to grab a pair of scissors and do the following to it:\n\n * pick a range (l, r) and cut out every element a_l, a_{l + 1}, ..., a... | [{"type": "stdin_stdout", "input": "100 1\n1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 1 2 1 1 1 2 2 1 2 2 2 2 1 1 2 1 1 1 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 2 2 2\n1 100\n", "output": "46\n"}, {"type": "stdin_stdout", "input": "100 1\n1 1 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt a geometry lesson Bob learnt that a triangle is called right-angled if it is nondegenerate and one of its angles is right. Bob decided to draw such a triangle immediately: on a sheet of paper he drew three points with ... | [{"type": "stdin_stdout", "input": "-100 -100 100 100 -100 100\n", "output": "RIGHT\n"}, {"type": "stdin_stdout", "input": "-100 -100 100 -100 0 73\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -34 -79 -60 -62\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -44 -79 -60 -6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFurik and Rubik love playing computer games. Furik has recently found a new game that greatly interested Rubik. The game consists of n parts and to complete each part a player may probably need to complete some other ones... | [{"type": "stdin_stdout", "input": "20\n2 2 3 2 3 1 1 3 1 1 1 1 1 3 2 1 3 1 1 1\n1 7\n13 7 1 11 4 6 16 20 12 5 18 19 15 10\n8 7 1 11 4 6 17 8 16\n3 7 1 11\n9 7 1 11 4 6 8 20 12 3\n4 7 1 11 4\n0\n6 7 1 11 4 6 17\n4 7 1 11 4\n7 7 1 11 4 6 17 5\n2 7 1\n9 7 1 11 4 6 17 8 14 20\n11 7 1 11 4 6 20 3 5 15 10 2\n5 7 1 11 4 6\n9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at hi hours mi minutes. The cafe spends less than... | [{"type": "stdin_stdout", "input": "50\n0 23\n1 21\n2 8\n2 45\n3 1\n4 19\n4 37\n7 7\n7 40\n8 43\n9 51\n10 13\n11 2\n11 19\n11 30\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 54\n13 32\n13 42\n14 29\n14 34\n14 48\n15 0\n15 27\n16 22\n16 31\n17 25\n17 26\n17 33\n18 14\n18 16\n18 20\n19 0\n19 5\n19 56\n20 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote the i-th element of permutation p as pi. We'll call number n the size or... | [{"type": "stdin_stdout", "input": "011\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "15\n", "output": "150347555\n"}, {"type": "stdin_stdout", "input": "13\n", "output": "695720788\n"}, {"type": "stdin_stdout", "input": "9\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerald plays the following game. He has a checkered field of size n Γ n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells. Then for n - 1 minut... | [{"type": "stdin_stdout", "input": "10 5\n2 1\n4 4\n2 2\n4 3\n1 1\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 5\n2 2\n5 3\n2 3\n5 1\n4 4\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n5 4\n3 3\n2 3\n1 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 5\n2 1\n6 4\n2 2\n4 3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nXenia is an amateur programmer. Today on the IT lesson she learned about the Hamming distance.\n\nThe Hamming distance between two strings s = s1s2... sn and t = t1t2... tn of equal length n is value <image>. Record [si β ... | [{"type": "stdin_stdout", "input": "20 25\ncczxcvcxzxzczxcvccxvcxxcvcxcxzcvcxzxcvcxccvcc\nxzcvcxxzzxcvczzxcvcxzvcxzzxcvcxczxcx\n", "output": "655\n"}, {"type": "stdin_stdout", "input": "20 25\ncczxcvcxzwzczxcvccxvcxxcvcxcxzcvcxzxcvcxccvcc\nxzcvcxxzzxcvczzxcvcxzvcxzzxcvcxczxcx\n", "output": "665\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vasya has received a young builderβs kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.\n\nVasya wants... | [{"type": "stdin_stdout", "input": "123\n112 277 170 247 252 115 157 293 256 143 196 90 12 164 164 42 8 223 167 109 175 232 239 111 148 51 9 254 93 32 268 162 231 91 47 162 161 191 195 145 247 292 129 199 230 94 144 217 18 205 176 20 143 198 121 243 211 262 230 277 195 255 108 290 220 275 158 2 286 200 60 267 278 207 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is yet another problem on regular bracket sequences.\n\nA bracket sequence is called regular, if by inserting \"+\" and \"1\" into it we get a correct mathematical expression. For example, sequences \"(())()\", \"()\... | [{"type": "stdin_stdout", "input": "(?(((???))(??)?)?))))(?)????(()()???(?)????(??(??????)()(????(?)))))??(???(??)?(??)????????(????(?()\n39 78\n1 83\n2 35\n28 89\n53 53\n96 67\n16 46\n43 28\n25 73\n8 97\n57 41\n15 25\n47 49\n23 18\n97 77\n38 33\n68 80\n38 98\n62 8\n61 79\n84 50\n71 48\n12 16\n97 95\n16 70\n72 58\n55 8... | 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\nLittle Masha loves arranging her toys into piles on the floor. And she also hates it when somebody touches her toys. One day Masha arranged all her n toys into several piles and then her elder brother Sasha came and gathe... | [{"type": "stdin_stdout", "input": "7\n", "output": "877\n{1,2,3,4,5,6,7}\n{1,2,3,4,5,6},{7}\n{1,2,3,4,5},{6},{7}\n{1,2,3,4,5},{6,7}\n{1,2,3,4,5,7},{6}\n{1,2,3,4,7},{5},{6}\n{1,2,3,4},{5,7},{6}\n{1,2,3,4},{5},{6,7}\n{1,2,3,4},{5},{6},{7}\n{1,2,3,4},{5,6},{7}\n{1,2,3,4},{5,6,7}\n{1,2,3,4,7},{5,6}\n{1,2,3,4,6,7},{5}\n{1,... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMike is trying rock climbing but he is awful at it. \n\nThere are n holds on the wall, i-th hold is at height ai off the ground. Besides, let the sequence ai increase, that is, ai < ai + 1 for all i from 1 to n - 1; we wi... | [{"type": "stdin_stdout", "input": "100\n2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 1525 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 1027 959 960 961 962 963 965 966 967 968 969 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLimak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of hi identical blocks. For clarification see picture for the first sample.\n\nL... | [{"type": "stdin_stdout", "input": "170\n1 2 1 2 1 1 1 1 2 3 2 1 1 2 2 1 2 1 2 1 1 2 3 3 2 1 1 1 1 1 1 1 1 2 1 2 3 3 2 1 2 2 1 2 3 2 1 1 2 3 2 1 2 1 1 1 2 3 3 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 2 1 2 1 2 3 2 1 1 2 3 4 4 3 2 1 2 1 2 1 2 3 3 2 1 2 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 1 2 1 1 2 3 2 1 2 2 1 2 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a rectangular field of n Γ m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', impassable cells are marked with '*'. Let's call two empty cells adjacent ... | [{"type": "stdin_stdout", "input": "10 10\n*.*...*.**\n..*...*.**\n.**.***...\n....*.*.**\n***....***\n.*..*...*.\n.***.*..*.\n.*****.*.*\n*.***.*...\n..*..*....\n", "output": "9.9...5.71\n..9...5.77\n.99.997...\n....9.5.77\n299....513\n.2..0...1.\n.490.0..9.\n.71120.7.1\n7.434.8...\n..6..2....\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInternational Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits of the current year. ... | [{"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'01... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhile swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he bought a cheap replacement phone with an old-fashioned keyboard. The keyboard has only ten digital equal-si... | [{"type": "stdin_stdout", "input": "9\n123456789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n722403540\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n246112056\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n289887167\n", "output": "YES\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nzscoder wants to generate an input file for some programming competition problem.\n\nHis input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually generate the input in a text ... | [{"type": "stdin_stdout", "input": "9999999 1516835495 202833713\n", "output": "18316694854"}, {"type": "stdin_stdout", "input": "7789084 807239576 813643932\n", "output": "25165322688"}, {"type": "stdin_stdout", "input": "9999999 987654321 123456789\n", "output": "11728395036"}, {"type": "stdin_stdout", "input": "4528... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce upon a time Petya and Gena gathered after another programming competition and decided to play some game. As they consider most modern games to be boring, they always try to invent their own games. They have only stic... | [{"type": "stdin_stdout", "input": "110\n-256 -149 -136 -33 -253 -141 -170 -253 0 -107 -141 -236 -65 -158 -84 -180 -97 -97 -223 -44 -232 -255 -108 -25 -49 -48 -212 -3 -232 -172 -231 -158 -23 -206 -198 -55 -36 -11 -169 -94 -190 -115 -116 -231 -155 -201 -155 -103 -242 -119 -136 -8 -2 -11 -69 -250 -51 -129 -155 -216 -107 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The game is played by two persons: operator and player. Operator takes three similar opaque shells and places a ball ... | [{"type": "stdin_stdout", "input": "1999999997\n1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1999999995\n0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1234567890\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2000000000\n2\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a convex polygon P with n distinct vertices p1, p2, ..., pn. Vertex pi has coordinates (xi, yi) in the 2D plane. These vertices are listed in clockwise order.\n\nYou can choose a real number D and move each ... | [{"type": "stdin_stdout", "input": "19\n449447997 711296339\n530233434 692216537\n535464528 613140435\n535533467 100893188\n530498867 -265063956\n519107979 -271820709\n482156929 -287792333\n-303730271 -287970295\n-416935204 -263348201\n-443613873 -249980523\n-453444829 -173903413\n-462102798 -80789280\n-462064673 -1322... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHolidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It's well known that universities provide students with dormitory f... | [{"type": "stdin_stdout", "input": "1000000000 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "12 1000000000\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "1000000100 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "12 1000100000\n", "output": "479001600\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe elections to Berland parliament are happening today. Voting is in full swing!\n\nTotally there are n candidates, they are numbered from 1 to n. Based on election results k (1 β€ k β€ n) top candidates will take seats in... | [{"type": "stdin_stdout", "input": "100 100 100 100\n71 22 92 3 19 90 1 16 88 56 62 37 56 84 52 46 4 64 21 19 37 54 21 81 56 33 71 57 86 75 62 42 79 67 14 8 66 30 13 38 20 71 36 66 46 55 4 99 18 37 7 24 72 46 32 86 87 7 90 93 96 94 21 23 62 53 16 11 11 83 21 81 68 50 85 9 94 60 47 41 34 82 11 12 95 81 61 81 86 85 64 36... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRock... Paper!\n\nAfter Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows.\n\nA positive intege... | [{"type": "stdin_stdout", "input": "30\n1143673 436496 1214486 1315862 148404 724601 1430740 1433008 1654610 1635673 614673 1713408 1270999 1697 1463796 50027 525482 1659078 688200 842647 518551 877506 1017082 1807856 3280 759698 1208220 470180 829800 1960886\n1312613 1965095 967255 1289012 1950383 582960 856825 49684 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He will then press the sn... | [{"type": "stdin_stdout", "input": "12\n00 06\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "60\n03 00\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n03 10\n", "output": "56\n"}, {"type": "stdin_stdout", "input": "5\n06 00\n", "output": "145\n"}, {"type": "stdin_stdout", "input": "60\n04 08\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima has a hamsters farm. Soon N hamsters will grow up on it and Dima will sell them in a city nearby.\n\nHamsters should be transported in boxes. If some box is not completely full, the hamsters in it are bored, that's w... | [{"type": "stdin_stdout", "input": "1998451655 50\n977141206 956777871 186433588 538218068 28363231 327484438 88827268 266300062 670616672 756092978 414181331 913675814 898008516 343057716 99416265 255545168 76528140 550467703 684435578 844649988 1024428164 550467703 493542638 33869647 414181331 198095018 913675814 994... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis night wasn't easy on Vasya. His favorite team lost, and he didn't find himself victorious either β although he played perfectly, his teammates let him down every time. He had to win at least one more time, but the lo... | [{"type": "stdin_stdout", "input": "234906817379759421\n", "output": "22773236965920\n"}, {"type": "stdin_stdout", "input": "462534182594129378\n", "output": "13498126800480\n"}, {"type": "stdin_stdout", "input": "987654321123456789\n", "output": "33007837322880\n"}, {"type": "stdin_stdout", "input": "98765432002345678... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArjit has his own printing press, Bainik Dhaskar (BD). He feels that words on their own simply aren't beautiful enough. So, he wishes to make a Super Manuscript (SM) machine. Now what does this machine do?\nThe SM machine... | [{"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\nabcd\nac\nzzzb\n\nSAMPLE", "output": "aaab\nabcdya\nab\n"}, {"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\nabcd\nca\nzzzb\n\nSAMPLE", "output": "aaab\nabcdya\nba\n"}, {"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\ncbad\nca\nzzza\n\nSAMPLE", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet us look at the close relative of Fibonacci numbers, called the Phibonacci numbers. They work exactly like Fibonacci numbers. F (1) = 0, F(1) = 1, F(2) = 1, and then F (n) = F ( n - 1 ) + F ( n - 2 ). In number theory,... | [{"type": "stdin_stdout", "input": "200\n2 14\n17 24\n12 19\n17 18\n2 17\n3 6\n1 5\n13 14\n17 18\n1 2\n1 2\n10 30\n1 13\n4 7\n22 24\n9 24\n5 26\n21 22\n4 7\n13 15\n1 2\n6 10\n16 25\n1 6\n3 14\n1 12\n10 15\n7 11\n5 8\n1 8\n5 16\n5 7\n11 24\n1 12\n7 8\n5 30\n12 25\n4 14\n4 12\n13 18\n18 27\n7 11\n2 10\n8 19\n2 20\n15 19\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given a contest schedule for D days and M queries of schedule modification. In the i-th query, given integers d_i and q_i, change the type of contest to be held on day d_i to q_i, and then output the final sat... | [{"type": "stdin_stdout", "input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's now the season of TAKOYAKI FESTIVAL!\n\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\n\nAs is commonly known, when you eat t... | [{"type": "stdin_stdout", "input": "7\n-1 -1 281 -2 0 10 9", "output": "4234\n"}, {"type": "stdin_stdout", "input": "7\n-1 -1 395 -2 0 10 9", "output": "5944\n"}, {"type": "stdin_stdout", "input": "7\n-1 0 119 -3 -1 5 12", "output": "1410\n"}, {"type": "stdin_stdout", "input": "7\n-2 0 119 -3 -1 5 12", "output": "1278\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a tree with N vertices numbered 1, 2, ..., N. The i-th edge connects Vertex a_i and Vertex b_i. You are also given a string S of length N consisting of `0` and `1`. The i-th character of S represents the num... | [{"type": "stdin_stdout", "input": "7\n0011101\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1\n"}, {"type": "stdin_stdout", "input": "7\n1010110\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1\n"}, {"type": "stdin_stdout", "input": "7\n0010110\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\n\nSnuke decided to get food delivery from the closer of stores A and... | [{"type": "stdin_stdout", "input": "1 1455 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 1200 0101", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 999 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 381 1110", "output": "A\n"}, {"type": "stdin_stdout", "input": "1 999 0100", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer found N rectangle lying on the table, each with height 1. If we consider the surface of the desk as a two-dimensional plane, the i-th rectangle i(1β€iβ€N) covers the vertical range of [i-1,i] and the horiz... | [{"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 106\n500000 500001\n999999999 1000000000", "output": "1999999892\n"}, {"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 101\n500000 500001\n999999999 1000000000", "output": "1999999897\n"}, {"type": "stdin_stdout", "input": "5\n9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a pyramid with N steps, built with blocks. The steps are numbered 1 through N from top to bottom. For each 1β€iβ€N, step i consists of 2i-1 blocks aligned horizontally. The pyramid is built so that the blocks at the... | [{"type": "stdin_stdout", "input": "8 8", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n"}, {"type": "stdin_stdout", "input": "7 7", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n"}, {"type": "stdin_stdout", "input": "6 6", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA thief sneaked into a museum with a lot of treasures with only one large furoshiki. There are many things I want to steal, but the weight that the furoshiki can withstand is limited, and if it exceeds this, the furoshiki... | [{"type": "stdin_stdout", "input": "50\n5\n60,10\n100,10\n03,022\n210,45\n10,4\n162\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0", "output": "Case 1:\n220\n49\nCase 2:\n500\n109\n"}, {"type": "stdin_stdout", "input": "50\n5\n60,20\n100,20\n03,021\n210,45\n10,4\n143\n5\n60,10\n100,20\n120,30\n200,45\n10,4\n0", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's been a while since I played with A, B, and C. Mr. A and Mr. B became players, and Mr. C became a referee and played a badminton singles game. The rules decided by the three people are as follows.\n\n* 3 Play the game... | [{"type": "stdin_stdout", "input": "AABBAAABABAABBBAABA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBABAA\nAAAAAAAAAAA\nABBBBBBBBBB\n0", "output": "11 8\n10 12\n11 7\n11 8\n11 0\n0 11\n"}, {"type": "stdin_stdout", "input": "ABAABBBAABABAAABBAA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBA... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe smallest unit of data handled by a computer is called a bit, and the amount of information that represents multiple bits together is called a word. Currently, many computers process one word as 32 bits.\n\nFor a compu... | [{"type": "stdin_stdout", "input": "-322", "output": "-10304\n"}, {"type": "stdin_stdout", "input": "-542", "output": "-17344\n"}, {"type": "stdin_stdout", "input": "-130", "output": "-4160\n"}, {"type": "stdin_stdout", "input": "-133", "output": "-4256\n"}, {"type": "stdin_stdout", "input": "-199", "output": "-6368\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nTo the west of the Australian continent is the wide Indian Ocean. Marine researcher JOI is studying the properties of N species of fish in the Indian Ocean.\n\nFor each type of fish, a rectangular parallelepipe... | [{"type": "stdin_stdout", "input": "3 2\n26 58 0 50 135 000\n10 24 20 127 126 60\n40 60 20 90 90 131", "output": "60000\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -2 50 70 000\n10 102 11 39 90 40\n75 100 36 102 159 8", "output": "1200\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -3 50 70 000\n10 102 11 39... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n> I would, if I could,\n> If I couldn't how could I?\n> I couldn't, without I could, could I?\n> Could you, without you could, could ye?\n> Could ye? could ye?\n> Could you, without you could, could ye?\n\nIt is true... | [{"type": "stdin_stdout", "input": "15 2 3\n16 3 6\n110 9 112\n0 0 0", "output": "1\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n16 3 6\n110 9 112\n0 0 0", "output": "8\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n15 3 6\n110 9 112\n0 0 0", "output": "8\n10\n98\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe ACM ICPC judges are very careful about not leaking their problems, and all communications are encrypted. However, one does sometimes make mistakes, like using too weak an encryption scheme. Here is an example of that.... | [{"type": "stdin_stdout", "input": "8\n1 1 1 1 1 1 2 1 8\n3 2 3 2 3 2 4 2 10\n6 4 7 13 7 b a 2 2e\ne1 13 ce 28 ca 6 ab 46 a5d\nb08 49e2 6128 f27 8cf2 bc50 7380 7fe1 722b\n4eba eb4 a352 fd14 6ac1 fed1 dd06 bb83 392bc\nef593c08 847e522f c9b20c47 26f3a4e1 e2720a01 6fe66007\n7a4e96ad 6ee5cef6 3853cd88\n8bf20206 757d6d66 9c... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.