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 |
---|---|---|---|---|---|---|
1870 | CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 8100 | 36775499 | Sept. 18, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 219 ) | G | MEXanization | PROGRAMMING |
B"Let's define f(S) . Let S be a multiset (i.e., it can contain repeated elements) of non-negative integers. In one operation, you can choose any non-empty subset of S (which can also contain repeated elements), remove this subset (all elements in it) from S , and add the MEX of the removed subset to S . You can perform any number of such operations. After all the operations, S should contain exactly 1 number. f(S) is the largest number that could remain in S after any sequence of operations. You are given an array of non-negative integers a of length n . For each of its n prefixes, calculate f(S) if S is the corresponding prefix (for the i -th prefix, S consists of the first i elements of array a ). The MEX (minimum excluded) of an array is the smallest non-negative integer that does not belong to the array. For instance: The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains an integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the size of array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 2 cdot 10^5 ) -- the array a . It is guaranteed that the sum of all n values across all test cases does not exceed 2 cdot 10^5 . For each test case, output n numbers: f(S) for each of the n prefixes of array a . Consider the first test case. For a prefix of length 1 , the initial multiset is {179 } . If we do nothing, we get 179 . For a prefix of length 2 , the initial multiset is {57, 179 } . Using the following sequence of operations, we can obtain 2 . Consider the second test case. For a prefix of length 1 , the initial multiset is {0 } . If we apply the operation to "... |
CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
223928288 | rainboy | G | Sept. 18, 2023, 6:09 p.m. | OK | GNU C11 | TESTS | 93 | 1216 | 5017600 | ||
223967345 | liuhengxi | G | Sept. 19, 2023, 2:21 a.m. | OK | GNU C++14 | TESTS | 93 | 779 | 490598400 | ||
223954151 | ok777777788 | G | Sept. 18, 2023, 9:10 p.m. | OK | GNU C++17 | TESTS | 93 | 436 | 2867200 | ||
223928093 | star70 | G | Sept. 18, 2023, 6:08 p.m. | OK | GNU C++17 | TESTS | 93 | 483 | 165990400 | ||
223928200 | star70 | G | Sept. 18, 2023, 6:09 p.m. | OK | GNU C++17 | TESTS | 93 | 530 | 165990400 | ||
223958058 | Mustang98 | G | Sept. 18, 2023, 10:33 p.m. | OK | GNU C++17 | TESTS | 93 | 702 | 5324800 | ||
223917364 | TadijaSebez | G | Sept. 18, 2023, 4:46 p.m. | OK | GNU C++17 | TESTS | 93 | 748 | 5632000 | ||
223957590 | Mustang98 | G | Sept. 18, 2023, 10:22 p.m. | OK | GNU C++17 | TESTS | 93 | 795 | 12800000 | ||
223958038 | Mustang98 | G | Sept. 18, 2023, 10:33 p.m. | OK | GNU C++17 | TESTS | 93 | 1731 | 5324800 | ||
223928317 | forever_lose | G | Sept. 18, 2023, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 436 | 165990400 | ||
223926327 | amiya | G | Sept. 18, 2023, 5:55 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 451 | 90521600 | ||
223929822 | forever_lose | G | Sept. 18, 2023, 6:19 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 467 | 165990400 | ||
223963646 | Sana | G | Sept. 19, 2023, 1:07 a.m. | OK | GNU C++17 (64) | TESTS | 93 | 514 | 14540800 | ||
223916511 | tute7627 | G | Sept. 18, 2023, 4:45 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 529 | 5836800 | ||
223963445 | Sana | G | Sept. 19, 2023, 1:03 a.m. | OK | GNU C++17 (64) | TESTS | 93 | 529 | 14540800 | ||
223924202 | Alex_Wei | G | Sept. 18, 2023, 5:41 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 623 | 31539200 | ||
223928356 | rainboy | G | Sept. 18, 2023, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 780 | 4915200 | ||
223973124 | Morphymorphymorphy | G | Sept. 19, 2023, 3:41 a.m. | OK | GNU C++17 (64) | TESTS | 93 | 811 | 34099200 | ||
223934593 | fastmath | G | Sept. 18, 2023, 7:02 p.m. | OK | GNU C++17 (64) | TESTS | 93 | 1435 | 35635200 | ||
223952281 | BalintR | G | Sept. 18, 2023, 8:39 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 78 | 6656000 | ||
223952382 | BalintR | G | Sept. 18, 2023, 8:40 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 93 | 6656000 | ||
223951909 | BalintR | G | Sept. 18, 2023, 8:33 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 109 | 3481600 | ||
223951850 | BalintR | G | Sept. 18, 2023, 8:32 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 109 | 3686400 | ||
223951826 | BalintR | G | Sept. 18, 2023, 8:32 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 124 | 4198400 | ||
223951182 | BalintR | G | Sept. 18, 2023, 8:22 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 140 | 5017600 | ||
223951754 | BalintR | G | Sept. 18, 2023, 8:31 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 155 | 5017600 | ||
223957028 | BalintR | G | Sept. 18, 2023, 10:07 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 187 | 5836800 | ||
223957855 | BalintR | G | Sept. 18, 2023, 10:28 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 187 | 6656000 | ||
223951777 | BalintR | G | Sept. 18, 2023, 8:31 p.m. | OK | GNU C++20 (64) | TESTS | 93 | 233 | 7475200 |
Back to search problems