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 |
---|---|---|---|---|---|---|
1881 | Codeforces Round 903 (Div. 3) | FINISHED | False | 8100 | 34701899 | Oct. 12, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14631 ) | E | Block Sequence | PROGRAMMING | dp |
B'Given a sequence of integers a of length n . A sequence is called beautiful if it has the form of a series of blocks, each starting with its length, i.e., first comes the length of the block, and then its elements. For example, the sequences [ color{red}{3}, color{red}{3}, color{red}{4}, color{red}{5}, color{green}{2}, color{green}{6}, color{green}{1} ] and [ color{red}{1}, color{red}{8}, color{green}{4}, color{green}{5}, color{green}{2}, color{green}{6}, color{green}{1} ] are beautiful (different blocks are colored differently), while [ 1 ], [ 1, 4, 3 ], [ 3, 2, 1 ] are not. In one operation, you can remove any element from the sequence. What is the minimum number of operations required to make the given sequence beautiful? The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then follows the descriptions of the test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the sequence a . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ) -- the elements of the sequence a . It is guaranteed that the sum of the values of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single number -- the minimum number of deletions required to make the sequence a beautiful. In the first test case of the example, the given sequence is already beautiful, as shown in the statement. In the second test case of the example, the sequence can only be made beautiful by removing all elements from it. In the fifth test case of the example, the sequence can be made beautiful by removing the first and last elements. Then the sequence will become [ 2, 3, 4 ]. '... |
121327 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
227925372 | Alfafox | E | Oct. 12, 2023, 4:53 p.m. | OK | C# 10 | TESTS | 12 | 124 | 16896000 | ||
227933264 | OUyio | E | Oct. 12, 2023, 5:33 p.m. | OK | Clang++20 Diagnostics | TESTS | 12 | 780 | 7372800 | ||
227961010 | lhy123 | E | Oct. 13, 2023, 12:15 a.m. | OK | GNU C++14 | TESTS | 12 | 15 | 4505600 | ||
227978417 | LeonardLiu | E | Oct. 13, 2023, 5:14 a.m. | OK | GNU C++14 | TESTS | 12 | 46 | 1638400 | ||
227962686 | zltzlt | E | Oct. 13, 2023, 12:57 a.m. | OK | GNU C++14 | TESTS | 12 | 46 | 1638400 | ||
227956781 | omeganot | E | Oct. 12, 2023, 10:17 p.m. | OK | GNU C++14 | TESTS | 12 | 46 | 1638400 | ||
227934035 | Marios.K.R.Marouditsis | E | Oct. 12, 2023, 5:39 p.m. | OK | GNU C++14 | TESTS | 12 | 46 | 1638400 | ||
227968782 | EDGW_ | E | Oct. 13, 2023, 2:52 a.m. | OK | GNU C++14 | TESTS | 12 | 46 | 2457600 | ||
227968112 | 1271920576 | E | Oct. 13, 2023, 2:41 a.m. | OK | GNU C++14 | TESTS | 12 | 46 | 6348800 | ||
227977689 | lingo2 | E | Oct. 13, 2023, 5:04 a.m. | OK | GNU C++14 | TESTS | 12 | 61 | 1638400 | ||
227974572 | jtw03 | E | Oct. 13, 2023, 4:21 a.m. | OK | GNU C++14 | TESTS | 12 | 61 | 3174400 | ||
227924124 | _HossamYehia_ | E | Oct. 12, 2023, 4:49 p.m. | OK | GNU C++14 | TESTS | 12 | 61 | 7987200 | ||
227952481 | expertaq | E | Oct. 12, 2023, 8:52 p.m. | OK | GNU C++17 | TESTS | 12 | 31 | 1536000 | ||
227951248 | jhw0406 | E | Oct. 12, 2023, 8:35 p.m. | OK | GNU C++17 | TESTS | 12 | 46 | 1638400 | ||
227930681 | Module_Collision | E | Oct. 12, 2023, 5:17 p.m. | OK | GNU C++17 | TESTS | 12 | 46 | 1638400 | ||
227928949 | Radiaa | E | Oct. 12, 2023, 5:08 p.m. | OK | GNU C++17 | TESTS | 12 | 46 | 1638400 | ||
227927066 | HumbleCoder1234 | E | Oct. 12, 2023, 4:59 p.m. | OK | GNU C++17 | TESTS | 12 | 46 | 1638400 | ||
227931303 | learningdaily | E | Oct. 12, 2023, 5:21 p.m. | OK | GNU C++17 | TESTS | 12 | 46 | 3174400 | ||
227980210 | __KIET___ | E | Oct. 13, 2023, 5:35 a.m. | OK | GNU C++17 | TESTS | 12 | 61 | 1638400 | ||
227967740 | AnthonyZ | E | Oct. 13, 2023, 2:35 a.m. | OK | GNU C++17 | TESTS | 12 | 61 | 1638400 | ||
227963715 | Mhamad_aboaljood | E | Oct. 13, 2023, 1:19 a.m. | OK | GNU C++17 | TESTS | 12 | 61 | 1638400 | ||
227963622 | Ichimaru31 | E | Oct. 13, 2023, 1:17 a.m. | OK | GNU C++17 | TESTS | 12 | 61 | 1638400 | ||
227977281 | gardenbetweens | E | Oct. 13, 2023, 4:59 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227977266 | Rogi52 | E | Oct. 13, 2023, 4:58 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227964834 | shiro53 | E | Oct. 13, 2023, 1:41 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227961450 | littlegirl112 | E | Oct. 13, 2023, 12:26 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227949272 | MahmoudAbusalem | E | Oct. 12, 2023, 8:08 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227927750 | stillnothm | E | Oct. 12, 2023, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 1638400 | ||
227976698 | lakshmankattunga | E | Oct. 13, 2023, 4:51 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 3174400 | ||
227928104 | Cosysl | E | Oct. 12, 2023, 5:04 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 3174400 | ||
227927938 | MUNISJONI_KHURSHEDJON | E | Oct. 12, 2023, 5:03 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 3993600 | ||
227973504 | Elderidge | E | Oct. 13, 2023, 4:04 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 4812800 | ||
227962932 | cmk666 | E | Oct. 13, 2023, 1:03 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 15 | 2867200 | ||
227973843 | _Golem_ | E | Oct. 13, 2023, 4:09 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 15 | 23244800 | ||
227981371 | happymore | E | Oct. 13, 2023, 5:47 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 30 | 1638400 | ||
227959074 | arodnap33 | E | Oct. 12, 2023, 11:20 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 30 | 1638400 | ||
227966867 | xiaoxiaoxiaozhou | E | Oct. 13, 2023, 2:21 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 30 | 3174400 | ||
227927555 | CCSU_YZT | E | Oct. 12, 2023, 5:01 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 819200 | ||
227980935 | Light_Cone | E | Oct. 13, 2023, 5:43 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 1638400 | ||
227979916 | KH22.Serge_ | E | Oct. 13, 2023, 5:32 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 1638400 | ||
227976703 | 17821147 | E | Oct. 13, 2023, 4:51 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 1638400 | ||
227976318 | DhruvP | E | Oct. 13, 2023, 4:46 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 31 | 1638400 | ||
227957800 | katomasao | E | Oct. 12, 2023, 10:44 p.m. | OK | Haskell | TESTS | 12 | 124 | 32563200 | ||
227945771 | catOWO2011 | E | Oct. 12, 2023, 7:26 p.m. | OK | Java 11 | TESTS | 12 | 187 | 0 | ||
227943997 | dheerajchhatanidc | E | Oct. 12, 2023, 7:07 p.m. | OK | Java 11 | TESTS | 12 | 217 | 0 | ||
227971810 | wdjuruo | E | Oct. 13, 2023, 3:40 a.m. | OK | Java 11 | TESTS | 12 | 248 | 15462400 | ||
227936073 | thakur6393 | E | Oct. 12, 2023, 5:56 p.m. | OK | Java 11 | TESTS | 12 | 249 | 14950400 | ||
227939020 | kasiru_69 | E | Oct. 12, 2023, 6:20 p.m. | OK | Java 11 | TESTS | 12 | 265 | 15052800 | ||
227971629 | wdjuruo | E | Oct. 13, 2023, 3:37 a.m. | OK | Java 11 | TESTS | 12 | 280 | 15462400 | ||
227958699 | themadknight45 | E | Oct. 12, 2023, 11:08 p.m. | OK | Java 11 | TESTS | 12 | 296 | 20992000 | ||
227954374 | Kempachi | E | Oct. 12, 2023, 9:25 p.m. | OK | Java 11 | TESTS | 12 | 342 | 108134400 | ||
227982098 | PlayDate | E | Oct. 13, 2023, 5:56 a.m. | OK | Java 11 | TESTS | 12 | 436 | 12390400 | ||
227941906 | vaibhav_1710 | E | Oct. 12, 2023, 6:47 p.m. | OK | Java 17 | TESTS | 12 | 233 | 614400 | ||
227942864 | rajr86642 | E | Oct. 12, 2023, 6:55 p.m. | OK | Java 17 | TESTS | 12 | 264 | 33996800 | ||
227933138 | AKhacks | E | Oct. 12, 2023, 5:32 p.m. | OK | Java 17 | TESTS | 12 | 265 | 21504000 | ||
227964579 | dilshar23 | E | Oct. 13, 2023, 1:36 a.m. | OK | Java 17 | TESTS | 12 | 311 | 11673600 | ||
227951730 | trashh | E | Oct. 12, 2023, 8:41 p.m. | OK | Java 17 | TESTS | 12 | 358 | 49152000 | ||
227974986 | SneakyTam | E | Oct. 13, 2023, 4:27 a.m. | OK | Java 17 | TESTS | 12 | 467 | 409600 | ||
227937632 | mohit1510 | E | Oct. 12, 2023, 6:09 p.m. | OK | Java 17 | TESTS | 12 | 499 | 26112000 | ||
227934908 | yaroslavspid2 | E | Oct. 12, 2023, 5:46 p.m. | OK | Java 17 | TESTS | 12 | 576 | 26931200 | ||
227973612 | priyaroy3370 | E | Oct. 13, 2023, 4:06 a.m. | OK | Java 8 | TESTS | 12 | 109 | 0 | ||
227940668 | NerfThis | E | Oct. 12, 2023, 6:35 p.m. | OK | Java 8 | TESTS | 12 | 124 | 2764800 | ||
227945827 | sumitlaura101 | E | Oct. 12, 2023, 7:26 p.m. | OK | Java 8 | TESTS | 12 | 171 | 5939200 | ||
227945382 | Sumitsingh7 | E | Oct. 12, 2023, 7:21 p.m. | OK | Java 8 | TESTS | 12 | 171 | 5939200 | ||
227943978 | American_Eagle | E | Oct. 12, 2023, 7:07 p.m. | OK | Java 8 | TESTS | 12 | 186 | 14643200 | ||
227944647 | Sumitsingh7 | E | Oct. 12, 2023, 7:14 p.m. | OK | Java 8 | TESTS | 12 | 186 | 21708800 | ||
227975797 | amit_roy | E | Oct. 13, 2023, 4:39 a.m. | OK | Java 8 | TESTS | 12 | 327 | 0 | ||
227924431 | tranductri160703 | E | Oct. 12, 2023, 4:49 p.m. | OK | Java 8 | TESTS | 12 | 358 | 14438400 | ||
227938863 | _mistborn | E | Oct. 12, 2023, 6:19 p.m. | OK | Java 8 | TESTS | 12 | 374 | 11264000 | ||
227947952 | Ivan0500 | E | Oct. 12, 2023, 7:51 p.m. | OK | MS C++ 2017 | TESTS | 12 | 140 | 1638400 | ||
227960759 | andy562.dlg | E | Oct. 13, 2023, 12:07 a.m. | OK | MS C++ 2017 | TESTS | 12 | 155 | 3379200 | ||
227959221 | Olzlzlz | E | Oct. 12, 2023, 11:24 p.m. | OK | MS C++ 2017 | TESTS | 12 | 187 | 3174400 | ||
227930547 | shyam.kumar.agarwal1 | E | Oct. 12, 2023, 5:16 p.m. | OK | MS C++ 2017 | TESTS | 12 | 451 | 12800000 | ||
227947863 | 01_10 | E | Oct. 12, 2023, 7:50 p.m. | OK | PyPy 3 | TESTS | 12 | 202 | 21606400 | ||
227942392 | julondonor | E | Oct. 12, 2023, 6:51 p.m. | OK | PyPy 3 | TESTS | 12 | 389 | 18841600 | ||
227930014 | Saket_Ahlawat | E | Oct. 12, 2023, 5:13 p.m. | OK | PyPy 3 | TESTS | 12 | 436 | 19148800 | ||
227946630 | gardengnome | E | Oct. 12, 2023, 7:35 p.m. | OK | PyPy 3-64 | TESTS | 12 | 109 | 19660800 | ||
227932383 | 2020A7PS0273H_Sriram_S | E | Oct. 12, 2023, 5:28 p.m. | OK | PyPy 3-64 | TESTS | 12 | 109 | 19660800 | ||
227959746 | cy171 | E | Oct. 12, 2023, 11:39 p.m. | OK | PyPy 3-64 | TESTS | 12 | 109 | 20992000 | ||
227977922 | Imeon | E | Oct. 13, 2023, 5:07 a.m. | OK | PyPy 3-64 | TESTS | 12 | 109 | 26316800 | ||
227959549 | cybsbbb | E | Oct. 12, 2023, 11:33 p.m. | OK | PyPy 3-64 | TESTS | 12 | 124 | 20889600 | ||
227979119 | bruher | E | Oct. 13, 2023, 5:23 a.m. | OK | PyPy 3-64 | TESTS | 12 | 139 | 27238400 | ||
227968216 | vedantmishra69 | E | Oct. 13, 2023, 2:43 a.m. | OK | PyPy 3-64 | TESTS | 12 | 139 | 29696000 | ||
227929874 | its_believe | E | Oct. 12, 2023, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 12 | 140 | 26009600 | ||
227961079 | pyrogyx | E | Oct. 13, 2023, 12:17 a.m. | OK | PyPy 3-64 | TESTS | 12 | 140 | 27852800 | ||
227966558 | liuaaa | E | Oct. 13, 2023, 2:15 a.m. | OK | PyPy 3-64 | TESTS | 12 | 202 | 26316800 | ||
227952865 | daszybak | E | Oct. 12, 2023, 8:58 p.m. | OK | Python 3 | TESTS | 12 | 155 | 27955200 | ||
227974489 | MyTaeyeon | E | Oct. 13, 2023, 4:19 a.m. | OK | Python 3 | TESTS | 12 | 186 | 27136000 | ||
227977868 | PrakshalJain | E | Oct. 13, 2023, 5:06 a.m. | OK | Python 3 | TESTS | 12 | 217 | 27136000 | ||
227980347 | hato_ | E | Oct. 13, 2023, 5:37 a.m. | OK | Python 3 | TESTS | 12 | 218 | 28160000 | ||
227981448 | joshikawan | E | Oct. 13, 2023, 5:48 a.m. | OK | Python 3 | TESTS | 12 | 233 | 27136000 | ||
227929607 | mitilevv | E | Oct. 12, 2023, 5:11 p.m. | OK | Python 3 | TESTS | 12 | 248 | 27750400 | ||
227939386 | Akylz | E | Oct. 12, 2023, 6:23 p.m. | OK | Python 3 | TESTS | 12 | 249 | 26828800 | ||
227932110 | Akylz | E | Oct. 12, 2023, 5:26 p.m. | OK | Python 3 | TESTS | 12 | 264 | 26828800 | ||
227923925 | Surajk21 | E | Oct. 12, 2023, 4:49 p.m. | OK | Python 3 | TESTS | 12 | 265 | 27033600 | ||
227975968 | the_pyhulk | E | Oct. 13, 2023, 4:41 a.m. | OK | Python 3 | TESTS | 12 | 280 | 30412800 | ||
227967624 | DATVN | E | Oct. 13, 2023, 2:33 a.m. | OK | Rust 2021 | TESTS | 12 | 31 | 14848000 |
Back to search problems