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 |
---|---|---|---|---|---|---|
1294 | Codeforces Round 615 (Div. 3) | FINISHED | False | 7800 | 152119499 | Jan. 22, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4963 ) | E | Obtain a Permutation | PROGRAMMING | greedy implementation math | 2000 |
B'You are given a rectangular matrix of size n x m consisting of integers from 1 to 2 cdot 10^5 . In one move, you can: A cyclic shift is an operation such that you choose some j ( 1 <= j <= m ) and set a_{1, j} := a_{2, j}, a_{2, j} := a_{3, j}, ... , a_{n, j} := a_{1, j} simultaneously. You want to perform the minimum number of moves to make this matrix look like this: In other words, the goal is to obtain the matrix, where a_{1, 1} = 1, a_{1, 2} = 2, ... , a_{1, m} = m, a_{2, 1} = m + 1, a_{2, 2} = m + 2, ... , a_{n, m} = n cdot m (i.e. a_{i, j} = (i - 1) cdot m + j ) with the minimum number of moves performed. The first line of the input contains two integers n and m ( 1 <= n, m <= 2 cdot 10^5, n cdot m <= 2 cdot 10^5 ) -- the size of the matrix. The next n lines contain m integers each. The number at the line i and position j is a_{i, j} ( 1 <= a_{i, j} <= 2 cdot 10^5 ). Print one integer -- the minimum number of moves required to obtain the matrix, where a_{1, 1} = 1, a_{1, 2} = 2, ... , a_{1, m} = m, a_{2, 1} = m + 1, a_{2, 2} = m + 2, ... , a_{n, m} = n cdot m ( a_{i, j} = (i - 1)m + j ). In the first example, you can set a_{1, 1} := 7, a_{1, 2} := 8 and a_{1, 3} := 9 then shift the first, the second and the third columns cyclically, so the answer is 6 . It can be shown that you cannot achieve a better answer. In the second example, the matrix is already good so the answer is 0 . In the third example, it is enough to shift the second column cyclically twice to obtain a good matrix, so the answer is 2 . '... |
Codeforces Round #615 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
70134220 | vjudge3 | E | Feb. 3, 2020, 11:17 a.m. | OK | Clang++17 Diagnostics | TESTS | 86 | 670 | 28672000 | 2000 | |
70610987 | rishabvasu | E | Feb. 9, 2020, 8:26 a.m. | OK | Clang++17 Diagnostics | TESTS | 86 | 1169 | 12697600 | 2000 | |
70342567 | ftiasch | E | Feb. 5, 2020, 8:47 a.m. | OK | D | TESTS | 86 | 140 | 11776000 | 2000 | |
69630471 | ruban | E | Jan. 27, 2020, 5:03 p.m. | OK | Delphi | TESTS | 86 | 109 | 32051200 | 2000 | |
69418060 | vaibhavnandan | E | Jan. 23, 2020, 1:38 p.m. | OK | GNU C11 | TESTS | 85 | 62 | 1638400 | 2000 | |
70150485 | Priyanka2310 | E | Feb. 3, 2020, 12:51 p.m. | OK | GNU C11 | TESTS | 86 | 62 | 1638400 | 2000 | |
69523309 | Vxlimo | E | Jan. 25, 2020, 2:05 p.m. | OK | GNU C++11 | TESTS | 86 | 31 | 1638400 | 2000 | |
69605200 | zhenGG | E | Jan. 27, 2020, 9:28 a.m. | OK | GNU C++11 | TESTS | 86 | 46 | 1638400 | 2000 | |
70209207 | luogu_bot2 | E | Feb. 4, 2020, 7:36 a.m. | OK | GNU C++11 | TESTS | 86 | 46 | 6451200 | 2000 | |
69704487 | kathy_ivy | E | Jan. 29, 2020, 3:36 a.m. | OK | GNU C++11 | TESTS | 86 | 46 | 6451200 | 2000 | |
69670607 | Orange_JuiCE | E | Jan. 28, 2020, 12:53 p.m. | OK | GNU C++11 | TESTS | 86 | 46 | 6451200 | 2000 | |
69445694 | wasa855 | E | Jan. 24, 2020, 2:39 a.m. | OK | GNU C++11 | TESTS | 85 | 46 | 6451200 | 2000 | |
69451810 | yp0401180239 | E | Jan. 24, 2020, 6:35 a.m. | OK | GNU C++11 | TESTS | 86 | 46 | 6553600 | 2000 | |
69551069 | Contna | E | Jan. 26, 2020, 6:28 a.m. | OK | GNU C++11 | TESTS | 86 | 46 | 7270400 | 2000 | |
69572281 | luogu_bot5 | E | Jan. 26, 2020, 2:27 p.m. | OK | GNU C++11 | TESTS | 86 | 46 | 7987200 | 2000 | |
69598302 | jzp2006 | E | Jan. 27, 2020, 6:10 a.m. | OK | GNU C++11 | TESTS | 86 | 61 | 8089600 | 2000 | |
69497235 | 541716010711 | E | Jan. 25, 2020, 4:50 a.m. | OK | GNU C++14 | TESTS | 86 | 62 | 1638400 | 2000 | |
69449992 | aliupingtao | E | Jan. 24, 2020, 5:42 a.m. | OK | GNU C++14 | TESTS | 86 | 62 | 6553600 | 2000 | |
69603698 | 213ddw | E | Jan. 27, 2020, 8:53 a.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
70794361 | abhi_shk27 | E | Feb. 11, 2020, 3:01 p.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
70487729 | wang639026 | E | Feb. 7, 2020, 7:58 a.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69959916 | vjudge1 | E | Feb. 1, 2020, 11:11 a.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69681602 | long240808 | E | Jan. 28, 2020, 3:47 p.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69642127 | Ibn_Ali | E | Jan. 27, 2020, 9:31 p.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69589605 | swagchicken | E | Jan. 26, 2020, 10 p.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69474204 | shiv_99 | E | Jan. 24, 2020, 3:34 p.m. | OK | GNU C++14 | TESTS | 86 | 77 | 1638400 | 2000 | |
69583289 | .tx | E | Jan. 26, 2020, 6:16 p.m. | OK | GNU C++17 | TESTS | 86 | 46 | 6656000 | 2000 | |
69525802 | Alphagocc | E | Jan. 25, 2020, 2:58 p.m. | OK | GNU C++17 | TESTS | 86 | 46 | 7168000 | 2000 | |
70012386 | X-knight | E | Feb. 2, 2020, 7:16 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 1638400 | 2000 | |
69651364 | akaCH | E | Jan. 28, 2020, 5:24 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 1638400 | 2000 | |
69562609 | _Ayase | E | Jan. 26, 2020, 11:12 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 1638400 | 2000 | |
69503816 | UBERMENSCH. | E | Jan. 25, 2020, 7:40 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 1638400 | 2000 | |
69506186 | Top_xiao | E | Jan. 25, 2020, 8:43 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 2457600 | 2000 | |
70817498 | 2017212212083 | E | Feb. 12, 2020, 1:11 a.m. | OK | GNU C++17 | TESTS | 86 | 62 | 6553600 | 2000 | |
69439070 | timreizin | E | Jan. 23, 2020, 8:25 p.m. | OK | GNU C++17 | TESTS | 85 | 62 | 6553600 | 2000 | |
69731653 | copperium | E | Jan. 29, 2020, 1:40 p.m. | OK | GNU C++17 | TESTS | 86 | 77 | 819200 | 2000 | |
70350256 | misclicked | E | Feb. 5, 2020, 10:43 a.m. | OK | Go | TESTS | 86 | 186 | 4505600 | 2000 | |
70024230 | vjudge3 | E | Feb. 2, 2020, 10:51 a.m. | OK | Go | TESTS | 86 | 202 | 9318400 | 2000 | |
69417976 | jenish9599 | E | Jan. 23, 2020, 1:37 p.m. | OK | Java 11 | TESTS | 85 | 202 | 0 | 2000 | |
69529692 | Anonymous | E | Jan. 25, 2020, 4:35 p.m. | OK | Java 11 | TESTS | 86 | 218 | 0 | 2000 | |
69464781 | Hemose | E | Jan. 24, 2020, 12:24 p.m. | OK | Java 11 | TESTS | 86 | 233 | 0 | 2000 | |
69443740 | Kimo_Fathy | E | Jan. 24, 2020, 12:37 a.m. | OK | Java 11 | TESTS | 85 | 234 | 0 | 2000 | |
70561113 | Azakarka | E | Feb. 8, 2020, 11:54 a.m. | OK | Java 11 | TESTS | 86 | 311 | 9523200 | 2000 | |
70534023 | szmango | E | Feb. 8, 2020, 1:30 a.m. | OK | Java 11 | TESTS | 86 | 421 | 0 | 2000 | |
70533923 | ann1e | E | Feb. 8, 2020, 1:25 a.m. | OK | Java 11 | TESTS | 86 | 421 | 0 | 2000 | |
70492735 | s1052823 | E | Feb. 7, 2020, 9:33 a.m. | OK | Java 11 | TESTS | 86 | 436 | 0 | 2000 | |
69464257 | muoff | E | Jan. 24, 2020, 12:10 p.m. | OK | Java 11 | TESTS | 86 | 436 | 0 | 2000 | |
69435790 | IncubatorMan | E | Jan. 23, 2020, 6:54 p.m. | OK | Java 11 | TESTS | 85 | 436 | 0 | 2000 | |
69477352 | Abhinav_Mani | E | Jan. 24, 2020, 4:37 p.m. | OK | Java 8 | TESTS | 86 | 124 | 0 | 2000 | |
69849708 | dyhu083 | E | Jan. 30, 2020, 3:16 p.m. | OK | Java 8 | TESTS | 86 | 140 | 0 | 2000 | |
69529379 | thisSideAnonymous | E | Jan. 25, 2020, 4:27 p.m. | OK | Java 8 | TESTS | 86 | 140 | 0 | 2000 | |
69435150 | chojh1222 | E | Jan. 23, 2020, 6:41 p.m. | OK | Java 8 | TESTS | 85 | 140 | 0 | 2000 | |
69834655 | luchy0120 | E | Jan. 30, 2020, 11:29 a.m. | OK | Java 8 | TESTS | 86 | 155 | 0 | 2000 | |
69706284 | lzhang | E | Jan. 29, 2020, 4:46 a.m. | OK | Java 8 | TESTS | 86 | 155 | 2048000 | 2000 | |
69488143 | gouh9qn | E | Jan. 24, 2020, 8:38 p.m. | OK | Java 8 | TESTS | 86 | 155 | 2048000 | 2000 | |
69435730 | Agnimandur | E | Jan. 23, 2020, 6:53 p.m. | OK | Java 8 | TESTS | 85 | 155 | 2048000 | 2000 | |
69443868 | unicorn20141 | E | Jan. 24, 2020, 12:45 a.m. | OK | Java 8 | TESTS | 85 | 155 | 2150400 | 2000 | |
69563678 | adarsh000321 | E | Jan. 26, 2020, 11:36 a.m. | OK | Java 8 | TESTS | 86 | 156 | 2048000 | 2000 | |
69419946 | walborn | E | Jan. 23, 2020, 2:08 p.m. | OK | JavaScript | TESTS | 85 | 436 | 55296000 | 2000 | |
70347719 | lightgreen | E | Feb. 5, 2020, 10:01 a.m. | OK | Kotlin | TESTS | 86 | 374 | 0 | 2000 | |
70214536 | sakapon | E | Feb. 4, 2020, 9:18 a.m. | OK | Mono C# | TESTS | 86 | 124 | 19865600 | 2000 | |
70484200 | waatson | E | Feb. 7, 2020, 6:53 a.m. | OK | Mono C# | TESTS | 86 | 124 | 25395200 | 2000 | |
70214695 | sakapon | E | Feb. 4, 2020, 9:21 a.m. | OK | Mono C# | TESTS | 86 | 139 | 19968000 | 2000 | |
69666843 | artem.votincev | E | Jan. 28, 2020, 11:39 a.m. | OK | Mono C# | TESTS | 86 | 171 | 25804800 | 2000 | |
69611892 | artworks | E | Jan. 27, 2020, 11:47 a.m. | OK | Mono C# | TESTS | 86 | 186 | 25702400 | 2000 | |
70213971 | sakapon | E | Feb. 4, 2020, 9:08 a.m. | OK | Mono C# | TESTS | 86 | 265 | 31641600 | 2000 | |
70341206 | vjudge1 | E | Feb. 5, 2020, 8:27 a.m. | OK | MS C++ | TESTS | 86 | 61 | 1638400 | 2000 | |
69654394 | vjudge1 | E | Jan. 28, 2020, 6:47 a.m. | OK | MS C++ | TESTS | 86 | 62 | 1638400 | 2000 | |
70958811 | vjudge3 | E | Feb. 13, 2020, 1:36 p.m. | OK | MS C++ | TESTS | 86 | 62 | 8089600 | 2000 | |
70958245 | vjudge4 | E | Feb. 13, 2020, 1:26 p.m. | OK | MS C++ | TESTS | 86 | 62 | 16076800 | 2000 | |
69952710 | vjudge1 | E | Feb. 1, 2020, 9:21 a.m. | OK | MS C++ | TESTS | 86 | 77 | 8089600 | 2000 | |
69427295 | LinusTorvaldsFan | E | Jan. 23, 2020, 4:12 p.m. | OK | MS C++ | TESTS | 85 | 155 | 7270400 | 2000 | |
69950337 | vjudge2 | E | Feb. 1, 2020, 8:46 a.m. | OK | MS C++ | TESTS | 86 | 155 | 10444800 | 2000 | |
69812700 | vjudge2 | E | Jan. 30, 2020, 5:01 a.m. | OK | MS C++ | TESTS | 86 | 156 | 1638400 | 2000 | |
69769976 | vjudge2 | E | Jan. 29, 2020, 3:59 p.m. | OK | MS C++ | TESTS | 86 | 171 | 6451200 | 2000 | |
70958299 | vjudge4 | E | Feb. 13, 2020, 1:27 p.m. | OK | MS C++ | TESTS | 86 | 171 | 9625600 | 2000 | |
69445294 | paradoxhzy | E | Jan. 24, 2020, 2:16 a.m. | OK | MS C++ 2017 | TESTS | 85 | 78 | 3174400 | 2000 | |
69445250 | paradoxhzy | E | Jan. 24, 2020, 2:14 a.m. | OK | MS C++ 2017 | TESTS | 85 | 78 | 3481600 | 2000 | |
69590065 | yaoigod | E | Jan. 26, 2020, 10:25 p.m. | OK | MS C++ 2017 | TESTS | 86 | 78 | 6451200 | 2000 | |
69502282 | vjudge3 | E | Jan. 25, 2020, 7:03 a.m. | OK | MS C++ 2017 | TESTS | 86 | 93 | 6451200 | 2000 | |
70820257 | EatingMelonPublic | E | Feb. 12, 2020, 3:19 a.m. | OK | MS C++ 2017 | TESTS | 86 | 171 | 4915200 | 2000 | |
69727154 | rofle100lvl | E | Jan. 29, 2020, 12:36 p.m. | OK | MS C++ 2017 | TESTS | 86 | 171 | 7270400 | 2000 | |
69553202 | q8514199 | E | Jan. 26, 2020, 7:29 a.m. | OK | MS C++ 2017 | TESTS | 86 | 186 | 6451200 | 2000 | |
69901515 | omerb.zeybek | E | Jan. 31, 2020, 1:08 p.m. | OK | MS C++ 2017 | TESTS | 86 | 186 | 6451200 | 2000 | |
69640657 | Dead_InsideZXC | E | Jan. 27, 2020, 8:39 p.m. | OK | MS C++ 2017 | TESTS | 86 | 187 | 6451200 | 2000 | |
70106514 | vjudge5 | E | Feb. 3, 2020, 3:30 a.m. | OK | MS C++ 2017 | TESTS | 86 | 187 | 6451200 | 2000 | |
70451413 | Gaurav1 | E | Feb. 6, 2020, 4:26 p.m. | OK | PyPy 2 | TESTS | 86 | 264 | 18329600 | 2000 | |
69510682 | MVP | E | Jan. 25, 2020, 10:22 a.m. | OK | PyPy 2 | TESTS | 86 | 280 | 24780800 | 2000 | |
71075000 | raj1307 | E | Feb. 14, 2020, 5:02 p.m. | OK | PyPy 2 | TESTS | 86 | 311 | 18636800 | 2000 | |
69436993 | mitribunskiy | E | Jan. 23, 2020, 7:26 p.m. | OK | PyPy 3 | TESTS | 85 | 326 | 22323200 | 2000 | |
69651530 | zqx1392 | E | Jan. 28, 2020, 5:30 a.m. | OK | PyPy 3 | TESTS | 86 | 326 | 27955200 | 2000 | |
69423233 | i_am_bread | E | Jan. 23, 2020, 3:01 p.m. | OK | PyPy 3 | TESTS | 85 | 342 | 24064000 | 2000 | |
69516806 | densvedberg | E | Jan. 25, 2020, 12:15 p.m. | OK | PyPy 3 | TESTS | 86 | 342 | 30924800 | 2000 | |
69424961 | thekushalghosh | E | Jan. 23, 2020, 3:30 p.m. | OK | PyPy 3 | TESTS | 85 | 358 | 18636800 | 2000 | |
69422405 | auouo | E | Jan. 23, 2020, 2:47 p.m. | OK | PyPy 3 | TESTS | 85 | 374 | 27238400 | 2000 | |
69516494 | densvedberg | E | Jan. 25, 2020, 12:09 p.m. | OK | PyPy 3 | TESTS | 86 | 374 | 37478400 | 2000 | |
69515917 | densvedberg | E | Jan. 25, 2020, 11:59 a.m. | OK | PyPy 3 | TESTS | 86 | 374 | 37785600 | 2000 | |
69515906 | EliteLabyrinth | E | Jan. 25, 2020, 11:58 a.m. | OK | PyPy 3 | TESTS | 86 | 389 | 28160000 | 2000 | |
69431721 | toterpinguin | E | Jan. 23, 2020, 5:33 p.m. | OK | PyPy 3 | TESTS | 85 | 389 | 32358400 | 2000 | |
69734183 | Avny | E | Jan. 29, 2020, 2:12 p.m. | OK | Python 3 | TESTS | 86 | 623 | 20070400 | 2000 | |
70001776 | prashanth7638 | E | Feb. 2, 2020, 2:12 a.m. | OK | Python 3 | TESTS | 86 | 732 | 15360000 | 2000 | |
69822106 | Danish_love | E | Jan. 30, 2020, 8:11 a.m. | OK | Python 3 | TESTS | 86 | 733 | 22937600 | 2000 | |
71047885 | ravikiranf6 | E | Feb. 14, 2020, 9:01 a.m. | OK | Python 3 | TESTS | 86 | 748 | 15360000 | 2000 | |
69444825 | NocturneBflat | E | Jan. 24, 2020, 1:47 a.m. | OK | Python 3 | TESTS | 85 | 748 | 35942400 | 2000 | |
69557666 | untamed | E | Jan. 26, 2020, 9:27 a.m. | OK | Python 3 | TESTS | 86 | 826 | 15052800 | 2000 | |
69518720 | aakarsh | E | Jan. 25, 2020, 12:48 p.m. | OK | Python 3 | TESTS | 86 | 841 | 15360000 | 2000 | |
69439789 | XmtosX | E | Jan. 23, 2020, 8:46 p.m. | OK | Python 3 | TESTS | 85 | 857 | 16793600 | 2000 | |
69646007 | kcaze | E | Jan. 28, 2020, 1:18 a.m. | OK | Python 3 | TESTS | 86 | 904 | 42393600 | 2000 | |
69696191 | MVesterli | E | Jan. 28, 2020, 8:35 p.m. | OK | Rust | TESTS | 86 | 46 | 3686400 | 2000 | |
69426635 | motoras | E | Jan. 23, 2020, 4:01 p.m. | OK | Rust | TESTS | 85 | 78 | 14131200 | 2000 | |
69425842 | motoras | E | Jan. 23, 2020, 3:46 p.m. | OK | Rust | TESTS | 85 | 108 | 14131200 | 2000 | |
69425387 | motoras | E | Jan. 23, 2020, 3:38 p.m. | OK | Rust | TESTS | 85 | 108 | 14131200 | 2000 | |
69424946 | motoras | E | Jan. 23, 2020, 3:30 p.m. | OK | Rust | TESTS | 85 | 108 | 14131200 | 2000 | |
69425499 | motoras | E | Jan. 23, 2020, 3:40 p.m. | OK | Rust | TESTS | 85 | 124 | 14131200 | 2000 |
Back to search problems