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 |
---|---|---|---|---|---|---|
1361 | Codeforces Round 647 (Div. 1) - Thanks, Algo Muse! | FINISHED | False | 9000 | 140541899 | June 4, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 154 ) | F | Johnny and New Toy | PROGRAMMING | data structures implementation math | 3300 |
B"Johnny has a new toy. As you may guess, it is a little bit extraordinary. The toy is a permutation P of numbers from 1 to n , written in one row next to each other. For each i from 1 to n - 1 between P_i and P_{i + 1} there is a weight W_i written, and those weights form a permutation of numbers from 1 to n - 1 . There are also extra weights W_0 = W_n = 0 . The instruction defines subsegment [L, R] as good if W_{L - 1} < W_i and W_R < W_i for any i in {L, L + 1, ldots, R - 1 } . For such subsegment it also defines W_M as minimum of set {W_L, W_{L + 1}, ldots, W_{R - 1} } . Now the fun begins. In one move, the player can choose one of the good subsegments, cut it into [L, M] and [M + 1, R] and swap the two parts. More precisely, before one move the chosen subsegment of our toy looks like: W_{L - 1}, P_L, W_L, ldots, W_{M - 1}, P_M, W_M, P_{M + 1}, W_{M + 1}, ldots, W_{R - 1}, P_R, W_R and afterwards it looks like this: W_{L - 1}, P_{M + 1}, W_{M + 1}, ldots, W_{R - 1}, P_R, W_M, P_L, W_L, ldots, W_{M - 1}, P_M, W_R Such a move can be performed multiple times (possibly zero), and the goal is to achieve the minimum number of inversions in P . Johnny's younger sister Megan thinks that the rules are too complicated, so she wants to test her brother by choosing some pair of indices X and Y , and swapping P_X and P_Y ( X might be equal Y ). After each sister's swap, Johnny wonders, what is the minimal number of inversions that he can achieve, starting with current P and making legal moves? You can assume that the input is generated randomly. P and W were chosen independently and equiprobably over all permutations; also, Megan's requests were chosen independently and equiprobably over all pairs of indices. The first line contains single integer n "... |
Codeforces Round #647 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
82572775 | jaswanth_9652 | F | June 4, 2020, 7:19 p.m. | OK | GNU C++11 | TESTS | 30 | 5662 | 200908800 | 3300 | |
82776140 | stal_xy23z7b8 | F | June 7, 2020, 11:57 a.m. | OK | GNU C++11 | TESTS | 30 | 6754 | 234393600 | 3300 | |
83266041 | _twilight | F | June 10, 2020, 4:07 a.m. | OK | GNU C++11 | TESTS | 30 | 7253 | 211251200 | 3300 | |
82613102 | cjy2003 | F | June 5, 2020, 8:41 a.m. | OK | GNU C++11 | TESTS | 30 | 8361 | 207974400 | 3300 | |
83112383 | Harshini.S | F | June 8, 2020, 7:58 a.m. | OK | GNU C++14 | TESTS | 30 | 4898 | 979558400 | 3300 | |
82891857 | beastboss | F | June 7, 2020, 9:57 p.m. | OK | GNU C++14 | TESTS | 30 | 4898 | 979558400 | 3300 | |
82746627 | Rubblsh12345 | F | June 7, 2020, 3:28 a.m. | OK | GNU C++14 | TESTS | 30 | 5148 | 979558400 | 3300 | |
82698211 | jitendra28 | F | June 6, 2020, 11:09 a.m. | OK | GNU C++14 | TESTS | 30 | 5693 | 201011200 | 3300 | |
83341832 | yhx-12243 | F | June 11, 2020, 1:33 a.m. | OK | GNU C++14 | TESTS | 30 | 6598 | 201011200 | 3300 | |
82747027 | venkat_46 | F | June 7, 2020, 3:41 a.m. | OK | GNU C++14 | TESTS | 30 | 7394 | 203161600 | 3300 | |
82690206 | MagicSpark | F | June 6, 2020, 9:06 a.m. | OK | GNU C++14 | TESTS | 30 | 7487 | 262246400 | 3300 | |
82569539 | Benq | F | June 4, 2020, 6:43 p.m. | OK | GNU C++17 | TESTS | 30 | 2963 | 154009600 | 3300 | |
82568479 | Benq | F | June 4, 2020, 6:33 p.m. | OK | GNU C++17 | TESTS | 30 | 3056 | 128409600 | 3300 | |
82772929 | guyan | F | June 7, 2020, 11:07 a.m. | OK | GNU C++17 | TESTS | 30 | 4570 | 1001984000 | 3300 | |
82561525 | Radewoosh | F | June 4, 2020, 5:02 p.m. | OK | GNU C++17 | TESTS | 30 | 4944 | 234291200 | 3300 | |
82606616 | Elegia | F | June 5, 2020, 7:24 a.m. | OK | GNU C++17 | TESTS | 30 | 5116 | 207360000 | 3300 | |
82972819 | sayeedt | F | June 8, 2020, 5:27 a.m. | OK | GNU C++17 | TESTS | 30 | 5646 | 201011200 | 3300 | |
82571701 | Benq | F | June 4, 2020, 7:06 p.m. | OK | GNU C++17 | TESTS | 30 | 5833 | 226201600 | 3300 | |
83004925 | sayeedt | F | June 8, 2020, 5:30 a.m. | OK | GNU C++17 | TESTS | 30 | 5849 | 201011200 | 3300 | |
83276685 | __Arpan__ | F | June 10, 2020, 7:12 a.m. | OK | GNU C++17 | TESTS | 30 | 5959 | 201011200 | 3300 | |
83293093 | reddyjaideep17 | F | June 10, 2020, 11:07 a.m. | OK | GNU C++17 | TESTS | 30 | 5974 | 201011200 | 3300 | |
82553474 | yosupo | F | June 4, 2020, 4:41 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 1950 | 176742400 | 3300 | |
83525326 | user202729_ | F | June 12, 2020, 11:27 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 2885 | 111616000 | 3300 | |
83524022 | user202729_ | F | June 12, 2020, 11:11 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 3354 | 111308800 | 3300 | |
82613856 | Elegia | F | June 5, 2020, 8:50 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 4960 | 306995200 | 3300 | |
82607160 | WZYYN | F | June 5, 2020, 7:30 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 6255 | 865689600 | 3300 | |
82546613 | maroonrk | F | June 4, 2020, 4:22 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 6317 | 278118400 | 3300 | |
83519452 | user202729_ | F | June 12, 2020, 10:12 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 6801 | 279756800 | 3300 | |
83520695 | user202729_ | F | June 12, 2020, 10:28 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 7207 | 279756800 | 3300 | |
82548841 | boboniu | F | June 4, 2020, 4:28 p.m. | OK | GNU C++17 (64) | TESTS | 30 | 8096 | 307916800 | 3300 | |
82763722 | jerome_wei | F | June 7, 2020, 8:45 a.m. | OK | GNU C++17 (64) | TESTS | 30 | 10311 | 884940800 | 3300 | |
82584710 | Lewin | F | June 5, 2020, 12:52 a.m. | OK | Java 11 | TESTS | 30 | 12791 | 459366400 | 3300 | |
82596099 | ahmadhoumani | F | June 5, 2020, 5:04 a.m. | OK | Java 8 | TESTS | 30 | 13727 | 467660800 | 3300 |
Back to search problems