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 |
---|---|---|---|---|---|---|
1619 | Codeforces Round 762 (Div. 3) | FINISHED | False | 8100 | 91812299 | Dec. 20, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 9269 ) | E | MEX and Increments | PROGRAMMING | constructive algorithms data structures dp greedy math sortings |
B'Dmitry has an array of n non-negative integers a_1, a_2, ... , a_n . In one operation, Dmitry can choose any index j ( 1 <= j <= n ) and increase the value of the element a_j by 1 . He can choose the same index j multiple times. For each i from 0 to n , determine whether Dmitry can make the mathrm{MEX} of the array equal to exactly i . If it is possible, then determine the minimum number of operations to do it. The mathrm{MEX} of the array is equal to the minimum non-negative integer that is not in the array. For example, the mathrm{MEX} of the array [3, 1, 0] is equal to 2 , and the array [3, 3, 1, 4] is equal to 0 . The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the input. The descriptions of the test cases follow. The first line of the description of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the array a . The second line of the description of each test case contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= n ) -- elements of the array a . It is guaranteed that the sum of the values n over all test cases in the test does not exceed 2 cdot10^5 . For each test case, output n + 1 integer -- i -th number is equal to the minimum number of operations for which you can make the array mathrm{MEX} equal to i ( 0 <= i <= n ), or -1 if this cannot be done. In the first set of example inputs, n=3 : '... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
140215006 | parthu | E | Dec. 22, 2021, 2:15 a.m. | OK | GNU C11 | TESTS | 20 | 873 | 3174400 | ||
140214945 | parthu | E | Dec. 22, 2021, 2:14 a.m. | OK | GNU C11 | TESTS | 20 | 873 | 4812800 | ||
140214867 | parthu | E | Dec. 22, 2021, 2:10 a.m. | OK | GNU C11 | TESTS | 20 | 873 | 4812800 | ||
140215095 | parthu | E | Dec. 22, 2021, 2:19 a.m. | OK | GNU C11 | TESTS | 20 | 888 | 3174400 | ||
140214356 | maoyiting | E | Dec. 22, 2021, 1:53 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 2457600 | ||
140165784 | syf1201 | E | Dec. 21, 2021, 1:03 p.m. | OK | GNU C++14 | TESTS | 20 | 93 | 2457600 | ||
140142245 | peiwenjun | E | Dec. 21, 2021, 8:26 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 3174400 | ||
140168946 | toovegetable | E | Dec. 21, 2021, 1:35 p.m. | OK | GNU C++14 | TESTS | 20 | 93 | 3174400 | ||
140219521 | mc_rodrix99 | E | Dec. 22, 2021, 4:16 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 3993600 | ||
140210092 | Kareem_Khaled | E | Dec. 21, 2021, 10:50 p.m. | OK | GNU C++14 | TESTS | 20 | 93 | 4300800 | ||
140151741 | yassatamer99 | E | Dec. 21, 2021, 10:14 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 4812800 | ||
140136373 | WorrywartsL | E | Dec. 21, 2021, 7:17 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 5120000 | ||
140129453 | CN_pf_d | E | Dec. 21, 2021, 5:26 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 5734400 | ||
140122565 | s.vinci | E | Dec. 21, 2021, 3:01 a.m. | OK | GNU C++14 | TESTS | 20 | 93 | 6348800 | ||
140144678 | suda2027407028 | E | Dec. 21, 2021, 8:55 a.m. | OK | GNU C++17 | TESTS | 20 | 62 | 5222400 | ||
140134256 | AhamNom | E | Dec. 21, 2021, 6:52 a.m. | OK | GNU C++17 | TESTS | 20 | 78 | 3174400 | ||
140145749 | accidentallyPassBy | E | Dec. 21, 2021, 9:07 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 819200 | ||
140197460 | ThuylinhTran | E | Dec. 21, 2021, 6:26 p.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1331200 | ||
140129337 | S_Nayak | E | Dec. 21, 2021, 5:24 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140123912 | -21042002 | E | Dec. 21, 2021, 3:36 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140133990 | forverss | E | Dec. 21, 2021, 6:49 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140172220 | medeshi.kristian | E | Dec. 21, 2021, 2:09 p.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140216077 | Esraa_Taha309 | E | Dec. 22, 2021, 2:48 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140216937 | lys1280023 | E | Dec. 22, 2021, 3:12 a.m. | OK | GNU C++17 | TESTS | 20 | 93 | 1843200 | ||
140178529 | yara80814 | E | Dec. 21, 2021, 3:12 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 61 | 3788800 | ||
140109287 | jesse_pinkman_619 | E | Dec. 20, 2021, 7:53 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 2969600 | ||
140139430 | lord002 | E | Dec. 21, 2021, 7:53 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 3174400 | ||
140160748 | lcyyy | E | Dec. 21, 2021, 12:03 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 3379200 | ||
140214326 | Maxwell01 | E | Dec. 22, 2021, 1:52 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 3379200 | ||
140135293 | EmreQuang | E | Dec. 21, 2021, 7:03 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 4096000 | ||
140123323 | no_words_to_sky | E | Dec. 21, 2021, 3:20 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 4505600 | ||
140113416 | Blondie | E | Dec. 20, 2021, 9:19 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 5324800 | ||
140202265 | vishalagrawal | E | Dec. 21, 2021, 7:39 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 6451200 | ||
140175236 | s4r7h4k | E | Dec. 21, 2021, 2:39 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 62 | 9113600 | ||
140111351 | Pommes | E | Dec. 20, 2021, 8:33 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 2560000 | ||
140155590 | buidangnguyen05 | E | Dec. 21, 2021, 10:59 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 3379200 | ||
140197323 | kal013 | E | Dec. 21, 2021, 6:25 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 3788800 | ||
140155339 | buidangnguyen05 | E | Dec. 21, 2021, 10:56 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 4915200 | ||
140161850 | Piyush_kr | E | Dec. 21, 2021, 12:17 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 7475200 | ||
140181482 | Felerius | E | Dec. 21, 2021, 3:41 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 46 | 14131200 | ||
140110869 | RP_21 | E | Dec. 20, 2021, 8:25 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 61 | 2969600 | ||
140129327 | kshitij688 | E | Dec. 21, 2021, 5:24 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 61 | 3686400 | ||
140122787 | Boboge | E | Dec. 21, 2021, 3:06 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 61 | 3788800 | ||
140111684 | Bench0310 | E | Dec. 20, 2021, 8:40 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 61 | 4505600 | ||
140168229 | gawsfbet | E | Dec. 21, 2021, 1:29 p.m. | OK | Java 11 | TESTS | 20 | 249 | 0 | ||
140168377 | gawsfbet | E | Dec. 21, 2021, 1:30 p.m. | OK | Java 11 | TESTS | 20 | 265 | 0 | ||
140203008 | Restricted | E | Dec. 21, 2021, 7:51 p.m. | OK | Java 11 | TESTS | 20 | 265 | 1331200 | ||
140150699 | sumitchavan | E | Dec. 21, 2021, 10:02 a.m. | OK | Java 11 | TESTS | 20 | 265 | 1331200 | ||
140121817 | long2142453426 | E | Dec. 21, 2021, 2:40 a.m. | OK | Java 11 | TESTS | 20 | 280 | 5120000 | ||
140151332 | sumitchavan | E | Dec. 21, 2021, 10:10 a.m. | OK | Java 11 | TESTS | 20 | 295 | 1331200 | ||
140174513 | bikramB01 | E | Dec. 21, 2021, 2:31 p.m. | OK | Java 11 | TESTS | 20 | 295 | 2252800 | ||
140134001 | BiggEr. | E | Dec. 21, 2021, 6:49 a.m. | OK | Java 11 | TESTS | 20 | 326 | 0 | ||
140133103 | Piyush1607 | E | Dec. 21, 2021, 6:40 a.m. | OK | Java 11 | TESTS | 20 | 327 | 1433600 | ||
140135146 | SaberXpro | E | Dec. 21, 2021, 7:02 a.m. | OK | Java 11 | TESTS | 20 | 327 | 4608000 | ||
140205143 | honeysingh18 | E | Dec. 21, 2021, 8:34 p.m. | OK | Java 8 | TESTS | 20 | 187 | 2867200 | ||
140123312 | ttn.blackstar | E | Dec. 21, 2021, 3:20 a.m. | OK | Java 8 | TESTS | 20 | 233 | 3072000 | ||
140149752 | kishan963 | E | Dec. 21, 2021, 9:51 a.m. | OK | Java 8 | TESTS | 20 | 233 | 19353600 | ||
140197248 | kyrie_start | E | Dec. 21, 2021, 6:24 p.m. | OK | Java 8 | TESTS | 20 | 280 | 15974400 | ||
140176991 | omar_mohammed | E | Dec. 21, 2021, 2:56 p.m. | OK | Java 8 | TESTS | 20 | 373 | 12390400 | ||
140218747 | chinmaya21 | E | Dec. 22, 2021, 3:58 a.m. | OK | Java 8 | TESTS | 20 | 389 | 4403200 | ||
140124584 | 201502010200 | E | Dec. 21, 2021, 3:52 a.m. | OK | Java 8 | TESTS | 20 | 389 | 20684800 | ||
140128018 | Vinay_Goel_ | E | Dec. 21, 2021, 5:04 a.m. | OK | Java 8 | TESTS | 20 | 467 | 6144000 | ||
140157549 | ganesh_6 | E | Dec. 21, 2021, 11:23 a.m. | OK | Java 8 | TESTS | 20 | 498 | 16896000 | ||
140157765 | ganesh_6 | E | Dec. 21, 2021, 11:25 a.m. | OK | Java 8 | TESTS | 20 | 514 | 16793600 | ||
140128474 | andreyDagger | E | Dec. 21, 2021, 5:11 a.m. | OK | MS C++ 2017 | TESTS | 20 | 265 | 5017600 | ||
140139026 | qing_lin | E | Dec. 21, 2021, 7:48 a.m. | OK | MS C++ 2017 | TESTS | 20 | 295 | 5529600 | ||
140215128 | sgly33 | E | Dec. 22, 2021, 2:20 a.m. | OK | MS C++ 2017 | TESTS | 20 | 374 | 13619200 | ||
140124074 | XianztsZhong | E | Dec. 21, 2021, 3:40 a.m. | OK | MS C++ 2017 | TESTS | 20 | 405 | 10547200 | ||
140110577 | nikuradze2006 | E | Dec. 20, 2021, 8:19 p.m. | OK | MS C++ 2017 | TESTS | 20 | 483 | 10956800 | ||
140178656 | chinesedfan | E | Dec. 21, 2021, 3:13 p.m. | OK | Node.js | TESTS | 20 | 249 | 37785600 | ||
140185551 | OlavBakken | E | Dec. 21, 2021, 4:20 p.m. | OK | PyPy 2 | TESTS | 20 | 265 | 25497600 | ||
140171111 | 1_2_3_4_5_9 | E | Dec. 21, 2021, 1:59 p.m. | OK | PyPy 2 | TESTS | 20 | 654 | 26009600 | ||
140153021 | sakshatmali | E | Dec. 21, 2021, 10:29 a.m. | OK | PyPy 3 | TESTS | 20 | 249 | 27545600 | ||
140140552 | skhan_org | E | Dec. 21, 2021, 8:07 a.m. | OK | PyPy 3 | TESTS | 20 | 280 | 29081600 | ||
140206491 | hxu10 | E | Dec. 21, 2021, 9:03 p.m. | OK | PyPy 3 | TESTS | 20 | 405 | 22630400 | ||
140157326 | AbnerShen | E | Dec. 21, 2021, 11:20 a.m. | OK | PyPy 3 | TESTS | 20 | 420 | 22220800 | ||
140159991 | AbnerShen | E | Dec. 21, 2021, 11:54 a.m. | OK | PyPy 3 | TESTS | 20 | 451 | 20582400 | ||
140138522 | Bambam_Shivam | E | Dec. 21, 2021, 7:43 a.m. | OK | PyPy 3 | TESTS | 20 | 452 | 25804800 | ||
140217532 | jano31415 | E | Dec. 22, 2021, 3:28 a.m. | OK | PyPy 3 | TESTS | 20 | 452 | 31948800 | ||
140165482 | vale46 | E | Dec. 21, 2021, 12:59 p.m. | OK | PyPy 3 | TESTS | 20 | 467 | 20582400 | ||
140150862 | customaddone | E | Dec. 21, 2021, 10:04 a.m. | OK | PyPy 3 | TESTS | 20 | 483 | 22016000 | ||
140208168 | pirate0 | E | Dec. 21, 2021, 9:45 p.m. | OK | PyPy 3 | TESTS | 20 | 499 | 25804800 | ||
140112659 | IkshitG | E | Dec. 20, 2021, 9:01 p.m. | OK | PyPy 3-64 | TESTS | 20 | 374 | 25600000 | ||
140112611 | IkshitG | E | Dec. 20, 2021, 9 p.m. | OK | PyPy 3-64 | TESTS | 20 | 374 | 28160000 | ||
140201938 | FrozenKandy | E | Dec. 21, 2021, 7:33 p.m. | OK | PyPy 3-64 | TESTS | 20 | 436 | 30924800 | ||
140172733 | ryo_n | E | Dec. 21, 2021, 2:14 p.m. | OK | PyPy 3-64 | TESTS | 20 | 436 | 34508800 | ||
140172611 | ryo_n | E | Dec. 21, 2021, 2:13 p.m. | OK | PyPy 3-64 | TESTS | 20 | 436 | 34508800 | ||
140218255 | newtocf | E | Dec. 22, 2021, 3:45 a.m. | OK | PyPy 3-64 | TESTS | 20 | 436 | 43520000 | ||
140172782 | mrobiul | E | Dec. 21, 2021, 2:15 p.m. | OK | PyPy 3-64 | TESTS | 20 | 482 | 34508800 | ||
140142970 | alexwice | E | Dec. 21, 2021, 8:35 a.m. | OK | PyPy 3-64 | TESTS | 20 | 483 | 26316800 | ||
140140090 | alexwice | E | Dec. 21, 2021, 8:01 a.m. | OK | PyPy 3-64 | TESTS | 20 | 498 | 25907200 | ||
140214499 | RANK1ZEN | E | Dec. 22, 2021, 1:58 a.m. | OK | PyPy 3-64 | TESTS | 20 | 499 | 34099200 | ||
140215738 | shardul_rajhans | E | Dec. 22, 2021, 2:38 a.m. | OK | Python 3 | TESTS | 20 | 483 | 24883200 | ||
140144715 | ashish_chiks_75 | E | Dec. 21, 2021, 8:56 a.m. | OK | Python 3 | TESTS | 20 | 545 | 14233600 | ||
140118631 | danhnganc3 | E | Dec. 21, 2021, 12:36 a.m. | OK | Python 3 | TESTS | 20 | 561 | 14643200 | ||
140156580 | physmo | E | Dec. 21, 2021, 11:11 a.m. | OK | Python 3 | TESTS | 20 | 576 | 14233600 | ||
140208512 | raggzy | E | Dec. 21, 2021, 9:55 p.m. | OK | Python 3 | TESTS | 20 | 577 | 23040000 | ||
140168334 | Sachin_Sain | E | Dec. 21, 2021, 1:30 p.m. | OK | Python 3 | TESTS | 20 | 717 | 16588800 | ||
140134797 | 190330276 | E | Dec. 21, 2021, 6:58 a.m. | OK | Python 3 | TESTS | 20 | 732 | 16076800 | ||
140129031 | shiviDON | E | Dec. 21, 2021, 5:19 a.m. | OK | Python 3 | TESTS | 20 | 1029 | 16076800 | ||
140192997 | mx_maan | E | Dec. 21, 2021, 5:36 p.m. | OK | Rust 2021 | TESTS | 20 | 46 | 7884800 |
Back to search problems