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 |
|---|---|---|---|---|---|---|
| 2232 | Codeforces Round 1101 (Div. 2) | FINISHED | False | 7200 | 2129131 | May 30, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2451 ) | D | Magical Tiered Cake | PROGRAMMING | constructive algorithms dfs and similar dp greedy |
Alice has finished a magical tiered cake with (n) magical layers, where each layer is smaller than all layers below it (i.e. the first layer is the smallest, the (n)-th layer is the largest). Now, she needs your help to transport it from her kitchen to the party site. Since moving the whole cake at once is impossible, she also prepares a warehouse for you to ease the transportation process. Since the cake is magical, the (i)-th layer of cake is movable if and only if there are exactly (a_i) layers of cake above it. In each move, you can choose exactly one movable layer of cake from any location and move it on top of the tiered cake in any other location. However, to preserve a structure of the cake, the moved layer has to be on the layer that is strictly larger than it if there is a tiered cake at the destination. For example, you cannot move a layer with size (4) on top of a location where there is already a layer with size (3). The party is starting soon, so we need to move fast. Help Alice transport the cake to the party within (2^n) moves or report that it is impossible. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10000)). The description of the test cases follows. The first line of each test case contains an integer (n) ((1 \le n \le 20)) – the number of layers in the magical tiered cake. The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((0 \leq a_i \leq n)), which represent how many layers of cake need to be above the (i)-th layer for it to be movable. It is guaranteed that the sum of (2^n) across all test cases does not exceed (2^{20}). For each test case, if it is impossible to move the magical tiered cake to the party site, output NO . Otherwise, on the first line, output YES . Then, on the next line, output an integer (k) ((0 \leq k \leq 2^n)) – the number of moves you make to trans |
| Codeforces Round 1101 (Div. 2) — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 376693143 | Abhishek-updy | D | May 30, 2026, 4:15 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 171 | 15052800 | ||
| 376702330 | 24je0235 | D | May 30, 2026, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 8806400 | ||
| 376730065 | thecff | D | May 31, 2026, 2:02 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 12697600 | ||
| 376704822 | PantalQ | D | May 30, 2026, 5:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 14950400 | ||
| 376704819 | _Dragon_ | D | May 30, 2026, 5:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 14950400 | ||
| 376701166 | DBXZHAO | D | May 30, 2026, 4:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 14950400 | ||
| 376698599 | wisezentrum | D | May 30, 2026, 4:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 14950400 | ||
| 376691262 | j3ss | D | May 30, 2026, 4:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 187 | 14950400 | ||
| 376695820 | Robisama | D | May 30, 2026, 4:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 14950400 | ||
| 376689485 | soniashutosh | D | May 30, 2026, 4:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 14950400 | ||
| 376695983 | UltimateAAJ | D | May 30, 2026, 4:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 102400 | ||
| 376694387 | lbmzxhb | D | May 30, 2026, 4:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 35532800 | ||
| 376698164 | E49869826 | D | May 30, 2026, 4:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 8806400 | ||
| 376696506 | Madhvansh | D | May 30, 2026, 4:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 8806400 | ||
| 376701838 | Pia_owo | D | May 30, 2026, 4:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16588800 | ||
| 376701235 | donghedd | D | May 30, 2026, 4:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16588800 | ||
| 376696080 | upobir | D | May 30, 2026, 4:22 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16588800 | ||
| 376743003 | xuan_never | D | May 31, 2026, 5:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16691200 | ||
| 376734380 | FlowerandYou | D | May 31, 2026, 3:33 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16691200 | ||
| 376695230 | Bruh- | D | May 30, 2026, 4:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 156 | 16691200 | ||
| 376696680 | __yun__ | D | May 30, 2026, 4:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 46 | 37683200 | ||
| 376698404 | Oh_no_matopoeia | D | May 30, 2026, 4:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 62 | 25088000 | ||
| 376733902 | maspy | D | May 31, 2026, 3:22 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 78 | 16896000 | ||
| 376729967 | ColdestKyurem | D | May 31, 2026, 2 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 125 | 9830400 | ||
| 376692011 | tkdqmx | D | May 30, 2026, 4:12 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 16691200 | ||
| 376728941 | Aasino | D | May 31, 2026, 1:29 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 16793600 | ||
| 376699062 | grape_king | D | May 30, 2026, 4:28 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 16793600 | ||
| 376704776 | suzumi | D | May 30, 2026, 5:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 140 | 36352000 | ||
| 376742860 | Illyasv1el | D | May 31, 2026, 5:38 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 16691200 | ||
| 376739663 | Arpa | D | May 31, 2026, 4:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 16691200 | ||
| 376696274 | pengin_2000 | D | May 30, 2026, 4:22 p.m. | OK | GNU C11 | TESTS | 30 | 265 | 13209600 | ||
| 376695916 | raghav_guptaa | D | May 30, 2026, 4:21 p.m. | OK | Java 21 | TESTS | 30 | 359 | 25190400 | ||
| 376693122 | Garcia_Messy | D | May 30, 2026, 4:15 p.m. | OK | Java 21 | TESTS | 30 | 375 | 21913600 | ||
| 376693632 | Prashant_yadav1 | D | May 30, 2026, 4:16 p.m. | OK | Java 21 | TESTS | 30 | 375 | 38502400 | ||
| 376711302 | hg_2005 | D | May 30, 2026, 6:33 p.m. | OK | Java 21 | TESTS | 30 | 484 | 11571200 | ||
| 376699050 | _kazuto_nwb | D | May 30, 2026, 4:28 p.m. | OK | Java 21 | TESTS | 30 | 484 | 11776000 | ||
| 376735092 | bankaiiii | D | May 31, 2026, 3:47 a.m. | OK | Java 21 | TESTS | 30 | 578 | 16281600 | ||
| 376739793 | GuLLu05 | D | May 31, 2026, 4:54 a.m. | OK | Java 21 | TESTS | 30 | 593 | 80691200 | ||
| 376690071 | vineetiwari | D | May 30, 2026, 4:08 p.m. | OK | Java 21 | TESTS | 30 | 609 | 37990400 | ||
| 376726744 | vineetiwari | D | May 31, 2026, 12:01 a.m. | OK | Java 21 | TESTS | 30 | 625 | 52019200 | ||
| 376733014 | oishiki22 | D | May 31, 2026, 3:04 a.m. | OK | Java 21 | TESTS | 30 | 734 | 130662400 | ||
| 376692696 | nishchaysharma | D | May 30, 2026, 4:14 p.m. | OK | Java 8 | TESTS | 30 | 500 | 37273600 | ||
| 376693274 | yash_says_hi | D | May 30, 2026, 4:15 p.m. | OK | PyPy 3-64 | TESTS | 30 | 484 | 82739200 | ||
| 376693260 | Puddles_Penguin | D | May 30, 2026, 4:15 p.m. | OK | PyPy 3-64 | TESTS | 30 | 484 | 91033600 | ||
| 376689961 | APTXmas4869 | D | May 30, 2026, 4:08 p.m. | OK | PyPy 3-64 | TESTS | 30 | 500 | 130150400 | ||
| 376689861 | ayuchee | D | May 30, 2026, 4:08 p.m. | OK | PyPy 3-64 | TESTS | 30 | 515 | 86118400 | ||
| 376696836 | dbw123 | D | May 30, 2026, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 30 | 546 | 88166400 | ||
| 376716201 | Meitnera1n | D | May 30, 2026, 7:31 p.m. | OK | PyPy 3-64 | TESTS | 30 | 625 | 41062400 | ||
| 376697470 | po_dragon_warrior | D | May 30, 2026, 4:24 p.m. | OK | PyPy 3-64 | TESTS | 30 | 656 | 84582400 | ||
| 376741147 | PhoenixLegacy | D | May 31, 2026, 5:14 a.m. | OK | PyPy 3-64 | TESTS | 30 | 796 | 88371200 | ||
| 376705775 | shi_logic | D | May 30, 2026, 5:37 p.m. | OK | PyPy 3-64 | TESTS | 30 | 812 | 82124800 | ||
| 376693767 | Harshedh_V | D | May 30, 2026, 4:16 p.m. | OK | PyPy 3-64 | TESTS | 30 | 1000 | 185651200 | ||
| 376699417 | janmenjayap | D | May 30, 2026, 4:29 p.m. | OK | Python 3 | TESTS | 30 | 703 | 158720000 | ||
| 376735513 | aaraverma7 | D | May 31, 2026, 3:55 a.m. | OK | Python 3 | TESTS | 30 | 890 | 157286400 | ||
| 376699429 | slak_4248 | D | May 30, 2026, 4:29 p.m. | OK | Python 3 | TESTS | 30 | 921 | 40140800 | ||
| 376691060 | MinhPham2204 | D | May 30, 2026, 4:10 p.m. | OK | Python 3 | TESTS | 30 | 1281 | 158310400 | ||
| 376693381 | Faithnhope | D | May 30, 2026, 4:16 p.m. | OK | Python 3 | TESTS | 30 | 1593 | 61542400 | ||
| 376692334 | SaucyFries69 | D | May 30, 2026, 4:13 p.m. | OK | Rust 2024 | TESTS | 30 | 109 | 11776000 | ||
| 376743966 | Tantellam | D | May 31, 2026, 5:52 a.m. | OK | Rust 2024 | TESTS | 30 | 453 | 47513600 |
Back to search problems