Search is not available for this dataset
problem_id stringlengths 32 32 | name stringlengths 2 112 | problem stringlengths 200 14k | test_cases stringlengths 33 79.2M | difficulty stringclasses 33
values | language listlengths 1 1 | source stringclasses 14
values | num_solutions int64 2 1.9M | starter_code stringlengths 0 1.47k | subset stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|
6286823ddf5df5be20a2e19ef19da4f1 | War of the Corporations | A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the corner: Gogol is ready to release it's new tablet Lastus 3000.
This new device is equipped with specially designed artificial intelligence (AI). Employees of Pine... | {"inputs": ["intellect\ntell", "google\napple", "sirisiri\nsir", "sirisiri\nsiri", "aaaaaaa\naaaa", "bbbbbb\nbb", "abc\nabcabc", "kek\nkekekek", "aaaaa\naaa", "abcdabcv\nabcd", "abcabcabczabcabcabcz\ncab", "aatopotopotopotaa\ntopot", "abcabcabcabcabcabcabcabcabcabc\nabcabcabcabcabcabcabcabcabcabc", "sosossosos\nsos", "... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 221 | codeforces | |
629153c9b94fe4c0e94ab1c77e4ac45d | Mad Joe | Joe has been hurt on the Internet. Now he is storming around the house, destroying everything in his path.
Joe's house has *n* floors, each floor is a segment of *m* cells. Each cell either contains nothing (it is an empty cell), or has a brick or a concrete wall (always something one of three). It is believed that ea... | {"inputs": ["3 5\n..+.#\n#+..+\n+.#+.", "4 10\n...+.##+.+\n+#++..+++#\n++.#++++..\n.+##.++#.+", "2 2\n..\n++", "5 1\n.\n.\n.\n.\n.", "20 20\n..+#+.+++.+++#+..#++\n..####+++#..++#+.+.+\n+.+..+++..#.++++++++\n+##++..+.##..#+++.++\n++.+.+.+.++++.+++.++\n.+++++.+#+++++...+#+\n.+++#+++++++.+.++.++\n...+.++++++.++#...++\n+++... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
629ace22bf13e54cf3019369032e4a31 | Buy a Ticket | Musicians of a popular band "Flayer" have announced that they are going to "make their exit" with a world tour. Of course, they will visit Berland as well.
There are *n* cities in Berland. People can travel between cities using two-directional train routes; there are exactly *m* routes, *i*-th route can be used to go ... | {"inputs": ["4 2\n1 2 4\n2 3 7\n6 20 1 25", "3 3\n1 2 1\n2 3 1\n1 3 1\n30 10 20", "7 7\n1 6 745325\n2 3 3581176\n2 4 19\n3 6 71263060078\n5 4 141198\n7 4 163953\n5 6 15994\n1 297404206755 82096176217 14663411 187389745 21385 704393"], "outputs": ["6 14 1 25 ", "12 10 12 ", "1 335807 7498159 335769 53373 21385 663675 "]... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
62ca0fdbd9cd503199fb21ff45877182 | Day at the Beach | One day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so the friends were unable to ride waves. However, they decided to spent their time building sand castles.
At the end of the day there were *n* castles built by friends. Castles are numbered from 1 to *n*, and the ... | {"inputs": ["3\n1 2 3", "4\n2 1 3 2", "17\n1 45 22 39 28 23 23 100 500 778 777 778 1001 1002 1005 1003 1005", "101\n1 50 170 148 214 153 132 234 181 188 180 225 226 200 197 122 181 168 87 220 223 160 235 94 257 145 199 235 102 146 119 60 109 134 209 260 210 191 180 271 236 195 155 169 166 143 246 102 208 137 278 269 15... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 16 | codeforces | |
62fe0ebe0c4ab67b71ccafaf12746b83 | The Maths Lecture | Amr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't.
First he gave Amr two positive integers *n* and *k*. Then he asked Amr, how many integer numbers *x*<=><=0 exist such t... | {"inputs": ["1 2 1000", "2 2 1000", "5 3 1103", "2 17 10000", "3 9 10000", "6 64 941761822", "183 3 46847167", "472 44 364550669", "510 76 811693420", "783 30 602209107", "863 47 840397713", "422 22 411212542", "370 9 385481464", "312 41 915197716", "261 32 49719977", "434 6 56571287", "355 3 945669623", "905 71 999142... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
6329ead462cbeae7d091ee0822fdf649 | Minimum Binary Number | String can be called correct if it consists of characters "0" and "1" and there are no redundant leading zeroes. Here are some examples: "0", "10", "1001".
You are given a correct string *s*.
You can perform two different operations on this string:
1. swap any pair of adjacent characters (for example, "101" "110"... | {"inputs": ["4\n1001", "1\n1", "100\n1110111100001111011111111010110011111111011110000111101101011100110110001011000000101010110101011100", "100\n1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "100\n11111111111111111111111111111111111111111111111111111111111111111... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 260 | codeforces | |
6345b9b6db25c4c6c108cbbca4514fab | Cheese Board | Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard).
The first line of input contains a single integer *N* (1<=≤<=*N*<=≤<=100) — the number of cheeses you have.
The next *N* lines describe the cheeses you have. Each line contains two space-separated strings: the name of the cheese and its ty... | {"inputs": ["9\nbrie soft\ncamembert soft\nfeta soft\ngoat soft\nmuenster soft\nasiago hard\ncheddar hard\ngouda hard\nswiss hard", "6\nparmesan hard\nemmental hard\nedam hard\ncolby hard\ngruyere hard\nasiago hard", "9\ngorgonzola soft\ncambozola soft\nmascarpone soft\nricotta soft\nmozzarella soft\nbryndza soft\njarl... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
6359aabb4e475d8930450b9c7b8a244e | Buggy Sorting | Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of *n* integers *a*1,<=*a*2,<=...,<=*a**n* in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. ... | {"inputs": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "50", "22", "34", "50", "12", "26", "38", "4", "18", "30", "46", "32"], "outputs": ["-1", "-1", "3 2 1 ", "4 3 2 1 ", "5 4 3 2 1 ", "6 5 4 3 2 1 ", "7 6 5 4 3 2 1 ", "8 7 6 5 4 3 2 1 ", "9 8 7 6 5 4 3 2 1 ", "50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 104 | codeforces | |
6373123f7aa31b6ad05e108d392f4525 | cAPS lOCK | wHAT DO WE NEED cAPS LOCK FOR?
Caps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it leads to accidents like the one we had in the first passage.
Let's consider that a word has been typed with the Caps lock key accidentall... | {"inputs": ["cAPS", "Lock", "cAPSlOCK", "CAPs", "LoCK", "OOPS", "oops", "a", "A", "aA", "Zz", "Az", "zA", "AAA", "AAa", "AaR", "Tdr", "aTF", "fYd", "dsA", "fru", "hYBKF", "XweAR", "mogqx", "eOhEi", "nkdku", "zcnko", "lcccd", "vwmvg", "lvchf", "IUNVZCCHEWENCHQQXQYPUJCRDZLUXCLJHXPHBXEUUGNXOOOPBMOBRIBHHMIRILYJGYYGFMTMFSVU... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 185 | codeforces | |
63797f23a28c31697c3a4221a9c9de1d | LionAge II | Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character — non-empty string *s*, consisting of a lowercase Latin letters. However, in order not to put up a front of friends, Vasya has decided ... | {"inputs": ["winner 4\n4\ns e 7\no s 8\nl o 13\no o 8", "abcdef 1\n5\na b -10\nb c 5\nc d 5\nd e 5\ne f 5", "akcbd 2\n3\na d 55\nb z 100\nb c 50", "adcbd 1\n3\na d 55\nb z 100\nb c 50", "abcbd 1\n3\na b 55\nb z 100\nb c 50", "vswlx 1\n3\nz l 509\nb i 287\na o 952", "srtlmx 2\n2\ne a -167\nc v -932", "dlcmexn 3\n3\no k ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 4 | codeforces | |
638c7aa6d07a25b3a8293cfb624a5cc6 | The Fibonacci Segment | You have array *a*1,<=*a*2,<=...,<=*a**n*. Segment [*l*,<=*r*] (1<=≤<=*l*<=≤<=*r*<=≤<=*n*) is good if *a**i*<==<=*a**i*<=-<=1<=+<=*a**i*<=-<=2, for all *i* (*l*<=+<=2<=≤<=*i*<=≤<=*r*).
Let's define *len*([*l*,<=*r*])<==<=*r*<=-<=*l*<=+<=1, *len*([*l*,<=*r*]) is the length of the segment [*l*,<=*r*]. Segment [*l*1,<=*r... | {"inputs": ["10\n1 2 3 5 8 13 21 34 55 89", "5\n1 1 1 1 1", "1\n1000", "51\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", "1\n0", "2\n0 0", "3\n0 0 0", "4\n0 0 0 0", "5\n0 0 0 0 0", "6\n10 20 30 10 40 50", "5\n8 9 17 26 43", "12\n1 2 3 5 8 13 0 1 1 2 3 5", "13\n... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 36 | codeforces | |
63a39518a14342d2da52a6a26177fe6d | Neverending competitions | There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (for some reason they prefer name "snookah")! When a competition takes place somewhere far from their hometown, Ivan, Artsem and Konstantin take a flight to the contest and back.
Jinotega's best friends, team ... | {"inputs": ["4\nSVO\nSVO->CDG\nLHR->SVO\nSVO->LHR\nCDG->SVO", "3\nSVO\nSVO->HKT\nHKT->SVO\nSVO->RAP", "1\nESJ\nESJ->TSJ", "2\nXMR\nFAJ->XMR\nXMR->FAJ", "3\nZIZ\nDWJ->ZIZ\nZIZ->DWJ\nZIZ->DWJ", "10\nPVO\nDMN->PVO\nDMN->PVO\nPVO->DMN\nDMN->PVO\nPVO->DMN\nPVO->DMN\nPVO->DMN\nDMN->PVO\nPVO->DMN\nDMN->PVO", "11\nIAU\nIAU->RU... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 199 | codeforces | |
63a615e529c016233a0a40824ea99d38 | Letter A | Little Petya learns how to write. The teacher gave pupils the task to write the letter *A* on the sheet of paper. It is required to check whether Petya really had written the letter *A*.
You are given three segments on the plane. They form the letter *A* if the following conditions hold:
- Two segments have common e... | {"inputs": ["3\n4 4 6 0\n4 1 5 2\n4 0 4 4\n0 0 0 6\n0 6 2 -4\n1 1 0 1\n0 0 0 5\n0 5 2 -1\n1 2 0 1"], "outputs": ["YES\nNO\nYES"]} | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 5 | codeforces | |
63a9cea7d9db70b77cff7f58c487ccdf | Number of Parallelograms | You are given *n* points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.
The first line of the input contains integer *n* (1<=≤<=*n*<=≤<=2000) — the number of points.
Each of the next *n* lines contains two inte... | {"inputs": ["4\n0 1\n1 0\n1 1\n2 0", "1\n0 0", "1\n6 6", "5\n1 5\n4 2\n4 4\n8 1\n8 2", "10\n1 7\n2 14\n3 7\n3 13\n5 13\n13 10\n15 12\n17 1\n18 8\n19 0", "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 12\n18 14\n19 18\n20 17", "2\n2 5\n10 7", "4\n7 9\n10 2\n12 20\n1... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 14 | codeforces | |
63b11bb3bcf044f70a1065e2688186d4 | Phone Number | Alas, finding one's true love is not easy. Masha has been unsuccessful in that yet. Her friend Dasha told Masha about a way to determine the phone number of one's Prince Charming through arithmancy.
The phone number is divined like that. First one needs to write down one's own phone numbers. For example, let's suppos... | {"inputs": ["12345", "09", "3", "55", "737", "21583", "33408349", "0180990956", "433488906230138", "00046142930690780976", "317579445234107659439645596", "95066916647678224147260013920", "36460576924876475371008334246121610", "429622625617508557672595893160462042433748844995", "17601120900014764776764048700928872725171... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 16 | codeforces | |
63b7d41690ec122f4af9a2a294f9cc0b | Protect Sheep | Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protected.
The pasture is a rectangle consisting of *R*<=×<=*C* cells. Each cell is either empty, contains a sheep, a wolf or... | {"inputs": ["1 2\nSW", "10 10\n....W.W.W.\n.........S\n.S.S...S..\nW.......SS\n.W..W.....\n.W...W....\nS..S...S.S\n....W...S.\n..S..S.S.S\nSS.......S", "10 10\n....W.W.W.\n...W.....S\n.S.S...S..\nW......WSS\n.W..W.....\n.W...W....\nS..S...S.S\n...WWW..S.\n..S..S.S.S\nSS.......S", "1 50\nW...S..............W.....S..S...... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 268 | codeforces | |
63bda1d48d73e74b0fb2315f69ff2346 | Watering System | Arkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for $n$ flowers and so it looks like a pipe with $n$ holes. Arkady can only use the water that flows from the first hole.
Arkady can block some of the holes, and then pour $A$ liters of water into the pipe. After... | {"inputs": ["4 10 3\n2 2 2 2", "4 80 20\n3 2 1 4", "5 10 10\n1000 1 1 1 1", "10 300 100\n20 1 3 10 8 5 3 6 4 3", "10 300 100\n20 25 68 40 60 37 44 85 23 96", "1 1 1\n1", "1 2 1\n1", "2 2 2\n1 10000", "2 10000 1\n1 9999"], "outputs": ["1", "0", "4", "1", "8", "0", "0", "1", "0"]} | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 183 | codeforces | |
63cefaf85dc9a9057a96f4a4b3cf46b4 | Sereja and Coat Rack | Sereja owns a restaurant for *n* people. The restaurant hall has a coat rack with *n* hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using the *i*-th hook costs *a**i* rubles. Only one person can hang clothes on one hook.
Tonight Sereja expects *m* guests in the restaurant. Naturally, each gu... | {"inputs": ["2 1\n2 1\n2", "2 1\n2 1\n10", "1 1\n1\n2", "3 96\n83 22 17\n19", "8 4\n27 72 39 70 13 68 100 36\n95", "2 65\n23 34\n74", "2 48\n12 54\n69", "5 30\n63 58 38 60 24\n42", "9 47\n17 36 91 43 89 7 41 43 65\n49", "6 49\n91 30 71 51 7 2\n94", "57 27\n73 51 24 86 57 17 27 58 27 58 38 72 70 62 97 23 18 13 18 97 86 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 15 | codeforces | |
63fdf4925ed3ccbb06620158f797a41d | Photo to Remember | One day *n* friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together.
Simply speaking, the process of taking photos can be described as follows. On the photo, each photographed friend occupies a rectangle of pixels: the *i*-th of them occupies the rectangl... | {"inputs": ["3\n1 10\n5 5\n10 1", "3\n2 1\n1 2\n2 1", "2\n1 5\n2 3", "2\n2 3\n1 1", "3\n1 10\n2 10\n3 10", "3\n2 10\n1 9\n3 7", "3\n1 1\n3 2\n2 3", "3\n3 123\n1 456\n2 789", "3\n2 987\n3 654\n1 321", "3\n3 143\n2 543\n1 893", "2\n1 1\n1 2", "3\n2 22\n1 11\n2 22", "3\n1 11\n1 12\n1 13", "3\n1 11\n1 12\n2 10", "10\n6 20\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 137 | codeforces | |
641a649f2f8006ce2ac9c06d92bc9009 | Vasya and Robot | Vasya has *n* items lying in a line. The items are consecutively numbered by numbers from 1 to *n* in such a way that the leftmost item has number 1, the rightmost item has number *n*. Each item has a weight, the *i*-th item weights *w**i* kilograms.
Vasya needs to collect all these items, however he won't do it by hi... | {"inputs": ["3 4 4 19 1\n42 3 99", "4 7 2 3 9\n1 2 3 4", "2 100 100 10000 10000\n100 100", "2 3 4 5 6\n1 2", "1 78 94 369 10000\n93", "1 94 78 369 10000\n93", "5 1 100 1 10000\n1 2 3 4 5", "5 100 1 10000 1\n1 2 3 4 5", "5 1 100 10000 1\n1 2 3 4 5", "5 100 1 1 10000\n1 2 3 4 5", "6 32 47 965 897\n7 4 1 3 5 4", "7 3 13 3... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 29 | codeforces | |
643c6163ecab0b811b51f719c5fe56c7 | Walking in the Rain | In Berland the opposition is going to arrange mass walking on the boulevard. The boulevard consists of *n* tiles that are lain in a row and are numbered from 1 to *n* from right to left. The opposition should start walking on the tile number 1 and the finish on the tile number *n*. During the walk it is allowed to move... | {"inputs": ["4\n10 3 5 10", "5\n10 2 8 3 5", "10\n10 3 1 6 7 1 3 3 8 1", "10\n26 72 10 52 2 5 61 2 39 64", "100\n8 2 1 2 8 3 5 8 5 1 9 3 4 1 5 6 4 2 9 10 6 10 10 3 9 4 10 5 3 1 5 10 7 6 8 10 2 6 4 4 2 2 10 7 2 7 3 2 6 3 6 4 7 6 2 5 5 8 6 9 5 2 7 5 8 6 5 8 10 6 10 8 5 3 1 10 6 1 7 5 1 8 10 5 1 3 10 7 10 5 7 1 4 3 8 6 3 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 75 | codeforces | |
646829dd4da9ab53be8b2b48c5fd1b6d | Perfectionist Arkadiy | Arkadiy has lots square photos with size *a*<=×<=*a*. He wants to put some of them on a rectangular wall with size *h*<=×<=*w*.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically and horizontally photos and also the distances between outside row... | {"inputs": ["2 18 13", "4 4 4", "3 4 3", "9 81 23", "11 21 21", "55 178 996", "8 81 60", "3 1000000000 1000000000", "1000000000 1000000000 1000000000", "1 1000000000 1000000000", "6 1000000000 1000000000", "6 1000000000 956431324", "546 182989 371991", "45 654489 357075", "97259 999895180 999895180", "453145 999531525 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 7 | codeforces | |
64708c20e20886405273495cf8cb8aa5 | Marco and GCD Sequence | In a dream Marco met an elderly man with a pair of black glasses. The man told him the key to immortality and then disappeared with the wind of time.
When he woke up, he only remembered that the key was a sequence of positive integers of some length *n*, but forgot the exact sequence. Let the elements of the sequence ... | {"inputs": ["4\n2 4 6 12", "2\n2 3", "2\n1 6", "3\n1 2 7", "1\n1", "2\n1 10", "3\n1 2 6", "15\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15", "14\n1 2 3 4 5 6 7 8 9 10 11 12 13 14", "5\n2 5 6 7 11", "11\n3 4 5 6 7 8 9 10 11 12 13", "3\n4 9 11", "6\n5 6 9 11 14 16", "12\n8 9 10 11 12 13 14 15 16 17 18 19", "3\n1007 397765 414884... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 10 | codeforces | |
6489c934b00a49add0189bfd59b6168f | Bear and Company | Bear Limak prepares problems for a programming competition. Of course, it would be unprofessional to mention the sponsor name in the statement. Limak takes it seriously and he is going to change some words. To make it still possible to read, he will try to modify each word as little as possible.
Limak has a string *s*... | {"inputs": ["4\nVKVK", "5\nBVVKV", "7\nVVKEVKK", "20\nVKVKVVVKVOVKVQKKKVVK", "5\nLIMAK", "1\nV", "1\nK", "1\nZ", "17\nVAKVAKLIMAKVVVKKK", "10\nVVKAVZVAAZ", "17\nQZVRZKDKMZZAKKZVA", "51\nAVVVVVVVVVVKKKKKKKKKKVVVVVVVVVVVVVVVKKKKKKKKKKKKKKK", "75\nVFZVZRVZAZJAKAZKAVVKZKVHZZZZAVAAKKAADKNAKRFKAAAZKZVAKAAAJAVKYAAZAKAVKASZAAK... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
648ebdda98e828fc28e38a9a29ff5be5 | QAQ | "QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.
Now Diamond has given Bort a string consisting of only uppercase English letters of length *n*. There is a great number of "QAQ" in the string (Diamond is so cute!).
Bort wants to know how many subsequences "QAQ" are... | {"inputs": ["QAQAQYSYIOIWIN", "QAQQQZZYNOIWIN", "QA", "IAQVAQZLQBQVQFTQQQADAQJA", "QQAAQASGAYAAAAKAKAQIQEAQAIAAIAQQQQQ", "AMVFNFJIAVNQJWIVONQOAOOQSNQSONOASONAONQINAONAOIQONANOIQOANOQINAONOQINAONOXJCOIAQOAOQAQAQAQAQWWWAQQAQ", "AAQQAXBQQBQQXBNQRJAQKQNAQNQVDQASAGGANQQQQTJFFQQQTQQA", "KAZXAVLPJQBQVQQQQQAPAQQGQTQVZQAAAOYA",... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 821 | codeforces | |
649a7547be14ae924e629e397bbeab07 | Polo the Penguin and XOR operation | Little penguin Polo likes permutations. But most of all he likes permutations of integers from 0 to *n*, inclusive.
For permutation *p*<==<=*p*0,<=*p*1,<=...,<=*p**n*, Polo has defined its beauty — number .
Expression means applying the operation of bitwise excluding "OR" to numbers *x* and *y*. This operation exist... | {"inputs": ["4", "7", "1", "2", "3", "8", "10", "47", "74", "99", "128", "257", "1000000", "77845", "100000", "100001", "999999", "777777", "687500", "17", "18", "19", "20", "4587", "15475", "68450", "6100", "1047", "670041", "875495", "687548", "154781", "684501", "754810", "987548", "348754", "20", "11", "12", "13", ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
649aa1e191c627b051eaf6aa75a8fc29 | Buy a Shovel | Polycarp urgently needs a shovel! He comes to the shop and chooses an appropriate one. The shovel that Policarp chooses is sold for *k* burles. Assume that there is an unlimited number of such shovels in the shop.
In his pocket Polycarp has an unlimited number of "10-burle coins" and exactly one coin of *r* burles (1<... | {"inputs": ["117 3", "237 7", "15 2", "1 1", "1 9", "1000 3", "1000 1", "1000 9", "1 2", "999 9", "999 8", "105 6", "403 9", "546 4", "228 9", "57 2", "437 9", "997 6", "109 1", "998 9", "4 2", "9 3", "8 2", "1 3", "1 4", "1 5", "1 6", "1 7", "1 8", "100 3", "1000 2", "1000 4", "1000 5", "1000 6", "1000 7", "1000 8", "... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 657 | codeforces | |
64ae99b2640743d28b6f1af4965bdc8b | Petya and Divisors | Little Petya loves looking for numbers' divisors. One day Petya came across the following problem:
You are given *n* queries in the form "*x**i* *y**i*". For each query Petya should count how many divisors of number *x**i* divide none of the numbers *x**i*<=-<=*y**i*,<=*x**i*<=-<=*y**i*<=+<=1,<=...,<=*x**i*<=-<=1. Hel... | {"inputs": ["6\n4 0\n3 1\n5 2\n6 2\n18 4\n10000 3", "5\n10 0\n10 0\n10 0\n10 0\n10 0", "12\n41684 0\n95210 1\n60053 1\n32438 3\n97956 1\n21785 2\n14594 6\n17170 4\n93937 6\n70764 5\n13695 4\n14552 6", "10\n54972 0\n48015 1\n7114 1\n68273 2\n53650 4\n1716 1\n16165 2\n96062 5\n57750 1\n21071 5", "20\n68260 0\n819 1\n5417... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 8 | codeforces | |
64af1d01e5de4d00253448efa8270fac | Round Table Knights | There are *n* knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood.
Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortunate if the regular polygon can be found. On all vertices of the polygon knight... | {"inputs": ["3\n1 1 1", "6\n1 0 1 1 1 0", "6\n1 0 0 1 0 1", "10\n1 0 1 1 1 0 1 0 1 0", "15\n0 0 0 1 0 1 1 0 1 0 0 1 0 1 0", "29\n0 1 0 0 0 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 1", "77\n0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 4 | codeforces | |
653c4a2ac6666e63908c505220e30beb | Making a String | You are given an alphabet consisting of *n* letters, your task is to make a string of the maximum possible length so that the following conditions are satisfied:
- the *i*-th letter occurs in the string no more than *a**i* times; - the number of occurrences of each letter in the string must be distinct for all the ... | {"inputs": ["3\n2 5 5", "3\n1 1 2", "2\n1 1", "3\n1 1000000000 2", "26\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 109 | codeforces | |
6541177a52b00070ad9dd4343e4db7c8 | An impassioned circulation of affection | Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has *n* pieces numbered from 1 to *n* fro... | {"inputs": ["6\nkoyomi\n3\n1 o\n4 o\n4 m", "15\nyamatonadeshiko\n10\n1 a\n2 a\n3 a\n4 a\n5 a\n1 b\n2 b\n3 b\n4 b\n5 b", "10\naaaaaaaaaa\n2\n10 b\n10 z", "1\nc\n4\n1 x\n1 a\n1 e\n1 t", "20\naaaaaaaaaaaaaaaaaaaa\n1\n11 a", "4\ncbcc\n12\n4 b\n4 c\n1 b\n2 a\n3 b\n2 c\n4 a\n1 a\n2 b\n3 a\n1 c\n3 c", "4\nddbb\n16\n3 c\n3 b\n... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 16 | codeforces | |
65412f3683283e2c511a4c7a01346395 | Memory and Trident | Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string *s* with his directions for motion:
- An 'L' indicates he should move one unit left. - An 'R' indicates he should move one unit right. - A 'U' indicates he should move one unit up. - A 'D' indicates he should move... | {"inputs": ["RRU", "UDUR", "RUUR", "DDDD", "RRRR", "RRRUUD", "UDURLRDURLRD", "RLRU", "RDDLLDLUUUDDRDRURLUUURLLDDLRLUURRLLRRLDRLLUDRLRULLDLRRLRLRLRUDUUDLULURLLDUURULURLLRRRURRRDRUUDLDRLRDRLRRDDLDLDLLUDRUDRLLLLDRDUULRUURRDLULLULDUDULRURRDDDLLUDRLUDDLDDDRRDDDULLLLDLDRLRRLRRDDRLULURRUDRDUUUULDURUDRDLDDUDUDRRURDULRRUDRLRRDL... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 164 | codeforces | |
6558f3871d816257c05bb8862dc490d2 | Nastya and a Wardrobe | Nastya received a gift on New Year — a magic wardrobe. It is magic because in the end of each month the number of dresses in it doubles (i.e. the number of dresses becomes twice as large as it is in the beginning of the month).
Unfortunately, right after the doubling the wardrobe eats one of the dresses (if any) with ... | {"inputs": ["2 0", "2 1", "3 2", "1 411", "1 692", "16 8", "18 12", "1 1000000000000000000", "0 24", "24 0", "1000000000000000000 1", "348612312017571993 87570063840727716", "314647997243943415 107188213956410843", "375000003 2", "451 938", "4 1669", "24 347", "1619 1813", "280 472", "1271 237", "626 560", "167 887", "... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 29 | codeforces | |
65627e8c97269b0e4c8570613a86125c | Large Bouquets | A flower shop has got *n* bouquets, and the *i*-th bouquet consists of *a**i* flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets.
Vasya thinks that a bouquet is large if it is made of two or more initial bouquets, and there is a constraint: the total number of flowers in a lar... | {"inputs": ["5\n2 3 4 2 7", "6\n2 2 6 8 6 12", "3\n11 4 10", "1\n1", "1\n2", "1\n999999", "1\n1000000", "4\n943543 151729 379602 589828", "2\n468463 62253", "3\n352987 849349 967007", "20\n274039 899325 798709 157662 963297 276599 529230 80095 252956 980560 358150 82383 29856 901568 123794 275349 512273 508369 120076 1... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 61 | codeforces | |
6591fe9909df35ca605beeb5672d0d91 | Symmetric and Transitive | Little Johnny has recently learned about set theory. Now he is studying binary relations. You've probably heard the term "equivalence relation". These relations are very important in many areas of mathematics. For example, the equality of the two numbers is an equivalence relation.
A set ρ of pairs (*a*,<=*b*) of elem... | {"inputs": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "42", "2000", "4000", "2345", "2500", "2780", "2999", "3000", "20", "76", "133", "345", "555", "666", "777", "999", "1234", "1730", "3333", "3555", "3789", "3999"], "outputs": ["1", "3", "10", "37", "151", "674", "3263", "17007", "94828", "562595", "7381865... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
65a515ded91844bec4018832113063e5 | Video Cards | Little Vlad is fond of popular computer game Bota-2. Recently, the developers announced the new add-on named Bota-3. Of course, Vlad immediately bought only to find out his computer is too old for the new game and needs to be updated.
There are *n* video cards in the shop, the power of the *i*-th video card is equal t... | {"inputs": ["4\n3 2 15 9", "4\n8 2 2 7", "1\n1", "1\n123819", "10\n9 6 8 5 5 2 8 9 2 2", "100\n17 23 71 25 50 71 85 46 78 72 89 26 23 70 40 59 23 43 86 81 70 89 92 98 85 88 16 10 26 91 61 58 23 13 75 39 48 15 73 79 59 29 48 32 45 44 25 37 58 54 45 67 27 77 20 64 95 41 80 53 69 24 38 97 59 94 50 88 92 47 95 31 66 48 48 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
65e7b8d199c55a9034c457643be6e021 | Help Kingdom of Far Far Away 2 | For some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more easily readable format. However, as time went by, the economy of the Far Far Away developed and the scale of operatio... | {"inputs": ["2012", "0.000", "-0.00987654321", "-12345678.9", "0.99999999999999999999", "-999999999.9999999999", "4.30", "-3136", "47.849", "0", "-1", "5.3944", "-359789", "-999999", "50117.75", "-2717.859", "446900763", "-92.04295", "1000000000", "-4097961.5", "-83348637.91", "741968647.01", "8590210736.2", "-33732263... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 55 | codeforces | |
65f128e7e76e33b5ae2e810771d106aa | Alice, Bob, Two Teams | Alice and Bob are playing a game. The game involves splitting up game pieces into two teams. There are *n* pieces, and the *i*-th piece has a strength *p**i*.
The way to split up game pieces is split into several steps:
1. First, Alice will split the pieces into two different groups *A* and *B*. This can be seen as ... | {"inputs": ["5\n1 2 3 4 5\nABABA", "5\n1 2 3 4 5\nAAAAA", "1\n1\nB", "10\n1 9 7 6 2 4 7 8 1 3\nABBABAABBB", "100\n591 417 888 251 792 847 685 3 182 461 102 348 555 956 771 901 712 878 580 631 342 333 285 899 525 725 537 718 929 653 84 788 104 355 624 803 253 853 201 995 536 184 65 205 540 652 549 777 248 405 677 950 43... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 68 | codeforces | |
6647d15d8b35c41ac84591549e47957e | Guess the Tree | Iahub and Iahubina went to a picnic in a forest full of trees. Less than 5 minutes passed before Iahub remembered of trees from programming. Moreover, he invented a new problem and Iahubina has to solve it, otherwise Iahub won't give her the food.
Iahub asks Iahubina: can you build a rooted tree, such that
- each i... | {"inputs": ["4\n1 1 1 4", "5\n1 1 5 2 1", "13\n1 1 1 1 1 1 1 1 1 4 4 4 13", "4\n1 1 1 3", "24\n1 1 1 1 1 1 1 1 1 1 1 1 24 1 1 1 1 1 1 1 1 1 1 1", "24\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24", "10\n1 1 1 1 7 1 1 1 4 10", "24\n1 1 3 1 1 10 2 9 13 1 8 1 4 1 3 24 1 1 1 1 4 1 3 1", "24\n2 3 20 1 4 9 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
6672c1b44ded24c3820de2d7af58959a | Read Time | Mad scientist Mike does not use slow hard disks. His modification of a hard drive has not one, but *n* different heads that can read data in parallel.
When viewed from the side, Mike's hard drive is an endless array of tracks. The tracks of the array are numbered from left to right with integers, starting with 1. In t... | {"inputs": ["3 4\n2 5 6\n1 3 6 8", "3 3\n1 2 3\n1 2 3", "1 2\n165\n142 200", "1 2\n5000000000\n1 10000000000", "2 4\n3 12\n1 7 8 14", "3 3\n1 2 3\n2 3 4", "2 1\n1 10\n9", "3 19\n7 10 13\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19", "3 3\n2 3 4\n1 3 5", "10 11\n1 909090909 1818181817 2727272725 3636363633 454545454... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 4 | codeforces | |
669ea39a865cf70eb2919884abde7dbd | Capture Valerian | It's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majesty King of kings of Iran and Aniran.
Recently the Romans declared war on Persia. They dreamed to occupy Armenia. In the recent war, the Romans were badly defeated. Now their senior army general, Philip is captu... | {"inputs": ["10 2\n1", "16 R\n5", "5 R\n4", "2 2\n1111001", "12 13\nA", "6 7\n12345", "25 12\nABG", "17 10\nABACG", "18 R\nGH", "20 25\n4E32BB21D812", "15 11\n760595A635B24", "10 22\n956512026633000", "5 9\n1102101401441324123301", "23 4\nDL5K6H78CAH", "18 R\n36E", "13 2\n1B579528314B30", "8 13\n20043013541570572", "19... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
66a7f66baf08ce934bace8df2aaf42ee | Convenient For Everybody | In distant future on Earth day lasts for *n* hours and that's why there are *n* timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to *n* are used, i.e. there is no time "0 hours", instead of it "*n* hours" is used. When local time in the 1-st timezone is 1 ... | {"inputs": ["3\n1 2 3\n1 3", "5\n1 2 3 4 1\n1 3", "2\n5072 8422\n1 2", "10\n7171 2280 6982 9126 9490 2598 569 6744 5754 1855\n7 9", "10\n5827 8450 8288 5592 6627 8234 3557 7568 4607 6949\n2 10", "50\n2847 339 1433 128 5933 4805 4277 5697 2574 9638 6992 5045 2254 7675 7503 3802 4012 1388 5307 3652 4764 214 9507 1832 118... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
66b208b49de57d1fc0d9b8aaf388e993 | Mishka and Game | Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game.
Rules of the game are very simple: at first number of rounds *n* is defined.... | {"inputs": ["3\n3 5\n2 1\n4 2", "2\n6 1\n1 6", "3\n1 5\n3 3\n2 2", "6\n4 1\n4 2\n5 3\n5 1\n5 3\n4 1", "8\n2 4\n1 4\n1 5\n2 6\n2 5\n2 5\n2 4\n2 5", "8\n4 1\n2 6\n4 2\n2 5\n5 2\n3 5\n5 2\n1 5", "9\n2 1\n2 1\n2 1\n2 1\n2 1\n1 6\n2 1\n2 1\n1 3", "9\n2 1\n2 1\n2 1\n2 1\n2 1\n1 6\n1 6\n1 6\n1 6", "9\n1 2\n1 2\n1 2\n1 2\n1 2\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 584 | codeforces | |
66cf8d18e9b93800181475f578cb87e7 | Chord | Vasya studies music.
He has learned lots of interesting stuff. For example, he knows that there are 12 notes: C, C#, D, D#, E, F, F#, G, G#, A, B, H. He also knows that the notes are repeated cyclically: after H goes C again, and before C stands H. We will consider the C note in the row's beginning and the C note aft... | {"inputs": ["C E G", "C# B F", "A B H", "G H E", "D# B G", "D# B F#", "F H E", "B F# G", "F# H C", "C# F C", "G# C# E", "D# H G#", "C F A", "H E G#", "G D# B", "E C G", "G# C# F", "D# C G#", "C# F B", "D# C G", "A D F", "F# H D", "D A F", "D A F#", "C# B F", "A C F", "D F# H", "H G# D#", "A D F#", "H E G#", "D# B F#", ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 67 | codeforces | |
66de36ca55f972fc8a934ebd5e9c909e | Least Cost Bracket Sequence | This is yet another problem on regular bracket sequences.
A bracket sequence is called regular, if by inserting "+" and "1" into it we get a correct mathematical expression. For example, sequences "(())()", "()" and "(()(()))" are regular, while ")(", "(()" and "(()))(" are not. You have a pattern of a bracket sequenc... | {"inputs": ["(??)\n1 2\n2 8", "??\n1 1\n1 1", "(???\n1 1\n1 1\n1 1", "(??)\n2 1\n1 1", "(???)?\n3 3\n3 1\n3 3\n2 3", "((????\n3 2\n3 2\n1 1\n2 3", "???())\n2 4\n3 3\n4 1", "((????\n3 5\n4 1\n2 2\n1 5", "?(?)(???\n2 3\n2 2\n3 2\n3 1\n3 1", "(??????)\n1 1\n3 3\n3 3\n3 2\n1 3\n3 3", "?????)??\n2 3\n2 1\n1 3\n5 1\n3 3\n1 3... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 9 | codeforces | |
6723baca5db7b202f4866cca6b94ad57 | Cubes | Let's imagine that you're playing the following simple computer game. The screen displays *n* lined-up cubes. Each cube is painted one of *m* colors. You are allowed to delete not more than *k* cubes (that do not necessarily go one after another). After that, the remaining cubes join together (so that the gaps are clos... | {"inputs": ["10 3 2\n1 2 1 1 3 2 1 1 2 2", "10 2 2\n1 2 1 2 1 1 2 1 1 2", "3 1 2\n1 1 1", "10 2 2\n1 1 1 2 1 2 1 2 1 1", "1 1 0\n1", "20 3 5\n2 2 3 1 2 2 3 3 3 2 1 2 3 1 1 3 3 3 2 3", "20 2 5\n2 2 1 2 1 2 1 2 1 1 2 1 2 2 1 2 2 1 2 1", "20 6 3\n4 1 2 6 3 3 2 5 2 5 2 1 1 4 1 2 2 1 1 4", "30 5 8\n1 4 1 5 3 4 4 1 1 4 1 3 5... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces | |
672869e84817a94bff50a4be90966cd2 | Continued Fractions | A continued fraction of height *n* is a fraction of form . You are given two rational numbers, one is represented as and the other one is represented as a finite fraction of height *n*. Check if they are equal.
The first line contains two space-separated integers *p*,<=*q* (1<=≤<=*q*<=≤<=*p*<=≤<=1018) — the numerator ... | {"inputs": ["9 4\n2\n2 4", "9 4\n3\n2 3 1", "9 4\n3\n1 2 4", "39088169 24157817\n36\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 2", "39088169 24157817\n36\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 4", "61305790721611591 37889062373143906\n80\n1 1 1 1 1 1 1 1 1 1 1... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 65 | codeforces | |
67347f3321f7532c4e1985451bfacafe | Boredom | Alex 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.
Given a sequence *a* consisting of *n* integers. The player can make several steps. In a single step he can choose an element of the sequence (let's denote it *a*... | {"inputs": ["2\n1 2", "3\n1 2 3", "9\n1 2 1 3 2 2 2 2 3", "5\n3 3 4 5 4", "5\n5 3 5 3 4", "5\n4 2 3 2 5", "10\n10 5 8 9 5 6 8 7 2 8", "10\n1 1 1 1 1 1 2 3 4 4", "100\n6 6 8 9 7 9 6 9 5 7 7 4 5 3 9 1 10 3 4 5 8 9 6 5 6 4 10 9 1 4 1 7 1 4 9 10 8 2 9 9 10 5 8 9 5 6 8 7 2 8 7 6 2 6 10 8 6 2 5 5 3 2 8 8 5 3 6 2 1 4 7 2 7 3 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 359 | codeforces | |
6735696886855248ebfe10fd886b0fa1 | Draw Brackets! | A sequence of square brackets is regular if by inserting symbols "+" and "1" into it, you can get a regular mathematical expression from it. For example, sequences "[[]][]", "[]" and "[[][[]]]" — are regular, at the same time "][", "[[]" and "[[]]][" — are irregular.
Draw the given sequence using a minimalistic pseud... | {"inputs": ["8\n[[][]][]", "6\n[[[]]]", "6\n[[][]]", "2\n[]", "4\n[][]", "4\n[[]]", "6\n[][][]", "6\n[][[]]", "6\n[[]][]", "100\n[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]", "100\n[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 3 | codeforces | |
673feee697cb87c2999a30d43e4b7045 | Naming Company | Oleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Recently, they started a new company, but they are having trouble finding a name for the company.
To settle this problem, they've decided to play a game. The company name will consist of *n* letters. Oleg and Igor ... | {"inputs": ["tinkoff\nzscoder", "xxxxxx\nxxxxxx", "ioi\nimo", "abc\naaa", "reddit\nabcdef", "cbxz\naaaa", "bcdef\nabbbc", "z\ny", "y\nz"], "outputs": ["fzfsirk", "xxxxxx", "ioi", "aab", "dfdeed", "abac", "bccdb", "z", "y"]} | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 15 | codeforces | |
6747cd9adcb28234b54adeac8c2d3729 | Corporation Mail | The Beroil corporation structure is hierarchical, that is it can be represented as a tree. Let's examine the presentation of this structure as follows:
- *employee* ::= *name*. | *name*:*employee*1,*employee*2, ... ,*employee**k*. - *name* ::= name of an employee
That is, the description of each employee consists o... | {"inputs": ["A:A..", "CK:CK.,CK.,CK..", "RHLGWEVBJ:KAWUINWEI:KAWUINWEI..,ZQATMW.,KAWUINWEI.,RSWN..", "GIRRY.", "XGB:QJNGARRAZV:DWGDCCU:ARDKJV:P:MXBLZKLPYI:FKSBDQVXH:FKSBDQVXH:MXBLZKLPYI..,DWGDCCU..,P...,FKSBDQVXH....,ARDKJV..", "BZSBQVEUZK:GW:IJXBZZR:Q:TTTUZKB:IJXBZZR..,KPMRUKBRJ.,DJJTU..,DJJTU..,SFMVKQPXS.,TTTUZKB:AE.... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 8 | codeforces | |
674b04517890642f598b058b223c1c1c | A Problem about Polyline | There is a polyline going through points (0,<=0)<=–<=(*x*,<=*x*)<=–<=(2*x*,<=0)<=–<=(3*x*,<=*x*)<=–<=(4*x*,<=0)<=–<=...<=-<=(2*kx*,<=0)<=–<=(2*kx*<=+<=*x*,<=*x*)<=–<=....
We know that the polyline passes through the point (*a*,<=*b*). Find minimum positive value *x* such that it is true or determine that there is no ... | {"inputs": ["3 1", "1 3", "4 1", "1000000000 1000000000", "1000000000 1", "991691248 43166756", "973970808 679365826", "404878182 80324806", "405262931 391908625", "758323881 37209930", "405647680 36668977", "750322953 61458580", "406032429 31993512", "1000000000 111111111", "999999999 111111111", "999999998 111111111"... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 31 | codeforces | |
6757acaebc046655e71b78e491135cbb | Olympiad | A boy named Vasya has taken part in an Olympiad. His teacher knows that in total Vasya got at least *x* points for both tours of the Olympiad. The teacher has the results of the first and the second tour of the Olympiad but the problem is, the results have only points, no names. The teacher has to know Vasya's chances.... | {"inputs": ["5 2\n1 1 1 1 1\n1 1 1 1 1", "6 7\n4 3 5 6 4 4\n8 6 0 4 3 4", "1 100\n56\n44", "5 1\n1 2 3 4 5\n1 2 3 4 5", "5 5\n2 2 2 2 2\n3 3 3 3 3", "4 100\n98 98 99 100\n1 1 2 2", "5 45\n1 2 3 4 5\n10 20 30 40 50", "10 5\n3 1 1 2 1 3 1 1 2 3\n2 1 3 2 1 3 3 3 3 1", "10 0\n3 3 1 1 1 2 3 0 0 3\n1 3 0 1 2 0 3 3 0 0", "10 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 3 | codeforces | |
6758ce3610d53f6a3784f8efd8e06410 | Qualifying Contest | Very soon Berland will hold a School Team Programming Olympiad. From each of the *m* Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and it was attended by *n* Berland students. There were at least two schoolboys participating from each of th... | {"inputs": ["5 2\nIvanov 1 763\nAndreev 2 800\nPetrov 1 595\nSidorov 1 790\nSemenov 2 503", "5 2\nIvanov 1 800\nAndreev 2 763\nPetrov 1 800\nSidorov 1 800\nSemenov 2 503", "10 2\nSHiBIEz 2 628\nXxwaAxB 1 190\nXwR 2 290\nRKjOf 2 551\nTUP 1 333\nFarsFvyH 1 208\nCGDYnq 1 482\nqaM 2 267\nVfiLunRz 1 416\nuVMHLk 2 754", "10 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 17 | codeforces | |
675f42df09900c5ecbac9bbbc4961e7a | Merge Sort | Merge sort is a well-known sorting algorithm. The main function that sorts the elements of array *a* with indices from [*l*,<=*r*) can be implemented as follows:
1. If the segment [*l*,<=*r*) is already sorted in non-descending order (that is, for any *i* such that *l*<=≤<=*i*<=<<=*r*<=-<=1 *a*[*i*]<=≤<=*a*[*i*<=+... | {"inputs": ["3 3", "4 1", "5 6", "100 100", "10000 10001", "10000 20001", "10000 30001", "20000 10001", "20000 20001", "20000 30001", "30000 10001", "30000 20001", "30000 30001", "40000 10001", "40000 20001", "40000 30001", "50000 10001", "50000 20001", "50000 30001", "60000 10001", "60000 20001", "60000 30001", "70000... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 40 | codeforces | |
676d7d8ba8d2e382fd2b536381577b77 | Almost Prime | A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and *n*, inclusive.
Input contains one integer number *n* (1<=≤<=*n*<=≤<=3000).
Output the amount of almo... | {"inputs": ["10", "21", "1", "2", "4", "3", "8", "19", "40", "77", "222", "987", "1000", "2000", "3000", "2999", "2998", "2997", "1429", "1673", "1500", "500", "856"], "outputs": ["2", "8", "0", "0", "0", "0", "1", "6", "19", "41", "125", "501", "508", "958", "1375", "1375", "1375", "1374", "706", "808", "732", "266", ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 586 | codeforces | |
6770639456b30696194d24f4aff1cfe0 | Board Game | Polycarp and Vasiliy love simple logical games. Today they play a game with infinite chessboard and one pawn for each player. Polycarp and Vasiliy move in turns, Polycarp starts. In each turn Polycarp can move his pawn from cell (*x*,<=*y*) to (*x*<=-<=1,<=*y*) or (*x*,<=*y*<=-<=1). Vasiliy can move his pawn from (*x*,... | {"inputs": ["2 1 2 2", "4 7 7 4", "20 0 7 22", "80 100 83 97", "80 100 77 103", "55000 60000 55003 60100", "100000 100000 100000 99999", "100000 99999 100000 100000", "0 100000 100000 99999", "0 100000 99999 100000", "0 90000 89999 89999", "0 1 0 2", "0 1 1 0", "0 1 1 1", "0 1 1 2", "0 1 2 0", "0 1 2 1", "0 1 2 2", "0 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 13 | codeforces | |
6770d28df371e4b6ceb7802e0142726f | Grasshopper And the String | One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on vowels of the English alphabet. Jump ability is the maximum possible length of ... | {"inputs": ["ABABBBACFEYUKOTT", "AAA", "A", "B", "AEYUIOAEIYAEOUIYOEIUYEAOIUEOEAYOEIUYAEOUIYEOIKLMJNHGTRWSDZXCVBNMHGFDSXVWRTPPPLKMNBXIUOIUOIUOIUOOIU", "AEYUIOAEIYAEOUIYOEIUYEAOIUEOEAYOEIUYAEOUIYEOIAEYUIOAEIYAEOUIYOEIUYEAOIUEOEAYOEIUYAEOUIYEOI", "KMLPTGFHNBVCDRFGHNMBVXWSQFDCVBNHTJKLPMNFVCKMLPTGFHNBVCDRFGHNMBVXWSQFDCVBNH... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 203 | codeforces | |
6779a84accbc036b36a7f8384cba5fae | Game on Paper | One not particularly beautiful evening Valera got very bored. To amuse himself a little bit, he found the following game.
He took a checkered white square piece of paper, consisting of *n*<=×<=*n* cells. After that, he started to paint the white cells black one after the other. In total he painted *m* different cells ... | {"inputs": ["4 11\n1 1\n1 2\n1 3\n2 2\n2 3\n1 4\n2 4\n3 4\n3 2\n3 3\n4 1", "4 12\n1 1\n1 2\n1 3\n2 2\n2 3\n1 4\n2 4\n3 4\n3 2\n4 2\n4 1\n3 1", "3 1\n1 3", "3 8\n1 3\n3 3\n2 2\n3 2\n1 1\n1 2\n2 3\n3 1", "3 9\n2 3\n1 3\n3 1\n1 1\n3 3\n2 1\n2 2\n1 2\n3 2", "4 16\n1 3\n4 4\n4 1\n2 3\n3 1\n3 2\n1 4\n2 2\n1 2\n3 3\n2 1\n1 1\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 14 | codeforces | |
67881ae428f6a4036f08f27aa010df48 | Appleman and Card Game | Appleman has *n* cards. Each card has an uppercase letter written on it. Toastman must choose *k* cards from Appleman's cards. Then Appleman should give Toastman some coins depending on the chosen cards. Formally, for each Toastman's card *i* you should calculate how much Toastman's cards have the letter equal to lette... | {"inputs": ["15 10\nDZFDFZDFDDDDDDF", "6 4\nYJSNPI", "5 3\nAOWBY", "1 1\nV", "2 1\nWT", "2 2\nBL", "5 1\nFACJT", "5 5\nMJDIJ", "15 5\nAZBIPTOFTJCJJIK", "100 1\nEVEEVEEEGGECFEHEFVFVFHVHEEEEEFCVEEEEEEVFVEEVEEHEEVEFEVVEFEEEFEVECEHGHEEFGEEVCEECCECEFHEVEEEEEEGEEHVH", "100 15\nKKTFFUTFCKUIKKKKFIFFKTUKUUKUKKIKKKTIFKTKUCFFKKKI... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 292 | codeforces | |
67adc0bad471876d638897386ff0ab58 | Obsession with Robots | The whole world got obsessed with robots,and to keep pace with the progress, great Berland's programmer Draude decided to build his own robot. He was working hard at the robot. He taught it to walk the shortest path from one point to another, to record all its movements, but like in many Draude's programs, there was a ... | {"inputs": ["LLUUUR", "RRUULLDD", "L", "R", "R", "RR", "DL", "LD", "RUL", "ULD", "DDR", "RRDD", "RRLR", "RRDL", "LRUD", "RDRLL", "DRDRD", "ULURL", "LUUDU", "RDLUR", "DLDLDDRR", "RDRDDD", "UULLDLUR", "LULU", "LLDDLDLLDDDLLLDLLLLLUU", "LLDDLDLLDDDLLLDLLLLLUU", "LLDDLDLLDDDLLLDLLLLLUU", "URRRRRURRURUURRRRRDDDDLDDDRDDDDLLD... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 48 | codeforces | |
67b8c70d7eeee85ba2167799826eef08 | Fafa and his Company | Fafa owns a company that works on huge projects. There are *n* employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project among all the employees.
Fafa finds doing this every time is very tiring for him. So, he decided to choose the best *l* em... | {"inputs": ["2", "10", "3", "4", "6", "13", "100000", "1024", "99999", "10007", "4096", "65536", "40320", "30030", "161", "1000", "10000", "777", "121", "25", "40000", "99990", "98765", "56789", "13579", "97531", "12345", "54321", "83160", "9", "21", "11", "15"], "outputs": ["1", "3", "1", "2", "3", "1", "35", "10", "1... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 649 | codeforces | |
67c7db44ad516d4d9637eea2d9ffa9ef | Cards | Catherine has a deck of *n* cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions:
- take any two (not necessarily adjacent) cards with different colors and exchange them for a new card of the third color; - take any two (not necessarily adja... | {"inputs": ["2\nRB", "3\nGRG", "5\nBBBBB", "1\nR", "200\nBBRGRRBBRGGGBGBGBGRRGRGRGRBGRGRRBBGRGBGRRGRRRGGBBRGBGBGBRBBBBBBBGGBRGGRRRGGRGBGBGGBRRRRBRRRBRBBGGBGBRGRGBBBBGGBGBBBGBGRRBRRRGBGGBBBRBGRBRRGGGRRGBBBGBGRRRRRRGGRGRGBBBRGGGBGGGBRBBRRGBGRGRBRRRBRBGRGGBRBB", "101\nRRRRRRRRRRRRRRRRRRRBRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 62 | codeforces | |
67d44d56308d1ed231216c9f73dde7c5 | Dima and Text Messages | Seryozha has a very changeable character. This time he refused to leave the room to Dima and his girlfriend (her hame is Inna, by the way). However, the two lovebirds can always find a way to communicate. Today they are writing text messages to each other.
Dima and Inna are using a secret code in their text messages. ... | {"inputs": ["3\ni\nlove\nyou\n<3i<3love<23you<3", "7\ni\nam\nnot\nmain\nin\nthe\nfamily\n<3i<>3am<3the<3<main<3in<3the<3><3family<3", "3\ni\nlove\nyou\n<3i<3lo<3ve<3y<<<<<<<ou3<3", "4\na\nb\nc\nd\n<3a<3b<3c<3d", "4\na\nb\nc\nd\na<3b<3c<3d<3", "3\ni\nlove\nyou\n<3i<3love<3you<3", "1\na\na", "1\na\n<3a<3b", "1\naa\n<3a<3... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 34 | codeforces | |
6811358b57ceb6396694af8cc77a194d | Buttons | Manao is trying to open a rather challenging lock. The lock has *n* buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either stays pressed into the lock (that means that you've guessed correctly and pushed the button that goes next in the seque... | {"inputs": ["2", "3", "4", "1", "10", "2000", "1747", "889", "1999", "914", "996", "17", "50", "91", "92", "256", "512", "666", "667", "314", "1241", "1500", "1837", "1000"], "outputs": ["3", "7", "14", "1", "175", "1333335000", "888644743", "117099969", "1331335999", "127259419", "164675486", "833", "20875", "125671",... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 130 | codeforces | |
6817ec8c524a6cdd6f48f850c1a03b5b | Modular Equations | Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define *i* modulo *j* as the remainder of division of *i* by *j* and denote it by . A Modular Equation, as Hamed's teacher described, is an equation of the form in which *a* and *b* are two non-negative integers and... | {"inputs": ["21 5", "9435152 272", "10 10", "0 1000000000", "11 2", "1 0", "0 0", "121 0", "772930485 686893955", "257424 24", "295138437 589952171", "223093836 966", "233758336 10665466", "223092887 17", "223094728 1858", "223092899 29", "997920 0", "887043 3", "124 24", "982901 101", "357987 35", "954374 1030", "4910... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 89 | codeforces | |
683c27dac16cdfe6eaa07b2cd1c495d6 | GukiZ hates Boxes | Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way.
In total there are *n* piles of boxes, arranged in a line, from left to right, *i*-th pile (1<=≤<=*i*<=≤<=*n*) containing *a**i* boxes. Luckily, *m* students are willing to help GukiZ by removing all the ... | {"inputs": ["2 1\n1 1", "3 2\n1 0 2", "4 100\n3 4 5 4", "5 8\n121351 0 13513 0 165454", "6 6\n0 10 0 0 10 0", "1 1\n1", "1 100000\n1", "1 100000\n1000000000", "1 1\n1000000000", "20 20\n0 0 0 0 0 0 154 0 0 0 0 0 0 0 0 0 0 0 0 0", "10 10\n0 0 0 100 0 0 0 0 0 0", "15 20\n0 0 0 500 0 0 0 0 400 0 0 0 0 0 0", "5 3\n0 0 14 0... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 4 | codeforces | |
685766372374c5357654ecb9e8d5a092 | Fight Against Traffic | Little town Nsk consists of *n* junctions connected by *m* bidirectional roads. Each road connects two distinct junctions and no two roads connect the same pair of junctions. It is possible to get from any junction to any other junction by these roads. The distance between two junctions is equal to the minimum possible... | {"inputs": ["5 4 1 5\n1 2\n2 3\n3 4\n4 5", "5 4 3 5\n1 2\n2 3\n3 4\n4 5", "5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n2 5", "2 1 2 1\n1 2", "3 2 2 3\n1 2\n2 3", "3 2 1 3\n1 2\n2 3", "3 3 2 3\n1 2\n2 3\n1 3"], "outputs": ["0", "5", "3", "0", "1", "0", "0"]} | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 19 | codeforces | |
685a6673a4ee325db24fee9ffee225da | Ghd | John Doe offered his sister Jane Doe find the gcd of some set of numbers *a*.
Gcd is a positive integer *g*, such that all number from the set are evenly divisible by *g* and there isn't such *g*' (*g*'<=><=*g*), that all numbers of the set are evenly divisible by *g*'.
Unfortunately Jane couldn't cope with the ta... | {"inputs": ["6\n6 2 3 4 5 6", "5\n5 5 6 10 15", "100\n32 40 7 3 7560 21 7560 7560 10 12 3 7560 7560 7560 7560 5 7560 7560 6 7560 7560 7560 35 7560 18 7560 7560 7560 7560 7560 48 2 7 25 7560 2 2 49 7560 7560 15 16 7560 7560 2 7560 27 7560 7560 7560 7560 3 5 7560 8 7560 42 45 5 7560 5 7560 4 7 3 7560 7 3 7560 7 2 7560 75... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
685f668a8903dff2f2a9f3a5dcc24c21 | Nuclear Fusion | There is the following puzzle popular among nuclear physicists.
A reactor contains a set of *n* atoms of some chemical elements. We shall understand the phrase "atomic number" as the number of this atom's element in the periodic table of the chemical elements.
You are allowed to take any two different atoms and fuse ... | {"inputs": ["10 3\nMn Co Li Mg C P F Zn Sc K\nSn Pt Y", "2 1\nH H\nHe", "2 2\nBk Fm\nCf Es", "8 8\nTl Pb Bi Po Np Pu Am Cm\nAt Rn Fr Ra Ac Th Pa U", "4 2\nZr Nb Sr Zr\nHg Au", "8 1\nBe B N O Ne Na Al Si\nHf", "7 3\nH He Be O S Ge Gd\nIr Cr Fe", "6 3\nCl Ni Ti V Ar Cu\nRh Br La", "5 5\nOs Lu Ta Re W\nW Ta Re Os Lu", "8 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
6860f3118664ad3c940eaa801d33763f | Minimum and Maximum | This is an interactive problem. You have to use flush operation right after printing each line. For example, in C++ you should use function fflush(stdout), in Java — System.out.flush(), in Pascal — flush(output) and in Python — sys.stdout.flush().
In this problem, you need to find maximal and minimal elements of an ar... | {"inputs": ["2\n2\n2 1\n3\n1 1 1", "1\n4\n1 1 2 2", "2\n5\n1 1 2 1 1\n3\n3 2 1", "2\n6\n2 1 2 1 2 2\n3\n2 2 1", "2\n4\n2 3 3 3\n5\n4 4 4 3 2", "1\n10\n1 2 1 2 1 3 1 3 1 2", "1\n1\n1", "2\n2\n1 2\n2\n2 1", "6\n3\n1 2 3\n3\n1 3 2\n3\n2 1 3\n3\n2 3 1\n3\n3 1 2\n3\n3 2 1", "24\n4\n1 2 3 4\n4\n1 2 4 3\n4\n1 3 2 4\n4\n1 3 4 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 5 | codeforces | |
6898b78f6da5c9b53c37dff69497cf71 | none | Stepan had a favorite string *s* which consisted of the lowercase letters of the Latin alphabet.
After graduation, he decided to remember it, but it was a long time ago, so he can't now remember it. But Stepan remembers some information about the string, namely the sequence of integers *c*1,<=*c*2,<=...,<=*c**n*, whe... | {"inputs": ["6\n6 3 1 0 0 0", "4\n4 0 0 0", "1\n1", "5\n5 0 0 0 0", "10\n10 8 7 6 5 4 3 2 1 0", "20\n20 16 12 8 5 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0", "99\n99 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 11 | codeforces | |
689adc88f3b1fbc872a2e559e8d4e224 | Put Knight! | Petya and Gena play a very interesting game "Put a Knight!" on a chessboard *n*<=×<=*n* in size. In this game they take turns to put chess pieces called "knights" on the board so that no two knights could threat each other. A knight located in square (*r*,<=*c*) can threat squares (*r*<=-<=1,<=*c*<=+<=2), (*r*<=-<=1,<=... | {"inputs": ["2\n2\n1", "10\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10", "15\n10\n4\n7\n8\n9\n6\n2\n1\n3\n1\n5\n2\n3\n4\n5", "6\n10\n7\n10\n8\n5\n1", "100\n5\n6\n8\n7\n5\n7\n10\n2\n8\n3\n10\n3\n7\n3\n2\n7\n10\n3\n7\n3\n9\n5\n1\n1\n1\n5\n7\n5\n4\n8\n7\n3\n2\n10\n5\n10\n1\n10\n5\n2\n10\n6\n4\n10\n7\n6\n10\n8\n8\n5\n5\n7\n5\n7\n8\n6\n... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 25 | codeforces | |
68acf953f608b461ee64ff436ef99467 | Roads not only in Berland | Berland Government decided to improve relations with neighboring countries. First of all, it was decided to build new roads so that from each city of Berland and neighboring countries it became possible to reach all the others. There are *n* cities in Berland and neighboring countries in total and exactly *n*<=-<=1 two... | {"inputs": ["2\n1 2", "7\n1 2\n2 3\n3 1\n4 5\n5 6\n6 7", "3\n3 2\n1 2", "3\n3 1\n3 2", "4\n1 4\n3 1\n3 4", "5\n4 1\n4 3\n5 3\n2 4", "6\n5 2\n5 3\n1 4\n3 1\n5 6", "10\n5 9\n8 5\n7 6\n7 9\n3 9\n2 1\n7 2\n3 6\n7 1", "21\n7 15\n13 1\n14 3\n4 10\n2 3\n16 18\n17 20\n16 20\n8 4\n3 12\n2 17\n13 11\n16 1\n13 2\n13 5\n8 9\n6 14\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 50 | codeforces | |
68c4515d74411c8dc12e75c9f23458ad | Edge coloring of bipartite graph | You are given an undirected bipartite graph without multiple edges. You should paint the edges of graph to minimal number of colours, so that no two adjacent edges have the same colour.
The first line contains three integers *a*,<=*b*,<=*m* (1<=≤<=*a*,<=*b*<=≤<=1000, 0<=≤<=*m*<=≤<=105), *a* is the size of the first par... | {"inputs": ["4 3 5\n1 2\n2 2\n3 2\n4 1\n4 3", "4 3 5\n1 2\n2 2\n3 2\n4 1\n4 3", "4 3 0", "10 10 67\n1 1\n1 2\n1 3\n1 7\n1 9\n1 10\n2 1\n2 2\n2 3\n2 6\n2 8\n2 10\n3 2\n3 3\n3 6\n3 8\n3 9\n3 10\n4 1\n4 4\n4 5\n4 6\n4 7\n4 8\n5 2\n5 4\n5 7\n5 8\n5 9\n5 10\n6 1\n6 2\n6 3\n6 4\n6 6\n6 8\n6 9\n6 10\n7 2\n7 4\n7 6\n7 9\n7 10\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 3 | codeforces | |
68c89b5c6d3ad091555738ff9b320b01 | Urbanization | Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization. There are *n* people who plan to move to the cities. The wealth of the *i* of them is equal to *a**i*. Authorities plan to build two cities, first for *n*1 people and second ... | {"inputs": ["2 1 1\n1 5", "4 2 1\n1 4 2 3", "3 1 2\n1 2 3", "10 4 6\n3 5 7 9 12 25 67 69 83 96", "19 7 12\n1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 100000 100000", "100 9 6\n109 711 40 95 935 48 228 253 308 726 816 534 252 8 966 363 162 508 84 83 807 506 748 178 45 30 106 108 764 698 825 198 3... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 110 | codeforces | |
68d01f12124a47d6571ff3bdf392dfee | I'm bored with life | Holidays 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 for the period of university studies. Consequently Noora had to leave Vičkopolis and move to Pavlopo... | {"inputs": ["4 3", "10 399603090", "6 973151934", "2 841668075", "7 415216919", "3 283733059", "11 562314608", "3 990639260", "11 859155400", "1 1", "5 3", "1 4", "5 4", "1 12", "9 7", "2 3", "6 11", "6 7", "11 11", "4 999832660", "7 999228288", "11 999257105", "11 999286606", "3 999279109", "999632727 11", "999625230 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 580 | codeforces | |
68d1584556ca86c9b30666956022b06f | Transmigration | In Disgaea as in most role-playing games, characters have skills that determine the character's ability to use certain weapons or spells. If the character does not have the necessary skill, he cannot use it. The skill level is represented as an integer that increases when you use this skill. Different character classes... | {"inputs": ["5 4 0.75\naxe 350\nimpaler 300\nionize 80\nmegafire 120\nmagicboost 220\nheal\nmegafire\nshield\nmagicboost", "1 1 0.50\nstaff 1005\nionize", "4 3 0.32\ninrf 48\nfdgdf 200\nvbkdfk 450\nfdbvfdd 1000\ndff\ninrf\nnfdkd", "5 1 0.99\na 1\nb 2\nc 3\nd 4\ne 5\nf", "2 2 0.02\nfn 1003\nzz 7000\nkk\nau", "3 3 0.10\n... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 8 | codeforces | |
68f881cb48278b79a28b227309589ed8 | Generating Sets | You are given a set *Y* of *n* distinct positive integers *y*1,<=*y*2,<=...,<=*y**n*.
Set *X* of *n* distinct positive integers *x*1,<=*x*2,<=...,<=*x**n* is said to generate set *Y* if one can transform *X* to *Y* by applying some number of the following two operation to integers in *X*:
1. Take any integer *x**i* ... | {"inputs": ["5\n1 2 3 4 5", "6\n15 14 3 13 1 12", "6\n9 7 13 17 5 11", "10\n18 14 19 17 11 7 20 10 4 12", "100\n713 716 230 416 3 2 597 216 779 839 13 156 723 793 168 368 232 316 98 257 170 27 746 9 616 147 792 890 796 362 852 117 993 556 885 73 131 475 121 753 508 158 473 931 527 282 541 325 606 321 159 17 682 290 586... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 8 | codeforces | |
68fad3ac9deae97955c6f83d645d9847 | Divisibility Rules | Vasya studies divisibility rules at school. Here are some of them:
- Divisibility by 2. A number is divisible by 2 if and only if its last digit is divisible by 2 or in other words, is even.- Divisibility by 3. A number is divisible by 3 if and only if the sum of its digits is divisible by 3.- Divisibility by 4. A n... | {"inputs": ["10 10", "2 3", "2 2", "2 3", "2 4", "2 5", "2 6", "2 7", "2 8", "3 2", "3 3", "3 4", "3 5", "3 6", "3 7", "3 8", "4 2", "4 3", "4 4", "4 5", "4 6", "4 7", "4 8", "5 2", "5 3", "5 4", "5 5", "5 6", "5 7", "5 8", "6 2", "6 3", "6 4", "6 5", "6 6", "6 7", "6 8", "7 2", "7 3", "7 4", "7 5", "7 6", "7 7", "7 8"... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
692e674495305d943f08aa56e354992d | Third Month Insanity | The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2*N* teams participating in the tournament, numbered from 1 to 2*N*. The tournament lasts *N* rounds, with each round eliminating half the teams. The first round consists of... | {"inputs": ["2\n0 40 100 100\n60 0 40 40\n0 60 0 45\n0 60 55 0", "3\n0 0 100 0 100 0 0 0\n100 0 100 0 0 0 100 100\n0 0 0 100 100 0 0 0\n100 100 0 0 0 0 100 100\n0 100 0 100 0 0 100 0\n100 100 100 100 100 0 0 0\n100 0 100 0 0 100 0 0\n100 0 100 0 100 100 100 0", "2\n0 21 41 26\n79 0 97 33\n59 3 0 91\n74 67 9 0", "3\n0 7... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
693ab3157cd165892ac491541b2035b8 | Array | You've got an array *a*, consisting of *n* integers: *a*1,<=*a*2,<=...,<=*a**n*. Your task is to find a minimal by inclusion segment [*l*,<=*r*] (1<=≤<=*l*<=≤<=*r*<=≤<=*n*) such, that among numbers *a**l*,<= *a**l*<=+<=1,<= ...,<= *a**r* there are exactly *k* distinct numbers.
Segment [*l*,<=*r*] (1<=≤<=*l*<=≤<=*r*<=≤... | {"inputs": ["4 2\n1 2 2 3", "8 3\n1 1 2 2 3 3 4 5", "7 4\n4 7 7 4 7 4 7", "5 1\n1 7 2 3 2", "1 2\n666", "1 1\n5", "10 4\n1 1 2 2 3 3 4 4 4 4", "4 2\n3 3 4 3", "4 3\n4 4 4 2", "10 5\n15 17 2 13 3 16 4 5 9 12", "17 13\n34 15 156 11 183 147 192 112 145 30 88 37 1 98 3 162 148", "17 14\n271 158 573 88 792 767 392 646 392 3... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 96 | codeforces | |
696c1c749977e10e2eeedbc66e7b754f | Anfisa the Monkey | Anfisa the monkey learns to type. She is yet unfamiliar with the "space" key and can only type in lower-case Latin letters. Having typed for a fairly long line, Anfisa understood that it would be great to divide what she has written into *k* lines not shorter than *a* and not longer than *b*, for the text to resemble h... | {"inputs": ["3 2 5\nabrakadabra", "4 1 2\nabrakadabra", "3 1 2\nvgnfpo", "5 3 4\nvrrdnhazvexzjfv", "10 12 15\nctxgddcfdtllmpuxsjkubuqpldznulsilueakbwwlzgeyudyrjachmitfdcgyzszoejphrubpxzpdtgexaqpxgnoxwfjoikljudnoucirussumyhetfwgaoxfbugfiyjmp", "10 20 30\nbvdqvlxiyogiyimdlwdyxsummjgqxaxsucfeuegleetybsylpnepkqzbutibtlgqrb... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 89 | codeforces | |
69769ded2ddea958b4e6622ce7fb7d10 | none | Pavel cooks barbecue. There are *n* skewers, they lay on a brazier in a row, each on one of *n* positions. Pavel wants each skewer to be cooked some time in every of *n* positions in two directions: in the one it was directed originally and in the reversed direction.
Pavel has a plan: a permutation *p* and a sequence ... | {"inputs": ["4\n4 3 2 1\n0 1 1 1", "3\n2 3 1\n0 0 0", "1\n1\n0", "2\n1 2\n0 0", "2\n2 1\n0 0", "2\n1 2\n0 1", "2\n2 1\n1 0", "2\n1 2\n1 1", "2\n2 1\n1 1", "5\n2 1 3 4 5\n1 0 0 0 1", "10\n4 10 5 1 6 8 9 2 3 7\n0 1 0 0 1 0 0 1 0 0", "20\n10 15 20 17 8 1 14 6 3 13 19 2 16 12 4 5 11 7 9 18\n0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 20 | codeforces | |
6978724378602e63542d64fd1f157f42 | Line | A line on the plane is described by an equation *Ax*<=+<=*By*<=+<=*C*<==<=0. You are to find any point on this line, whose coordinates are integer numbers from <=-<=5·1018 to 5·1018 inclusive, or to find out that such points do not exist.
The first line contains three integers *A*, *B* and *C* (<=-<=2·109<=≤<=*A*,<=*B*... | {"inputs": ["2 5 3", "0 2 3", "931480234 -1767614767 -320146190", "-1548994394 -1586527767 -1203252104", "296038088 887120955 1338330394", "1906842444 749552572 -1693767003", "-1638453107 317016895 -430897103", "-1183748658 875864960 -1315510852", "427055698 738296578 -52640953", "-1516373701 -584304312 -746376800", "2... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 29 | codeforces | |
69acc2eae81f23c8a6ec3869ee66ed2f | Archer | SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The probability of shooting the target each time is for SmallR while for Zanoes. The one who shoots in the target first should be the winner.
Output the probability that SmallR will... | {"inputs": ["1 2 1 2", "1 3 1 3", "1 3 2 3", "3 4 3 4", "1 2 10 11", "4 5 4 5", "466 701 95 721", "268 470 444 885", "632 916 713 821", "269 656 918 992", "71 657 187 695", "435 852 973 978", "518 816 243 359", "882 962 311 811", "684 774 580 736", "486 868 929 999", "132 359 996 998", "933 977 266 450", "298 833 615 8... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 353 | codeforces | |
6a1937e725b9a6aff7dc0feedc20e9f0 | Binary Number | Little walrus Fangy loves math very much. That's why when he is bored he plays with a number performing some operations.
Fangy takes some positive integer *x* and wants to get a number one from it. While *x* is not equal to 1, Fangy repeats the following action: if *x* is odd, then he adds 1 to it, otherwise he divide... | {"inputs": ["1", "1001001", "101110", "11", "11110001101", "1010101001001111000111110011111000010101011111101010", "1100000010010100111011100011110101111", "11000111111110110110100110110101111100010100110110010", "11100000110100011110101001101111100000011001111000011110000000111110111", "1000101100110000000001111010110... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 47 | codeforces | |
6a27434e92a6ae2b20c2a2389a4b2455 | Pawn | On some square in the lowest row of a chessboard a stands a pawn. It has only two variants of moving: upwards and leftwards or upwards and rightwards. The pawn can choose from which square of the lowest row it can start its journey. On each square lay from 0 to 9 peas. The pawn wants to reach the uppermost row having c... | {"inputs": ["3 3 1\n123\n456\n789", "3 3 0\n123\n456\n789", "2 2 10\n98\n75", "3 4 2\n8244\n4768\n4474", "4 3 10\n194\n707\n733\n633", "5 6 0\n564132\n152314\n382748\n956060\n261008", "2 4 2\n3916\n9593", "5 5 6\n78237\n84658\n09523\n48007\n70591", "6 6 0\n962504\n555826\n306365\n336593\n304184\n461978", "7 7 8\n917861... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 5 | codeforces | |
6a442951f918b3291f7632fa0bf0689e | Connected Components? | You are given an undirected graph consisting of *n* vertices and edges. Instead of giving you the edges that exist in the graph, we give you *m* unordered pairs (*x*,<=*y*) such that there is no edge between *x* and *y*, and if some pair of vertices is not listed in the input, then there is an edge between these verti... | {"inputs": ["5 5\n1 2\n3 4\n3 2\n4 2\n2 5", "8 15\n2 1\n4 5\n2 4\n3 4\n2 5\n3 5\n2 6\n3 6\n5 6\n4 6\n2 7\n3 8\n2 8\n3 7\n6 7", "12 58\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 10\n1 11\n1 12\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n2 11\n2 12\n3 4\n3 5\n3 6\n3 7\n3 8\n3 9\n3 10\n3 11\n3 12\n4 5\n4 6\n4 8\n4 11\n4 12\n5 6\... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 16 | codeforces | |
6a66d1afd709b4c997f0e107675265b7 | Fedya and Maths | Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:
for given value of *n*. Fedya managed to complete the task. Can you? Note that given number *n* can be extremely large (e.g. it can exceed any integer type of your programming language).
The single line contains a single int... | {"inputs": ["4", "124356983594583453458888889", "2", "7854", "584660", "464", "192329", "85447", "956", "83", "33", "64", "971836", "578487", "71752", "2563", "51494", "247", "52577", "13", "26232", "0", "10", "12", "8", "1"], "outputs": ["4", "0", "0", "0", "4", "4", "0", "0", "4", "0", "0", "4", "4", "0", "4", "0", "... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 84 | codeforces | |
6a681fb01eaba2e90830b8381036cd5d | Not Equal on a Segment | You are given array *a* with *n* integers and *m* queries. The *i*-th query is given with three integers *l**i*,<=*r**i*,<=*x**i*.
For the *i*-th query find any position *p**i* (*l**i*<=≤<=*p**i*<=≤<=*r**i*) so that *a**p**i*<=≠<=*x**i*.
The first line contains two integers *n*,<=*m* (1<=≤<=*n*,<=*m*<=≤<=2·105) — the ... | {"inputs": ["6 4\n1 2 1 1 3 5\n1 4 1\n2 6 2\n3 4 1\n3 4 2", "1 1\n1\n1 1 1", "1 1\n2\n1 1 2", "1 1\n569888\n1 1 967368", "10 10\n1 1 1 1 1 1 1 1 1 1\n3 10 1\n3 6 1\n1 8 1\n1 7 1\n1 5 1\n3 7 1\n4 7 1\n9 9 1\n6 7 1\n3 4 1", "10 10\n1 2 2 2 2 1 1 2 1 1\n3 3 1\n4 9 1\n4 8 1\n2 7 2\n2 8 2\n3 10 1\n7 7 2\n10 10 2\n1 5 1\n1 2... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 15 | codeforces | |
6a78ba8347b792003daee4ed7923df54 | Exposition | There are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection the local library decided to make an exposition of the works of this famous science-fiction writer. It was decided as well that it is necessary to include into the exposition only those books that were pub... | {"inputs": ["3 3\n14 12 10", "2 0\n10 10", "4 5\n8 19 10 13", "1 1\n1", "2 10\n35 45", "4 8\n89 33 54 75", "5 1\n9 6 8 7 5", "3 3\n3 8 6", "4 1000000\n100001 1 200001 300001", "4 1000\n11497 9999 10730 12280", "3 0\n1000000 1000000 1000000", "4 50\n165 182 157 132", "5 173\n350 250 200 300 400", "4 0\n1 1 1 1", "2 1000... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 18 | codeforces | |
6a9c2f420ce1c26085455b0f8032be0f | Palindrome Degree | String *s* of length *n* is called *k*-palindrome, if it is a palindrome itself, and its prefix and suffix of length are (*k*<=-<=1)-palindromes. By definition, any string (even empty) is 0-palindrome.
Let's call the palindrome degree of string *s* such a maximum number *k*, for which *s* is *k*-palindrome. For examp... | {"inputs": ["a2A", "abacaba", "CCeCeCCCee", "opooppppopppopoppopoooppopopooopopppooopppoppoppoppppoooppooooooopppoopoopooooppooooppppppppooopooop", "odribmizzsgholprdsth", "z"], "outputs": ["1", "6", "4", "3", "1", "1"]} | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
6a9dad7100e9c491d15d4d8c2341be0d | Bear and Raspberry | The bear decided to store some raspberry for the winter. He cunningly found out the price for a barrel of honey in kilos of raspberry for each of the following *n* days. According to the bear's data, on the *i*-th (1<=≤<=*i*<=≤<=*n*) day, the price for one barrel of honey is going to is *x**i* kilos of raspberry.
Unfo... | {"inputs": ["5 1\n5 10 7 3 20", "6 2\n100 1 10 40 10 40", "3 0\n1 2 3", "2 0\n2 1", "10 5\n10 1 11 2 12 3 13 4 14 5", "100 4\n2 57 70 8 44 10 88 67 50 44 93 79 72 50 69 19 21 9 71 47 95 13 46 10 68 72 54 40 15 83 57 92 58 25 4 22 84 9 8 55 87 0 16 46 86 58 5 21 32 28 10 46 11 29 13 33 37 34 78 33 33 21 46 70 77 51 45 9... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 297 | codeforces | |
6aa3d5f844967d0a5b0f77f9aec93c4b | Scheme | To learn as soon as possible the latest news about their favourite fundamentally new operating system, BolgenOS community from Nizhni Tagil decided to develop a scheme. According to this scheme a community member, who is the first to learn the news, calls some other member, the latter, in his turn, calls some third mem... | {"inputs": ["3\n3 3 2", "7\n2 3 1 3 4 4 1", "2\n2 1", "3\n2 3 1", "4\n2 4 4 3", "5\n5 3 5 2 3", "9\n2 5 6 7 4 1 9 6 8", "20\n20 10 16 14 9 20 6 20 14 19 17 13 16 13 14 8 8 8 8 19", "100\n13 71 16 92 25 53 97 63 70 83 51 16 51 84 5 10 54 89 18 95 48 29 82 27 84 68 7 4 65 99 95 37 26 24 24 39 3 28 74 7 75 32 27 24 73 48 ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 2 | codeforces | |
6acf2fb9e0257a25a02dab4cf9af8c13 | Minimal Labels | You are given a directed acyclic graph with *n* vertices and *m* edges. There are no self-loops or multiple edges between any pair of vertices. Graph can be disconnected.
You should assign labels to all vertices in such a way that:
- Labels form a valid permutation of length *n* — an integer sequence such that each ... | {"inputs": ["3 3\n1 2\n1 3\n3 2", "4 5\n3 1\n4 1\n2 3\n3 4\n2 4", "5 4\n3 1\n2 1\n2 3\n4 5", "2 1\n2 1", "5 10\n5 2\n4 1\n2 1\n3 4\n2 4\n3 2\n5 4\n3 5\n3 1\n5 1", "100 10\n73 55\n29 76\n15 12\n94 46\n77 67\n76 16\n72 50\n41 40\n89 75\n27 22", "100000 10\n4412 787\n97243 62644\n78549 66107\n43440 41961\n39621 35680\n870... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 21 | codeforces | |
6afaf721b3cad15051de8a10a3b6a477 | Hamster Farm | Dima has a hamsters farm. Soon *N* hamsters will grow up on it and Dima will sell them in a city nearby.
Hamsters should be transported in boxes. If some box is not completely full, the hamsters in it are bored, that's why each box should be completely full with hamsters.
Dima can buy boxes at a factory. The factory ... | {"inputs": ["19 3\n5 4 10", "28 3\n5 6 30", "1 1\n1", "0 2\n2 3", "30 4\n4 5 5 4", "120 7\n109 92 38 38 49 38 92", "357 40\n12 10 12 11 12 12 12 10 10 10 12 12 12 12 12 10 12 10 10 10 11 10 12 10 12 10 12 10 10 12 12 12 12 10 10 10 12 12 12 12", "587 100\n92 92 76 95 61 60 64 79 64 96 63 92 60 61 95 71 60 61 65 63 84 7... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 70 | codeforces | |
6b3e4bd0a44e3c15f50145c3a8b35a30 | Pasha and Pixels | Pasha loves his phone and also putting his hair up... But the hair is now irrelevant.
Pasha has installed a new game to his phone. The goal of the game is following. There is a rectangular field consisting of *n* row with *m* pixels in each row. Initially, all the pixels are colored white. In one move, Pasha can choos... | {"inputs": ["2 2 4\n1 1\n1 2\n2 1\n2 2", "2 3 6\n2 3\n2 2\n1 3\n2 2\n1 2\n1 1", "5 3 7\n2 3\n1 2\n1 1\n4 1\n3 1\n5 3\n3 2", "3 3 11\n2 1\n3 1\n1 1\n1 3\n1 2\n2 3\n3 3\n3 2\n2 2\n1 3\n3 3", "2 2 5\n1 1\n2 1\n2 1\n1 2\n2 2", "518 518 10\n37 97\n47 278\n17 467\n158 66\n483 351\n83 123\n285 219\n513 187\n380 75\n304 352", ... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 207 | codeforces | |
6b3e915ee56ea07b2680bd5f2731c25e | Walking! | There is a sand trail in front of Alice's home.
In daytime, people walk over it and leave a footprint on the trail for their every single step. Alice cannot distinguish the order of the footprints, but she can tell whether each footprint is made by left foot or right foot. Also she's certain that all people are walkin... | {"inputs": ["RRLRL", "RLRLRLRLR", "RRRRRLLLL", "RRLLRRRRLLRRLLRRLLLLRRLL", "RRLRRRLLRRLRRRLRLLRRLLLRRRLLRLRRRLRLLRRRRRLLLLRLRRRLRRRLRLRLLLRLLLLLRRLRLLLRRLLLLLRLRRLRRLLLRLLRRLRL", "L", "R", "LLLLRRRRRRLLLLLLRRRRR", "RLRRLLLRLRLRR", "LR", "RL", "LLRRRLLRRRLL", "RRLLLRRLLLRR", "RRLLR", "LLRRL"], "outputs": ["1\n2 5 1 3 4"... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 1 | codeforces | |
6b44c6785c6ccefed3314b846f146f9e | Molly's Chemicals | Molly Hooper has *n* different kinds of chemicals arranged in a line. Each of the chemicals has an affection value, The *i*-th of them has affection value *a**i*.
Molly wants Sherlock to fall in love with her. She intends to do this by mixing a contiguous segment of chemicals together to make a love potion with total ... | {"inputs": ["4 2\n2 2 2 2", "4 -3\n3 -6 -3 12", "14 -9\n-2 -4 62 53 90 41 35 21 85 74 85 57 10 39", "20 9\n90 21 -6 -61 14 -21 -17 -65 -84 -75 -48 56 67 -50 16 65 -79 -61 92 85", "89 -7\n5972 4011 3914 670 3727 2913 6935 6927 2118 6645 7141 3585 9811 2859 459 8870 6578 8667 468 5152 3241 7455 7323 8817 4866 1040 5102 9... | UNKNOWN | [
"PYTHON3"
] | CODEFORCES | 6 | codeforces |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.