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 |
---|---|---|---|---|---|---|
1943 | Codeforces Round 934 (Div. 1) | FINISHED | False | 8700 | 21223499 | March 16, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 304 ) | E2 | MEX Game 2 (Hard Version) | PROGRAMMING | binary search greedy two pointers |
B"This is the hard version of the problem. The only difference between the two versions is the constraint on t , m and the sum of m . You can make hacks only if both versions of the problem are solved. Alice and Bob play yet another game on an array a of size n . Alice starts with an empty array c . Both players take turns playing, with Alice starting first. On Alice's turn, she picks one element from a , appends that element to c , and then deletes it from a . On Bob's turn, he picks at most k elements from a , and then deletes it from a . The game ends when the array a is empty. Alice's score is defined to be the MEX ^ dagger of c . Alice wants to maximize her score while Bob wants to minimize it. Find Alice's final score if both players play optimally. The array will be given in compressed format. Instead of giving the elements present in the array, we will be giving their frequencies. Formally, you will be given m , the maximum element in the array, and then m + 1 integers f_0, f_1, ldots, f_{m} , where f_i represents the number of times i occurs in the array a . ^ dagger The operatorname{MEX} (minimum excludant) of an array of integers is defined as the smallest non-negative integer which does not occur in the array. For example: Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers m and k ( 1 <= m <= 2 cdot 10^5, 1 <= k <= 10^9 ). The second line contains m + 1 integers f_0, f_1, ldots, f_m ( 1 <= f_i <= 10^9 ). It is guaranteed the sum of m over all test cases does not exceed 2 cdot 10^5 . For each test case, find Alice's score if both players play optimally. In the first test case, the"... |
Codeforces Round #934 (Div1, Div2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
251855119 | using233 | E2 | March 17, 2024, 4:05 a.m. | OK | C++14 (GCC 6-32) | TESTS | 62 | 405 | 6451200 | ||
251768795 | Crystally | E2 | March 16, 2024, 4:06 p.m. | OK | C++14 (GCC 6-32) | TESTS | 62 | 654 | 12083200 | ||
251806219 | potato167 | E2 | March 16, 2024, 6:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 264 | 7270400 | ||
251850394 | ecnerwala | E2 | March 17, 2024, 3:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 311 | 1638400 | ||
251847896 | JoesSR | E2 | March 17, 2024, 2:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 374 | 4812800 | ||
251863440 | ________e____ | E2 | March 17, 2024, 5:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 405 | 4812800 | ||
251774166 | jiangly | E2 | March 16, 2024, 4:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 451 | 3584000 | ||
251801786 | potato167 | E2 | March 16, 2024, 6:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 451 | 6451200 | ||
251783692 | ecnerwala | E2 | March 16, 2024, 4:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 451 | 8294400 | ||
251817172 | xiaoziya | E2 | March 16, 2024, 7:54 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 451 | 11980800 | ||
251772938 | Benq | E2 | March 16, 2024, 4:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 467 | 7680000 | ||
251811642 | 1459007298 | E2 | March 16, 2024, 7:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 62 | 483 | 24064000 |
Back to search problems