Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1168 | Codeforces Round 562 (Div. 1) | FINISHED | False | 7200 | 172938299 | May 26, 2019, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 6886 ) | A | Increasing by Modulo | PROGRAMMING | binary search greedy | 1800 |
B'Toad Zitz has an array of integers, each integer is between 0 and m-1 inclusive. The integers are a_1, a_2, ldots, a_n . In one operation Zitz can choose an integer k and k indices i_1, i_2, ldots, i_k such that 1 <= q i_1 < i_2 < ldots < i_k <= q n . He should then change a_{i_j} to ((a_{i_j}+1) bmod m) for each chosen integer i_j . The integer m is fixed for all operations and indices. Here x bmod y denotes the remainder of the division of x by y . Zitz wants to make his array non-decreasing with the minimum number of such operations. Find this minimum number of operations. The first line contains two integers n and m ( 1 <= q n, m <= q 300 ,000 ) -- the number of integers in the array and the parameter m . The next line contains n space-separated integers a_1, a_2, ldots, a_n ( 0 <= q a_i < m ) -- the given array. Output one integer: the minimum number of described operations Zitz needs to make his array non-decreasing. If no operations required, print 0 . It is easy to see that with enough operations Zitz can always make his array non-decreasing. In the first example, the array is already non-decreasing, so the answer is 0 . In the second example, you can choose k=2 , i_1 = 2 , i_2 = 5 , the array becomes [0,0,1,3,3] . It is non-decreasing, so the answer is 1 . '... |
Codeforces Round #562 — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
58856302 | 0x000000_hole | A | Aug. 15, 2019, 9:26 a.m. | OK | Clang++17 Diagnostics | TESTS | 29 | 1325 | 1433600 | 1800 | |
54670944 | yosupo | A | May 26, 2019, 3:42 p.m. | OK | D | TESTS | 29 | 77 | 11571200 | 1800 | |
56421138 | jiang5ye | A | July 2, 2019, 7:23 a.m. | OK | FPC | TESTS | 29 | 78 | 2457600 | 1800 | |
56419466 | jiang5ye | A | July 2, 2019, 6:37 a.m. | OK | FPC | TESTS | 29 | 93 | 1228800 | 1800 | |
54814349 | about | A | May 29, 2019, 6:48 p.m. | OK | GNU C11 | TESTS | 29 | 77 | 1228800 | 1800 | |
54700273 | crashbandicoot94 | A | May 26, 2019, 10:25 p.m. | OK | GNU C11 | TESTS | 29 | 93 | 1228800 | 1800 | |
62048553 | luogu_bot5 | A | Oct. 7, 2019, 8:43 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1024000 | 1800 | |
62047575 | luogu_bot1 | A | Oct. 7, 2019, 8:26 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1024000 | 1800 | |
62676025 | bingoyes | A | Oct. 16, 2019, 11:27 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
62294369 | asuldb | A | Oct. 10, 2019, 1:11 p.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
55211301 | hangyesheng | A | June 6, 2019, 2:44 p.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
54820937 | hychyc | A | May 30, 2019, 2:37 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
54750304 | ouqingliang | A | May 28, 2019, 12:32 p.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
63077478 | vjudge2 | A | Oct. 21, 2019, 2:06 p.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
66525084 | WhiteCmile | A | Dec. 9, 2019, 3:58 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 1228800 | 1800 | |
55610822 | ReaLNero1 | A | June 16, 2019, 5:36 a.m. | OK | GNU C++11 | TESTS | 29 | 31 | 2252800 | 1800 | |
54670263 | FizzyDavid | A | May 26, 2019, 3:40 p.m. | OK | GNU C++14 | TESTS | 29 | 31 | 1331200 | 1800 | |
54830788 | Phortox | A | May 30, 2019, 8:50 a.m. | OK | GNU C++14 | TESTS | 29 | 31 | 1331200 | 1800 | |
54677020 | wleung_bvg | A | May 26, 2019, 4 p.m. | OK | GNU C++14 | TESTS | 29 | 46 | 1331200 | 1800 | |
54671971 | Linkus | A | May 26, 2019, 3:44 p.m. | OK | GNU C++14 | TESTS | 29 | 46 | 3993600 | 1800 | |
54670251 | OnionPringles | A | May 26, 2019, 3:40 p.m. | OK | GNU C++14 | TESTS | 29 | 62 | 1228800 | 1800 | |
54832343 | ..vince | A | May 30, 2019, 9:24 a.m. | OK | GNU C++14 | TESTS | 29 | 62 | 2457600 | 1800 | |
54674583 | natsugiri | A | May 26, 2019, 3:51 p.m. | OK | GNU C++14 | TESTS | 29 | 77 | 1228800 | 1800 | |
55874445 | cuibst2 | A | June 21, 2019, 4:44 p.m. | OK | GNU C++14 | TESTS | 29 | 77 | 1228800 | 1800 | |
54737260 | drastogi21 | A | May 28, 2019, 5:45 a.m. | OK | GNU C++14 | TESTS | 29 | 77 | 1228800 | 1800 | |
54695165 | pbt17 | A | May 26, 2019, 6:43 p.m. | OK | GNU C++14 | TESTS | 29 | 77 | 1228800 | 1800 | |
54877249 | .tx | A | May 31, 2019, 12:25 p.m. | OK | GNU C++17 | TESTS | 29 | 31 | 1228800 | 1800 | |
54990732 | kessido | A | June 2, 2019, 6:34 p.m. | OK | GNU C++17 | TESTS | 29 | 46 | 1228800 | 1800 | |
54696407 | rds__98 | A | May 26, 2019, 7:19 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 1228800 | 1800 | |
54674690 | ReD_AwHiLe | A | May 26, 2019, 3:52 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 1228800 | 1800 | |
61089036 | BabyRooJr | A | Sept. 22, 2019, 8 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 1228800 | 1800 | |
54776980 | VaVshchuck | A | May 28, 2019, 6:38 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 1228800 | 1800 | |
54859621 | mihaipopa12 | A | May 30, 2019, 11:44 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 3174400 | 1800 | |
56731243 | qinyuyang | A | July 9, 2019, 1:33 a.m. | OK | GNU C++17 | TESTS | 29 | 77 | 3993600 | 1800 | |
68833786 | lrvideckis | A | Jan. 15, 2020, 1:25 a.m. | OK | GNU C++17 | TESTS | 29 | 78 | 1228800 | 1800 | |
64626189 | Chaigidel | A | Nov. 10, 2019, 8:36 a.m. | OK | GNU C++17 | TESTS | 29 | 78 | 1228800 | 1800 | |
54886825 | Daario | A | May 31, 2019, 5:49 p.m. | OK | Go | TESTS | 29 | 61 | 716800 | 1800 | |
55101896 | tkachenko | A | June 4, 2019, 9 p.m. | OK | Go | TESTS | 29 | 62 | 716800 | 1800 | |
62609692 | synapse | A | Oct. 15, 2019, 9:15 a.m. | OK | Go | TESTS | 29 | 218 | 0 | 1800 | |
55838027 | mbfeci | A | June 20, 2019, 4:26 p.m. | OK | Java 8 | TESTS | 29 | 124 | 0 | 1800 | |
54691312 | Harpae | A | May 26, 2019, 5:24 p.m. | OK | Java 8 | TESTS | 29 | 124 | 0 | 1800 | |
54686041 | Musin | A | May 26, 2019, 4:48 p.m. | OK | Java 8 | TESTS | 29 | 124 | 0 | 1800 | |
54752123 | dalt | A | May 28, 2019, 1:20 p.m. | OK | Java 8 | TESTS | 29 | 139 | 0 | 1800 | |
54671102 | uwi | A | May 26, 2019, 3:42 p.m. | OK | Java 8 | TESTS | 29 | 139 | 0 | 1800 | |
56636840 | bwang1008 | A | July 6, 2019, 8:16 p.m. | OK | Java 8 | TESTS | 29 | 155 | 0 | 1800 | |
54675296 | fetetriste | A | May 26, 2019, 3:54 p.m. | OK | Java 8 | TESTS | 29 | 155 | 2867200 | 1800 | |
54811760 | ayush1212 | A | May 29, 2019, 5:17 p.m. | OK | Java 8 | TESTS | 29 | 155 | 2969600 | 1800 | |
60199915 | Agnimandur | A | Sept. 7, 2019, 4:52 a.m. | OK | Java 8 | TESTS | 29 | 171 | 2867200 | 1800 | |
65826636 | Keyur21 | A | Nov. 27, 2019, 12:48 p.m. | OK | Java 8 | TESTS | 29 | 171 | 2867200 | 1800 | |
54738459 | kotter | A | May 28, 2019, 6:27 a.m. | OK | Kotlin | TESTS | 29 | 280 | 23654400 | 1800 | |
54674395 | alexey.enkov | A | May 26, 2019, 3:51 p.m. | OK | Kotlin | TESTS | 29 | 436 | 25190400 | 1800 | |
54677890 | Intrincantation | A | May 26, 2019, 4:04 p.m. | OK | Kotlin | TESTS | 29 | 451 | 25190400 | 1800 | |
57711642 | Tlatoani | A | July 25, 2019, 12:21 a.m. | OK | Kotlin | TESTS | 29 | 452 | 0 | 1800 | |
57711493 | Tlatoani | A | July 25, 2019, 12:13 a.m. | OK | Kotlin | TESTS | 29 | 467 | 0 | 1800 | |
54830169 | vjudge1 | A | May 30, 2019, 8:33 a.m. | OK | MS C++ | TESTS | 29 | 62 | 3584000 | 1800 | |
54674870 | math957963 | A | May 26, 2019, 3:52 p.m. | OK | MS C++ | TESTS | 29 | 78 | 1228800 | 1800 | |
59785807 | vjudge4 | A | Aug. 31, 2019, 5:34 a.m. | OK | MS C++ | TESTS | 29 | 78 | 2457600 | 1800 | |
58993011 | vjudge1 | A | Aug. 18, 2019, 10:02 a.m. | OK | MS C++ | TESTS | 29 | 93 | 1228800 | 1800 | |
59785877 | vjudge2 | A | Aug. 31, 2019, 5:36 a.m. | OK | MS C++ | TESTS | 29 | 93 | 2457600 | 1800 | |
54829316 | vjudge4 | A | May 30, 2019, 8:10 a.m. | OK | MS C++ | TESTS | 29 | 93 | 2457600 | 1800 | |
55042124 | scorpiowf | A | June 3, 2019, 3:17 p.m. | OK | MS C++ | TESTS | 29 | 93 | 3993600 | 1800 | |
55000704 | stephentao333 | A | June 3, 2019, 4:17 a.m. | OK | MS C++ | TESTS | 29 | 218 | 2355200 | 1800 | |
54898905 | ZSTU-2018329621261 | A | June 1, 2019, 5:20 a.m. | OK | MS C++ 2017 | TESTS | 29 | 93 | 1228800 | 1800 | |
68626522 | AleksanderBalobanov | A | Jan. 11, 2020, 10:26 p.m. | OK | MS C++ 2017 | TESTS | 29 | 108 | 1433600 | 1800 | |
56994464 | Charbel11 | A | July 13, 2019, 8:42 p.m. | OK | MS C++ 2017 | TESTS | 29 | 249 | 2457600 | 1800 | |
65713536 | CtrlAlt | A | Nov. 25, 2019, 3:26 p.m. | OK | MS C++ 2017 | TESTS | 29 | 264 | 1433600 | 1800 | |
55603701 | pseuda | A | June 15, 2019, 8:18 p.m. | OK | MS C++ 2017 | TESTS | 29 | 265 | 2457600 | 1800 | |
57145089 | qty127 | A | July 16, 2019, 12:38 p.m. | OK | MS C++ 2017 | TESTS | 29 | 280 | 2048000 | 1800 | |
59611152 | yumtam | A | Aug. 28, 2019, 11 a.m. | OK | PyPy 2 | TESTS | 29 | 187 | 21504000 | 1800 | |
57328587 | thuutin | A | July 19, 2019, 1:11 p.m. | OK | PyPy 2 | TESTS | 29 | 296 | 16281600 | 1800 | |
54681547 | titia | A | May 26, 2019, 4:21 p.m. | OK | PyPy 3 | TESTS | 29 | 326 | 22835200 | 1800 | |
54708534 | whatshisbucket | A | May 27, 2019, 6:33 a.m. | OK | PyPy 3 | TESTS | 29 | 326 | 24166400 | 1800 | |
54913184 | aberent | A | June 1, 2019, 12:17 p.m. | OK | PyPy 3 | TESTS | 29 | 327 | 24166400 | 1800 | |
55115449 | nexus.chebykin | A | June 5, 2019, 8:26 a.m. | OK | PyPy 3 | TESTS | 29 | 327 | 24371200 | 1800 | |
54752898 | Stephan | A | May 28, 2019, 1:41 p.m. | OK | PyPy 3 | TESTS | 29 | 327 | 24371200 | 1800 | |
54682964 | Kiri8128 | A | May 26, 2019, 4:28 p.m. | OK | PyPy 3 | TESTS | 29 | 343 | 24576000 | 1800 | |
54866549 | a00920 | A | May 31, 2019, 6:35 a.m. | OK | PyPy 3 | TESTS | 29 | 358 | 26316800 | 1800 | |
57322510 | _PortgasD.Ace_ | A | July 19, 2019, 10:41 a.m. | OK | PyPy 3 | TESTS | 29 | 389 | 22016000 | 1800 | |
56479790 | codershuvo | A | July 3, 2019, 3:28 p.m. | OK | PyPy 3 | TESTS | 29 | 405 | 22016000 | 1800 | |
68848437 | Firepaw | A | Jan. 15, 2020, 8:09 a.m. | OK | PyPy 3 | TESTS | 29 | 794 | 28774400 | 1800 | |
54827534 | lnever | A | May 30, 2019, 7:18 a.m. | OK | Python 2 | TESTS | 29 | 997 | 17715200 | 1800 | |
54739296 | 29029 | A | May 28, 2019, 6:55 a.m. | OK | Python 2 | TESTS | 29 | 1138 | 16179200 | 1800 | |
55216982 | h_sheep | A | June 6, 2019, 5:17 p.m. | OK | Python 2 | TESTS | 29 | 1684 | 19865600 | 1800 | |
55219497 | ZZZJOOO | A | June 6, 2019, 6:39 p.m. | OK | Python 3 | TESTS | 29 | 951 | 20684800 | 1800 | |
54709275 | 365050244 | A | May 27, 2019, 7:28 a.m. | OK | Python 3 | TESTS | 29 | 1778 | 20889600 | 1800 | |
56503095 | codershuvo | A | July 4, 2019, 7:14 a.m. | OK | Python 3 | TESTS | 29 | 1980 | 20377600 | 1800 | |
55649379 | sdhd | A | June 16, 2019, 1:48 p.m. | OK | Python 3 | TESTS | 29 | 2011 | 20377600 | 1800 | |
69472732 | alhiris | A | Jan. 24, 2020, 3:05 p.m. | OK | Python 3 | TESTS | 29 | 2121 | 20889600 | 1800 | |
54814458 | kaustubh_damania | A | May 29, 2019, 6:52 p.m. | OK | Python 3 | TESTS | 29 | 2168 | 20582400 | 1800 | |
55526440 | Zuizehongquaunha | A | June 13, 2019, 11:24 a.m. | OK | Python 3 | TESTS | 29 | 2293 | 20787200 | 1800 | |
55550886 | c_loud26 | A | June 14, 2019, 6:58 a.m. | OK | Python 3 | TESTS | 29 | 2417 | 21196800 | 1800 | |
54718456 | NocturneBflat | A | May 27, 2019, 2:51 p.m. | OK | Python 3 | TESTS | 29 | 2448 | 20684800 | 1800 | |
55075899 | nexus.chebykin | A | June 4, 2019, 8:34 a.m. | OK | Python 3 | TESTS | 29 | 2495 | 21196800 | 1800 | |
67681163 | gearjack | A | Dec. 27, 2019, 6:28 a.m. | OK | Rust | TESTS | 29 | 46 | 3276800 | 1800 | |
55227001 | Chenyao | A | June 7, 2019, 2:35 a.m. | OK | Rust | TESTS | 29 | 77 | 7065600 | 1800 | |
54676268 | EbTech | A | May 26, 2019, 3:57 p.m. | OK | Rust | TESTS | 29 | 77 | 17203200 | 1800 | |
54676732 | limed | A | May 26, 2019, 3:59 p.m. | OK | Scala | TESTS | 29 | 701 | 5427200 | 1800 |
Back to search problems