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 |
|---|---|---|---|---|---|---|
| 2030 | Codeforces Round 979 (Div. 2) | FINISHED | False | 8100 | 47058923 | Oct. 19, 2024, 2:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1963 ) | E | MEXimize the Score | PROGRAMMING | brute force combinatorics data structures dp math |
Suppose we partition the elements of an array (b) into any number (k) of non-empty multisets (S_1, S_2, \ldots, S_k), where (k) is an arbitrary positive integer. Define the score of (b) as the maximum value of (\operatorname{MEX}(S_1))(^{\text{∗}})(+ \operatorname{MEX}(S_2) + \ldots + \operatorname{MEX}(S_k)) over all possible partitions of (b) for any integer (k). Envy is given an array (a) of size (n). Since he knows that calculating the score of (a) is too easy for you, he instead asks you to calculate the sum of scores of all (2^n - 1) non-empty subsequences of (a).(^{\text{†}}) Since this answer may be large, please output it modulo (998\,244\,353). (^{\text{∗}})(\operatorname{MEX}) of a collection of integers (c_1, c_2, \ldots, c_k) is defined as the smallest non-negative integer (x) that does not occur in the collection (c). For example, (\operatorname{MEX}(0,1,2,2) = 3) and (\operatorname{MEX}(1,2,2) = 0) (^{\text{†}})A sequence (x) is a subsequence of a sequence (y) if (x) can be obtained from (y) by deleting several (possibly, zero or all) elements. The first line contains an integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains an integer (n) ((1 \leq n \leq 2 \cdot 10^5)) — the length of (a). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((0 \leq a_i < n)) — the elements of the array (a). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output the answer, modulo (998\,244\,353). In the first testcase, we must consider seven subsequences: (0): The score is (1). (0): The score is (1). (1): The score is (0). (0,0): The score is (2). (0,1): The score is (2). (0,1): The score is (2) |
| Codeforces Round 979 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 286851070 | Husanboy | E | Oct. 19, 2024, 9:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 124 | 4812800 | ||
| 286874042 | Bob_Wang | E | Oct. 20, 2024, 5:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 124 | 12083200 | ||
| 286865802 | Luzhuoyuan | E | Oct. 20, 2024, 3:31 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 125 | 11264000 | ||
| 286855157 | convective_rain | E | Oct. 19, 2024, 11:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 139 | 5632000 | ||
| 286854344 | FzArK | E | Oct. 19, 2024, 10:45 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 140 | 3276800 | ||
| 286873060 | GGapa | E | Oct. 20, 2024, 5:04 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 140 | 6348800 | ||
| 286867299 | Hongruizhao | E | Oct. 20, 2024, 3:54 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 140 | 7577600 | ||
| 286823150 | Luzhuoyuan | E | Oct. 19, 2024, 5:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 140 | 12902400 | ||
| 286870436 | jhkoh | E | Oct. 20, 2024, 4:33 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 140 | 27955200 | ||
| 286812168 | limbo16 | E | Oct. 19, 2024, 4:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 155 | 7987200 | ||
| 286866098 | LNian | E | Oct. 20, 2024, 3:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 77 | 4403200 | ||
| 286872137 | jzcrq | E | Oct. 20, 2024, 4:54 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 77 | 4403200 | ||
| 286861400 | yangjl | E | Oct. 20, 2024, 2:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 2457600 | ||
| 286813612 | yokoyama-midori | E | Oct. 19, 2024, 4:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 3379200 | ||
| 286835060 | SeaYellow | E | Oct. 19, 2024, 6:27 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 4198400 | ||
| 286824254 | noob_7x7 | E | Oct. 19, 2024, 5:16 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 4300800 | ||
| 286811187 | oval_m | E | Oct. 19, 2024, 4:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 4915200 | ||
| 286836026 | andycoke | E | Oct. 19, 2024, 6:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 5734400 | ||
| 286811018 | cup_of_coffee | E | Oct. 19, 2024, 4:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 5939200 | ||
| 286835624 | SeaYellow | E | Oct. 19, 2024, 6:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 6041600 | ||
| 286880111 | bluerar | E | Oct. 20, 2024, 6:06 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 5017600 | ||
| 286867184 | xiaolei338 | E | Oct. 20, 2024, 3:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 7372800 | ||
| 286866494 | RernaG | E | Oct. 20, 2024, 3:41 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 10547200 | ||
| 286878378 | constraint | E | Oct. 20, 2024, 5:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 12902400 | ||
| 286822533 | slcx | E | Oct. 19, 2024, 5:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 14540800 | ||
| 286860305 | Ycfhnnd | E | Oct. 20, 2024, 1:51 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 20889600 | ||
| 286818252 | Al27700 | E | Oct. 19, 2024, 4:19 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 108 | 409600 | ||
| 286853068 | MuhammadSawalhy | E | Oct. 19, 2024, 10:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 108 | 5734400 | ||
| 286813218 | nicolaikrob | E | Oct. 19, 2024, 4:08 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 108 | 7475200 | ||
| 286858882 | brusgry | E | Oct. 20, 2024, 1:15 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 108 | 18636800 | ||
| 286812889 | KumaTachiRen | E | Oct. 19, 2024, 4:07 p.m. | OK | C# 8 | TESTS | 19 | 155 | 9113600 | ||
| 286862742 | new2ac | E | Oct. 20, 2024, 2:41 a.m. | OK | Java 21 | TESTS | 19 | 1671 | 8396800 | ||
| 286856723 | Shu.Rong | E | Oct. 19, 2024, 11:59 p.m. | OK | PyPy 3-64 | TESTS | 19 | 171 | 27750400 | ||
| 286855873 | smilences | E | Oct. 19, 2024, 11:29 p.m. | OK | PyPy 3-64 | TESTS | 19 | 234 | 26419200 | ||
| 286832374 | __baozii__ | E | Oct. 19, 2024, 6:07 p.m. | OK | PyPy 3-64 | TESTS | 19 | 249 | 25088000 | ||
| 286815083 | smilences | E | Oct. 19, 2024, 4:12 p.m. | OK | PyPy 3-64 | TESTS | 19 | 249 | 25088000 | ||
| 286878569 | 2200030476 | E | Oct. 20, 2024, 5:54 a.m. | OK | PyPy 3-64 | TESTS | 19 | 265 | 26726400 | ||
| 286854744 | xxx.ego | E | Oct. 19, 2024, 10:55 p.m. | OK | PyPy 3-64 | TESTS | 19 | 343 | 42598400 | ||
| 286840011 | titia | E | Oct. 19, 2024, 7:12 p.m. | OK | PyPy 3-64 | TESTS | 19 | 483 | 35532800 | ||
| 286852926 | sushmanth.dampur8780 | E | Oct. 19, 2024, 10:09 p.m. | OK | PyPy 3-64 | TESTS | 19 | 561 | 31641600 | ||
| 286869743 | Heartbeateffect | E | Oct. 20, 2024, 4:25 a.m. | OK | PyPy 3-64 | TESTS | 19 | 858 | 39731200 | ||
| 286823005 | 34z12000 | E | Oct. 19, 2024, 5:09 p.m. | OK | PyPy 3-64 | TESTS | 19 | 1358 | 86323200 | ||
| 286822604 | tifv | E | Oct. 19, 2024, 5:08 p.m. | OK | Rust 2021 | TESTS | 19 | 109 | 102400 | ||
| 286828328 | PaciukZvichainyi | E | Oct. 19, 2024, 5:38 p.m. | OK | Rust 2021 | TESTS | 19 | 249 | 21811200 |
Back to search problems