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 |
---|---|---|---|---|---|---|
1839 | Codeforces Round 876 (Div. 2) | FINISHED | False | 7200 | 46020299 | June 3, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 12089 ) | C | Insert Zero and Invert Prefix | PROGRAMMING | constructive algorithms greedy |
B'You have a sequence a_1, a_2, ldots, a_n of length n , each element of which is either 0 or 1 , and a sequence b , which is initially empty. You are going to perform n operations. On each of them you will increase the length of b by 1 . You can find examples of operations in the Notes section. Determine if there exists a sequence of operations that makes b equal to a . If such sequence of operations exists, find it. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= n <= 10^5 ) -- the length of the sequence a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 1 ) -- the sequence a . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case: In the first test case, Hence, sequence b changes in the following way: [ ,] xrightarrow{p , = , 0} [ , underline{0} ,] xrightarrow{p , = , 0} [ , underline{0}, 0 ,] xrightarrow{p , = , 2} [ , 1, 1, underline{0} ,] xrightarrow{p , = , 1} [ , 0, underline{0}, 1, 0 ,] xrightarrow{p , = , 3} [ , 1, 1, 0, underline{0}, 0 ,] . In the end the sequence b is equal to the sequence a , so this way to perform operations is one of the correct answers. In the second test case, n = 1 and the only achiveable sequence b is [ , 0 , ] . In the third test case, there are six possible sequences of operations: None of them makes b equal to [ , 0, 1, 1 ,] , so the answer is "NO". '... |
Codeforces Round #876 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
208359881 | Alfafox | C | June 3, 2023, 6:50 p.m. | OK | C# 10 | TESTS | 15 | 405 | 9523200 | ||
208379800 | Aiden121pearce | C | June 4, 2023, 3:22 a.m. | OK | C# 10 | TESTS | 15 | 670 | 157388800 | ||
208360185 | Ayush_Dhingra | C | June 3, 2023, 6:54 p.m. | OK | Clang++17 Diagnostics | TESTS | 15 | 732 | 15052800 | ||
208342370 | ruban | C | June 3, 2023, 4:21 p.m. | OK | FPC | TESTS | 15 | 312 | 9830400 | ||
208352189 | NenadDapic | C | June 3, 2023, 5:27 p.m. | OK | FPC | TESTS | 15 | 326 | 512000 | ||
208337923 | 2000030958 | C | June 3, 2023, 4:06 p.m. | OK | GNU C11 | TESTS | 15 | 436 | 409600 | ||
208342734 | AnnVIK | C | June 3, 2023, 4:23 p.m. | OK | GNU C11 | TESTS | 15 | 452 | 409600 | ||
208337511 | onii_chann | C | June 3, 2023, 4:04 p.m. | OK | GNU C11 | TESTS | 15 | 452 | 409600 | ||
208343891 | AvikAB | C | June 3, 2023, 4:27 p.m. | OK | GNU C11 | TESTS | 15 | 467 | 409600 | ||
208348635 | iffatul_anon | C | June 3, 2023, 5:01 p.m. | OK | GNU C11 | TESTS | 15 | 467 | 819200 | ||
208345507 | shareef_32247 | C | June 3, 2023, 4:32 p.m. | OK | GNU C11 | TESTS | 15 | 468 | 409600 | ||
208337403 | Stark663 | C | June 3, 2023, 4:04 p.m. | OK | GNU C11 | TESTS | 15 | 468 | 409600 | ||
208343355 | harsh_fr | C | June 3, 2023, 4:25 p.m. | OK | GNU C11 | TESTS | 15 | 468 | 716800 | ||
208343371 | Smallorange | C | June 3, 2023, 4:25 p.m. | OK | GNU C11 | TESTS | 15 | 483 | 1331200 | ||
208338115 | 2000030370 | C | June 3, 2023, 4:06 p.m. | OK | GNU C11 | TESTS | 15 | 499 | 409600 | ||
208369039 | RohamOmidi | C | June 3, 2023, 9:24 p.m. | OK | GNU C++14 | TESTS | 15 | 30 | 5017600 | ||
208357098 | Nyemot | C | June 3, 2023, 6:16 p.m. | OK | GNU C++14 | TESTS | 15 | 31 | 409600 | ||
208384140 | PrasoonJha | C | June 4, 2023, 4:56 a.m. | OK | GNU C++14 | TESTS | 15 | 31 | 819200 | ||
208341820 | Kyzer1de | C | June 3, 2023, 4:19 p.m. | OK | GNU C++14 | TESTS | 15 | 31 | 819200 | ||
208374831 | CLOCKS_PER_SEC | C | June 4, 2023, 12:58 a.m. | OK | GNU C++14 | TESTS | 15 | 31 | 819200 | ||
208348228 | PPangpond | C | June 3, 2023, 4:59 p.m. | OK | GNU C++14 | TESTS | 15 | 31 | 921600 | ||
208335142 | zhuoxingmu | C | June 3, 2023, 3:57 p.m. | OK | GNU C++14 | TESTS | 15 | 31 | 1228800 | ||
208384155 | lgrey5338 | C | June 4, 2023, 4:56 a.m. | OK | GNU C++14 | TESTS | 15 | 31 | 1536000 | ||
208376862 | AC-Automation | C | June 4, 2023, 2:10 a.m. | OK | GNU C++14 | TESTS | 15 | 31 | 1536000 | ||
208357140 | Jhamra | C | June 3, 2023, 6:16 p.m. | OK | GNU C++14 | TESTS | 15 | 31 | 1536000 | ||
208382498 | SANYASI_RAJA | C | June 4, 2023, 4:21 a.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208372059 | Antoniopr | C | June 3, 2023, 11:04 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208372628 | dragon-slayer | C | June 3, 2023, 11:27 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208337303 | chunzhifeng | C | June 3, 2023, 4:04 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208339788 | ethkc256 | C | June 3, 2023, 4:12 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208344771 | IMMORTAL1941 | C | June 3, 2023, 4:30 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208346284 | _DEXTER__ | C | June 3, 2023, 4:34 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208350320 | leevox | C | June 3, 2023, 5:11 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208365036 | Jose_Juan__SE | C | June 3, 2023, 8:09 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208365377 | peterzhu | C | June 3, 2023, 8:14 p.m. | OK | GNU C++17 | TESTS | 15 | 31 | 409600 | ||
208342227 | whosedream | C | June 3, 2023, 4:21 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 30 | 409600 | ||
208341772 | tan1shqc | C | June 3, 2023, 4:19 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 30 | 2560000 | ||
208336961 | sischu74 | C | June 3, 2023, 4:02 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208384861 | awesomeguy856 | C | June 4, 2023, 5:09 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208378265 | Once_I_Liked_AGirl | C | June 4, 2023, 2:47 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208370148 | shuoxuanli | C | June 3, 2023, 9:55 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208356882 | monkey8 | C | June 3, 2023, 6:14 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208344083 | DevinX | C | June 3, 2023, 4:27 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 409600 | ||
208380387 | struggl3r | C | June 4, 2023, 3:35 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 819200 | ||
208382242 | 1250713087 | C | June 4, 2023, 4:15 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 31 | 819200 | ||
208337101 | Aniket-30 | C | June 3, 2023, 4:03 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 409600 | ||
208336665 | cmk666 | C | June 3, 2023, 4:02 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 614400 | ||
208343179 | Phuccc | C | June 3, 2023, 4:24 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 819200 | ||
208384310 | ak.mpbf | C | June 4, 2023, 4:59 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 819200 | ||
208343424 | Abdelrehman | C | June 3, 2023, 4:25 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 1024000 | ||
208366193 | laullelien | C | June 3, 2023, 8:28 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 1228800 | ||
208343970 | shailesh_2583 | C | June 3, 2023, 4:27 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 1638400 | ||
208338386 | ELmoza | C | June 3, 2023, 4:07 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 15 | 2252800 | ||
208387757 | DragonKingA | C | June 4, 2023, 5:54 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 30 | 0 | ||
208344514 | BeezMinh | C | June 3, 2023, 4:29 p.m. | OK | GNU C++20 (64) | TESTS | 15 | 30 | 409600 | ||
208339444 | koluchiy | C | June 3, 2023, 4:11 p.m. | OK | Go | TESTS | 15 | 93 | 3276800 | ||
208343284 | MrAIMStein | C | June 3, 2023, 4:25 p.m. | OK | Go | TESTS | 15 | 920 | 5939200 | ||
208336226 | ironpurush3039 | C | June 3, 2023, 4 p.m. | OK | Go | TESTS | 15 | 1029 | 4915200 | ||
208352200 | themadknight45 | C | June 3, 2023, 5:27 p.m. | OK | Java 11 | TESTS | 15 | 202 | 0 | ||
208368420 | InfinitePath | C | June 3, 2023, 9:10 p.m. | OK | Java 11 | TESTS | 15 | 217 | 0 | ||
208355491 | princeayush04 | C | June 3, 2023, 5:59 p.m. | OK | Java 11 | TESTS | 15 | 217 | 0 | ||
208337814 | 336699go | C | June 3, 2023, 4:05 p.m. | OK | Java 11 | TESTS | 15 | 217 | 0 | ||
208378546 | shubhargava | C | June 4, 2023, 2:54 a.m. | OK | Java 11 | TESTS | 15 | 218 | 0 | ||
208366234 | wat2 | C | June 3, 2023, 8:29 p.m. | OK | Java 11 | TESTS | 15 | 218 | 0 | ||
208347896 | kalzor | C | June 3, 2023, 4:58 p.m. | OK | Java 11 | TESTS | 15 | 233 | 0 | ||
208333896 | Panther369 | C | June 3, 2023, 3:53 p.m. | OK | Java 11 | TESTS | 15 | 233 | 0 | ||
208345758 | Yousef_Badr | C | June 3, 2023, 4:33 p.m. | OK | Java 11 | TESTS | 15 | 249 | 0 | ||
208372942 | nitinsutrave | C | June 3, 2023, 11:40 p.m. | OK | Java 11 | TESTS | 15 | 249 | 0 | ||
208342295 | LeetCodeforces_Null | C | June 3, 2023, 4:21 p.m. | OK | Java 17 | TESTS | 15 | 217 | 409600 | ||
208349926 | jimmyd211 | C | June 3, 2023, 5:08 p.m. | OK | Java 17 | TESTS | 15 | 218 | 512000 | ||
208335324 | Utsav82 | C | June 3, 2023, 3:57 p.m. | OK | Java 17 | TESTS | 15 | 218 | 716800 | ||
208342862 | meteoLdrago | C | June 3, 2023, 4:23 p.m. | OK | Java 17 | TESTS | 15 | 233 | 512000 | ||
208386239 | Srikanth1777 | C | June 4, 2023, 5:32 a.m. | OK | Java 17 | TESTS | 15 | 233 | 716800 | ||
208342804 | miminguci | C | June 3, 2023, 4:23 p.m. | OK | Java 17 | TESTS | 15 | 234 | 102400 | ||
208385298 | ManasR_2003 | C | June 4, 2023, 5:17 a.m. | OK | Java 17 | TESTS | 15 | 248 | 5632000 | ||
208358263 | thatsiddharth | C | June 3, 2023, 6:29 p.m. | OK | Java 17 | TESTS | 15 | 249 | 204800 | ||
208340880 | atheshwarank21cs | C | June 3, 2023, 4:16 p.m. | OK | Java 17 | TESTS | 15 | 249 | 204800 | ||
208384917 | Varun_tec | C | June 4, 2023, 5:10 a.m. | OK | Java 17 | TESTS | 15 | 264 | 307200 | ||
208348440 | vatsal_04 | C | June 3, 2023, 4:59 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208354508 | invincible777 | C | June 3, 2023, 5:50 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208352810 | Koka | C | June 3, 2023, 5:33 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208352785 | handle007 | C | June 3, 2023, 5:33 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208345984 | yuntae | C | June 3, 2023, 4:34 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208343416 | Sanat04 | C | June 3, 2023, 4:25 p.m. | OK | Java 8 | TESTS | 15 | 124 | 0 | ||
208340104 | _I_Am_No_One_ | C | June 3, 2023, 4:13 p.m. | OK | Java 8 | TESTS | 15 | 139 | 0 | ||
208335357 | medos2000 | C | June 3, 2023, 3:57 p.m. | OK | Java 8 | TESTS | 15 | 140 | 0 | ||
208341971 | amit_roy | C | June 3, 2023, 4:20 p.m. | OK | Java 8 | TESTS | 15 | 140 | 2457600 | ||
208348815 | raj_shahh | C | June 3, 2023, 5:02 p.m. | OK | Java 8 | TESTS | 15 | 156 | 38502400 | ||
208343306 | IvDmAl | C | June 3, 2023, 4:25 p.m. | OK | MS C++ 2017 | TESTS | 15 | 155 | 1536000 | ||
208386633 | Aayush5sep | C | June 4, 2023, 5:38 a.m. | OK | MS C++ 2017 | TESTS | 15 | 186 | 1945600 | ||
208339850 | ahtoh_ | C | June 3, 2023, 4:12 p.m. | OK | Node.js | TESTS | 15 | 124 | 10035200 | ||
208343596 | klu_2000031535 | C | June 3, 2023, 4:26 p.m. | OK | Perl | TESTS | 15 | 109 | 13926400 | ||
208341141 | 2000030077_manvitha | C | June 3, 2023, 4:17 p.m. | OK | Perl | TESTS | 15 | 156 | 18022400 | ||
208340721 | KrishnaSasank03 | C | June 3, 2023, 4:15 p.m. | OK | PHP | TESTS | 15 | 93 | 18944000 | ||
208342523 | xyxoro | C | June 3, 2023, 4:22 p.m. | OK | PyPy 3 | TESTS | 15 | 264 | 9932800 | ||
208382963 | nun | C | June 4, 2023, 4:32 a.m. | OK | PyPy 3 | TESTS | 15 | 373 | 12800000 | ||
208367627 | julondonor | C | June 3, 2023, 8:54 p.m. | OK | PyPy 3 | TESTS | 15 | 421 | 11059200 | ||
208367737 | monji | C | June 3, 2023, 8:56 p.m. | OK | PyPy 3 | TESTS | 15 | 451 | 12390400 | ||
208336865 | himanshuyadavhere | C | June 3, 2023, 4:02 p.m. | OK | PyPy 3 | TESTS | 15 | 467 | 11366400 | ||
208338894 | n_wisteria | C | June 3, 2023, 4:09 p.m. | OK | PyPy 3 | TESTS | 15 | 530 | 11161600 | ||
208373325 | Apass.Jack | C | June 3, 2023, 11:57 p.m. | OK | PyPy 3 | TESTS | 15 | 608 | 16384000 | ||
208341455 | PMiguelez | C | June 3, 2023, 4:18 p.m. | OK | PyPy 3-64 | TESTS | 15 | 124 | 13004800 | ||
208334430 | kagu | C | June 3, 2023, 3:54 p.m. | OK | PyPy 3-64 | TESTS | 15 | 124 | 15360000 | ||
208333865 | minhnguyen13082003 | C | June 3, 2023, 3:53 p.m. | OK | PyPy 3-64 | TESTS | 15 | 124 | 17817600 | ||
208362094 | lol_py | C | June 3, 2023, 7:23 p.m. | OK | PyPy 3-64 | TESTS | 15 | 139 | 15564800 | ||
208335124 | ErreurFatale | C | June 3, 2023, 3:57 p.m. | OK | PyPy 3-64 | TESTS | 15 | 155 | 13516800 | ||
208361999 | ossau_guildo | C | June 3, 2023, 7:22 p.m. | OK | PyPy 3-64 | TESTS | 15 | 155 | 15052800 | ||
208348507 | dipakgupta007 | C | June 3, 2023, 5 p.m. | OK | PyPy 3-64 | TESTS | 15 | 155 | 15564800 | ||
208380685 | thuonguyenvan | C | June 4, 2023, 3:40 a.m. | OK | PyPy 3-64 | TESTS | 15 | 155 | 16486400 | ||
208360294 | cybsbbb | C | June 3, 2023, 6:56 p.m. | OK | PyPy 3-64 | TESTS | 15 | 156 | 14540800 | ||
208387836 | Ana_naS | C | June 4, 2023, 5:55 a.m. | OK | PyPy 3-64 | TESTS | 15 | 171 | 15360000 | ||
208340337 | wzl722 | C | June 3, 2023, 4:14 p.m. | OK | Python 3 | TESTS | 15 | 124 | 11673600 | ||
208334156 | linhhlp | C | June 3, 2023, 3:54 p.m. | OK | Python 3 | TESTS | 15 | 124 | 12185600 | ||
208340958 | anshi13 | C | June 3, 2023, 4:16 p.m. | OK | Python 3 | TESTS | 15 | 155 | 5222400 | ||
208349852 | NS3081992 | C | June 3, 2023, 5:08 p.m. | OK | Python 3 | TESTS | 15 | 155 | 12492800 | ||
208338717 | Litvin_Vlad | C | June 3, 2023, 4:08 p.m. | OK | Python 3 | TESTS | 15 | 156 | 7680000 | ||
208338928 | qttw456 | C | June 3, 2023, 4:09 p.m. | OK | Python 3 | TESTS | 15 | 171 | 5120000 | ||
208341264 | Endu | C | June 3, 2023, 4:17 p.m. | OK | Python 3 | TESTS | 15 | 171 | 7168000 | ||
208387349 | arpitblagan27 | C | June 4, 2023, 5:48 a.m. | OK | Python 3 | TESTS | 15 | 171 | 13516800 | ||
208341581 | Arnab_Goyal | C | June 3, 2023, 4:18 p.m. | OK | Python 3 | TESTS | 15 | 187 | 3891200 | ||
208365421 | shashwat22473 | C | June 3, 2023, 8:15 p.m. | OK | Python 3 | TESTS | 15 | 187 | 13516800 | ||
208345007 | madalalakshmipriya998 | C | June 3, 2023, 4:31 p.m. | OK | Ruby 3 | TESTS | 15 | 311 | 9318400 | ||
208345688 | sameer_30639 | C | June 3, 2023, 4:33 p.m. | OK | Ruby 3 | TESTS | 15 | 312 | 9011200 | ||
208337798 | manoj_1438 | C | June 3, 2023, 4:05 p.m. | OK | Ruby 3 | TESTS | 15 | 327 | 9318400 | ||
208335896 | anandkumar4549 | C | June 3, 2023, 3:59 p.m. | OK | Ruby 3 | TESTS | 15 | 327 | 10752000 | ||
208347992 | YummyPie | C | June 3, 2023, 4:58 p.m. | OK | Rust 2021 | TESTS | 15 | 31 | 1331200 | ||
208333460 | aadmianonymous199 | C | June 3, 2023, 3:51 p.m. | OK | Rust 2021 | TESTS | 15 | 202 | 2867200 | ||
208383531 | thirtiseven | C | June 4, 2023, 4:43 a.m. | OK | Scala | TESTS | 15 | 936 | 3686400 |
Back to search problems