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 |
---|---|---|---|---|---|---|
1696 | Codeforces Global Round 21 | FINISHED | False | 8100 | 81098663 | June 25, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 22860 ) | B | NIT Destroys the Universe | PROGRAMMING | greedy |
B'For a collection of integers S , define operatorname{mex}(S) as the smallest non-negative integer that does not appear in S . NIT, the cleaver, decides to destroy the universe. He is not so powerful as Thanos, so he can only destroy the universe by snapping his fingers several times. The universe can be represented as a 1-indexed array a of length n . When NIT snaps his fingers, he does the following operation on the array: We say the universe is destroyed if and only if for all 1 <= i <= n , a_i=0 holds. Find the minimum number of times NIT needs to snap his fingers to destroy the universe. That is, find the minimum number of operations NIT needs to perform to make all elements in the array equal to 0 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains one integer n ( 1 <= n <= 10^5 ). The second line of each test case contains n integers a_1 , a_2 , ldots , a_n ( 0 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print one integer -- the answer to the problem. In the first test case, we do 0 operations and all elements in the array are already equal to 0 . In the second test case, one optimal way is doing the operation with l=2 , r=5 . In the third test case, one optimal way is doing the operation twice, respectively with l=4 , r=4 and l=2 , r=6 . In the fourth test case, one optimal way is doing the operation with l=1 , r=1 . '... |
Editorial of Codeforces Global Round 21 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
161804631 | tgehr | B | June 25, 2022, 6:21 p.m. | OK | D | TESTS | 13 | 61 | 16998400 | ||
161788875 | scottdavidjones360 | B | June 25, 2022, 4:20 p.m. | OK | GNU C11 | TESTS | 13 | 62 | 3686400 | ||
161810899 | MohammadDallash | B | June 25, 2022, 7:55 p.m. | OK | GNU C11 | TESTS | 13 | 62 | 4096000 | ||
161821144 | abusayeid | B | June 26, 2022, 1:22 a.m. | OK | GNU C11 | TESTS | 13 | 62 | 4096000 | ||
161829361 | A_Z_NATH | B | June 26, 2022, 5:06 a.m. | OK | GNU C11 | TESTS | 13 | 62 | 4096000 | ||
161799505 | Abhishek_Tewatia | B | June 25, 2022, 5:36 p.m. | OK | GNU C11 | TESTS | 13 | 77 | 4096000 | ||
161817278 | trassis | B | June 25, 2022, 10:41 p.m. | OK | GNU C11 | TESTS | 13 | 78 | 4096000 | ||
161825998 | luogu_bot5 | B | June 26, 2022, 3:45 a.m. | OK | GNU C++14 | TESTS | 13 | 31 | 1843200 | ||
161799928 | tripplet | B | June 25, 2022, 5:38 p.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161804263 | baraah | B | June 25, 2022, 6:17 p.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161825360 | Mr__Peanutbutter | B | June 26, 2022, 3:28 a.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161822707 | Jasper08 | B | June 26, 2022, 2:14 a.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161813216 | imObscure | B | June 25, 2022, 8:43 p.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161804984 | atharva_0307 | B | June 25, 2022, 6:25 p.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1024000 | ||
161829892 | yanchengzhi | B | June 26, 2022, 5:16 a.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1433600 | ||
161830547 | ishalgarg.19je0384 | B | June 26, 2022, 5:30 a.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1433600 | ||
161829203 | the_conqueror_ | B | June 26, 2022, 5:03 a.m. | OK | GNU C++14 | TESTS | 13 | 46 | 1433600 | ||
161805748 | mtasfi | B | June 25, 2022, 6:34 p.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1024000 | ||
161819167 | YHSifat | B | June 26, 2022, midnight | OK | GNU C++17 | TESTS | 13 | 31 | 1433600 | ||
161800339 | WalaaAbdElhady | B | June 25, 2022, 5:40 p.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1433600 | ||
161829479 | gautamgosain04 | B | June 26, 2022, 5:08 a.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1433600 | ||
161823572 | 1205691775 | B | June 26, 2022, 2:40 a.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1433600 | ||
161820666 | Durgeshmaurya07 | B | June 26, 2022, 1:04 a.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1638400 | ||
161821209 | _Skrthy | B | June 26, 2022, 1:25 a.m. | OK | GNU C++17 | TESTS | 13 | 31 | 1843200 | ||
161801810 | Stark_22 | B | June 25, 2022, 5:52 p.m. | OK | GNU C++17 | TESTS | 13 | 31 | 2662400 | ||
161827587 | janahmed | B | June 26, 2022, 4:26 a.m. | OK | GNU C++17 | TESTS | 13 | 46 | 1024000 | ||
161828947 | Bharat1612 | B | June 26, 2022, 4:57 a.m. | OK | GNU C++17 | TESTS | 13 | 46 | 1024000 | ||
161821998 | zzy0929 | B | June 26, 2022, 1:52 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 15 | 2662400 | ||
161807328 | FA19 | B | June 25, 2022, 6:56 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 30 | 1638400 | ||
161805584 | liyh | B | June 25, 2022, 6:32 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1228800 | ||
161807129 | kevinyang | B | June 25, 2022, 6:53 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1228800 | ||
161830934 | hemanshu02 | B | June 26, 2022, 5:36 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1228800 | ||
161830903 | Bananana. | B | June 26, 2022, 5:36 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1638400 | ||
161830977 | elena44xx | B | June 26, 2022, 5:37 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1638400 | ||
161829093 | Lukman03 | B | June 26, 2022, 5:01 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1638400 | ||
161828045 | kushvasaniya | B | June 26, 2022, 4:37 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1638400 | ||
161824212 | TrendBattles | B | June 26, 2022, 2:59 a.m. | OK | GNU C++17 (64) | TESTS | 13 | 31 | 1638400 | ||
161829302 | flashmt | B | June 26, 2022, 5:05 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 15 | 1638400 | ||
161824030 | ofcoursenotsh | B | June 26, 2022, 2:54 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 15 | 1945600 | ||
161809032 | BLET_KHAKIM | B | June 25, 2022, 7:22 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 15 | 2048000 | ||
161830136 | Nea1 | B | June 26, 2022, 5:21 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 1638400 | ||
161799613 | Dhruv_24 | B | June 25, 2022, 5:36 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 1638400 | ||
161822227 | vaibhavg_21 | B | June 26, 2022, 2 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 1638400 | ||
161831325 | sd_3009 | B | June 26, 2022, 5:44 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 2048000 | ||
161812821 | akritovandrey | B | June 25, 2022, 8:34 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 2048000 | ||
161811802 | parwani_ayush | B | June 25, 2022, 8:14 p.m. | OK | GNU C++20 (64) | TESTS | 13 | 30 | 2048000 | ||
161828009 | neha_sane | B | June 26, 2022, 4:36 a.m. | OK | GNU C++20 (64) | TESTS | 13 | 31 | 1228800 | ||
161817369 | moh.amr | B | June 25, 2022, 10:45 p.m. | OK | Go | TESTS | 13 | 93 | 6041600 | ||
161816025 | satyaa_78 | B | June 25, 2022, 9:59 p.m. | OK | Java 11 | TESTS | 13 | 156 | 25088000 | ||
161831813 | poopoop | B | June 26, 2022, 5:52 a.m. | OK | Java 11 | TESTS | 13 | 171 | 25190400 | ||
161802614 | jyoti360 | B | June 25, 2022, 5:59 p.m. | OK | Java 11 | TESTS | 13 | 171 | 25190400 | ||
161800192 | deepakjoshi6102 | B | June 25, 2022, 5:39 p.m. | OK | Java 11 | TESTS | 13 | 187 | 25190400 | ||
161826022 | mritunjayy | B | June 26, 2022, 3:46 a.m. | OK | Java 11 | TESTS | 13 | 187 | 25292800 | ||
161821562 | iamavalon | B | June 26, 2022, 1:39 a.m. | OK | Java 11 | TESTS | 13 | 187 | 25497600 | ||
161792380 | SkadiTheCorruptHeart | B | June 25, 2022, 4:33 p.m. | OK | Java 11 | TESTS | 13 | 202 | 25088000 | ||
161825372 | the_unseen | B | June 26, 2022, 3:28 a.m. | OK | Java 11 | TESTS | 13 | 202 | 25190400 | ||
161809453 | suhas5979 | B | June 25, 2022, 7:29 p.m. | OK | Java 11 | TESTS | 13 | 217 | 25190400 | ||
161803116 | Extradict | B | June 25, 2022, 6:04 p.m. | OK | Java 11 | TESTS | 13 | 218 | 25395200 | ||
161812529 | abhinavTalesra | B | June 25, 2022, 8:28 p.m. | OK | Java 8 | TESTS | 13 | 109 | 19456000 | ||
161803890 | gssakash | B | June 25, 2022, 6:13 p.m. | OK | Java 8 | TESTS | 13 | 109 | 19456000 | ||
161809623 | RONIN786 | B | June 25, 2022, 7:32 p.m. | OK | Java 8 | TESTS | 13 | 124 | 19353600 | ||
161816398 | ayafayed | B | June 25, 2022, 10:11 p.m. | OK | Java 8 | TESTS | 13 | 124 | 19456000 | ||
161815901 | Koka | B | June 25, 2022, 9:55 p.m. | OK | Java 8 | TESTS | 13 | 124 | 19456000 | ||
161810957 | DylanSmith | B | June 25, 2022, 7:56 p.m. | OK | Java 8 | TESTS | 13 | 124 | 19456000 | ||
161799969 | amit_roy | B | June 25, 2022, 5:38 p.m. | OK | Java 8 | TESTS | 13 | 124 | 19456000 | ||
161814027 | snowyrsb | B | June 25, 2022, 9:03 p.m. | OK | Java 8 | TESTS | 13 | 155 | 19456000 | ||
161804443 | Hajan | B | June 25, 2022, 6:19 p.m. | OK | Java 8 | TESTS | 13 | 171 | 19456000 | ||
161808636 | rish1896 | B | June 25, 2022, 7:16 p.m. | OK | Java 8 | TESTS | 13 | 217 | 19865600 | ||
161791064 | Bloodwyn | B | June 25, 2022, 4:28 p.m. | OK | Kotlin 1.6 | TESTS | 13 | 311 | 29696000 | ||
161813521 | bhawani0910 | B | June 25, 2022, 8:50 p.m. | OK | Kotlin 1.6 | TESTS | 13 | 312 | 29593600 | ||
161809873 | SlavaG | B | June 25, 2022, 7:37 p.m. | OK | Kotlin 1.6 | TESTS | 13 | 312 | 29593600 | ||
161819049 | muhatmud | B | June 25, 2022, 11:55 p.m. | OK | MS C++ 2017 | TESTS | 13 | 46 | 2355200 | ||
161786599 | liuyongjieyyds | B | June 25, 2022, 4:12 p.m. | OK | MS C++ 2017 | TESTS | 13 | 140 | 41164800 | ||
161795525 | AnkitaJain06 | B | June 25, 2022, 4:45 p.m. | OK | MS C++ 2017 | TESTS | 13 | 170 | 3788800 | ||
161791640 | cernlhcalpha123 | B | June 25, 2022, 4:30 p.m. | OK | MS C++ 2017 | TESTS | 13 | 171 | 1945600 | ||
161788924 | knitin2604 | B | June 25, 2022, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 13 | 171 | 2048000 | ||
161814165 | S.K.Niranjan | B | June 25, 2022, 9:07 p.m. | OK | MS C++ 2017 | TESTS | 13 | 186 | 2560000 | ||
161802637 | n.n.n.kz | B | June 25, 2022, 5:59 p.m. | OK | PHP | TESTS | 13 | 61 | 15462400 | ||
161816287 | voicon | B | June 25, 2022, 10:07 p.m. | OK | PyPy 3 | TESTS | 13 | 217 | 30208000 | ||
161791816 | quandum | B | June 25, 2022, 4:31 p.m. | OK | PyPy 3 | TESTS | 13 | 280 | 30515200 | ||
161820824 | grawlixes | B | June 26, 2022, 1:10 a.m. | OK | PyPy 3 | TESTS | 13 | 280 | 30617600 | ||
161793659 | gesuta | B | June 25, 2022, 4:38 p.m. | OK | PyPy 3 | TESTS | 13 | 295 | 30310400 | ||
161810031 | joaoandreotti | B | June 25, 2022, 7:39 p.m. | OK | PyPy 3 | TESTS | 13 | 389 | 28364800 | ||
161790369 | joon98 | B | June 25, 2022, 4:26 p.m. | OK | PyPy 3 | TESTS | 13 | 390 | 30720000 | ||
161788390 | ahmedFaiyaz | B | June 25, 2022, 4:18 p.m. | OK | PyPy 3 | TESTS | 13 | 405 | 29696000 | ||
161826073 | rasheed_ashen_one | B | June 26, 2022, 3:48 a.m. | OK | PyPy 3 | TESTS | 13 | 420 | 30310400 | ||
161790262 | light_yagami52 | B | June 25, 2022, 4:25 p.m. | OK | PyPy 3 | TESTS | 13 | 436 | 28774400 | ||
161807477 | Avirup_R | B | June 25, 2022, 6:59 p.m. | OK | PyPy 3 | TESTS | 13 | 451 | 29900800 | ||
161831574 | simar0507 | B | June 26, 2022, 5:48 a.m. | OK | PyPy 3-64 | TESTS | 13 | 109 | 48844800 | ||
161808185 | mayank35 | B | June 25, 2022, 7:09 p.m. | OK | PyPy 3-64 | TESTS | 13 | 124 | 49049600 | ||
161808895 | only_for_kav_tripathi | B | June 25, 2022, 7:20 p.m. | OK | PyPy 3-64 | TESTS | 13 | 140 | 46694400 | ||
161832149 | abhijeet.panihar.cse20 | B | June 26, 2022, 5:58 a.m. | OK | PyPy 3-64 | TESTS | 13 | 187 | 48332800 | ||
161816177 | hsh8086 | B | June 25, 2022, 10:04 p.m. | OK | PyPy 3-64 | TESTS | 13 | 187 | 49561600 | ||
161804718 | sumit_athani | B | June 25, 2022, 6:22 p.m. | OK | PyPy 3-64 | TESTS | 13 | 218 | 49152000 | ||
161786777 | Allless | B | June 25, 2022, 4:13 p.m. | OK | PyPy 3-64 | TESTS | 13 | 218 | 50380800 | ||
161805479 | sami02jain | B | June 25, 2022, 6:30 p.m. | OK | PyPy 3-64 | TESTS | 13 | 264 | 50380800 | ||
161828224 | sjNxksbzj | B | June 26, 2022, 4:41 a.m. | OK | PyPy 3-64 | TESTS | 13 | 265 | 48435200 | ||
161801935 | shiviDON | B | June 25, 2022, 5:53 p.m. | OK | PyPy 3-64 | TESTS | 13 | 296 | 56320000 | ||
161823346 | xumengxing123 | B | June 26, 2022, 2:32 a.m. | OK | Python 3 | TESTS | 13 | 78 | 9523200 | ||
161791658 | bissenbay | B | June 25, 2022, 4:31 p.m. | OK | Python 3 | TESTS | 13 | 109 | 10240000 | ||
161804449 | Deepanshu21249 | B | June 25, 2022, 6:19 p.m. | OK | Python 3 | TESTS | 13 | 124 | 9932800 | ||
161800470 | Sorcerer_Supreme | B | June 25, 2022, 5:41 p.m. | OK | Python 3 | TESTS | 13 | 171 | 9318400 | ||
161831928 | ji-li-k | B | June 26, 2022, 5:54 a.m. | OK | Python 3 | TESTS | 13 | 171 | 10342400 | ||
161803391 | Santhosh44 | B | June 25, 2022, 6:07 p.m. | OK | Python 3 | TESTS | 13 | 186 | 10444800 | ||
161796208 | brainstorming | B | June 25, 2022, 4:47 p.m. | OK | Python 3 | TESTS | 13 | 187 | 10444800 | ||
161820401 | KALDESH | B | June 26, 2022, 12:53 a.m. | OK | Python 3 | TESTS | 13 | 202 | 10240000 | ||
161815067 | michaleproff | B | June 25, 2022, 9:30 p.m. | OK | Python 3 | TESTS | 13 | 202 | 10342400 | ||
161804108 | Deepanshu21249 | B | June 25, 2022, 6:15 p.m. | OK | Python 3 | TESTS | 13 | 202 | 10342400 | ||
161795060 | macosta | B | June 25, 2022, 4:43 p.m. | OK | Rust 2021 | TESTS | 13 | 93 | 8192000 |
Back to search problems