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 |
|---|---|---|---|---|---|---|
| 2165 | Codeforces Round 1064 (Div. 1) | FINISHED | False | 7200 | 13101923 | Nov. 16, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 4461 ) | B | Marble Council | PROGRAMMING | dp math |
You are given a multiset (a), which consists of (n) integers (a_1,a_2,\ldots,a_n). You would like to generate a new multiset (s) through the following procedure: Partition (a) into any number of non-empty multisets (x_1,x_2,\ldots,x_k), such that each element of (a) belongs to exactly one of these multisets. Initially, (s) is empty. From each (x_i), choose one of its modes (^{\text{∗}}) and insert it into (s). Please count the number of different multisets (s) that can be generated through the procedure, modulo (998\,244\,353). Please note that the number of different multisets is counted, which means that the order of elements does not matter. However, the count of each element does matter, i.e. (\{1,1,2\},\{1,2\},\{1,1,2,2\}) are all considered different. (^{\text{∗}})The mode of a multiset is defined as the element which appears the most; if several elements are tied as the maximum, then all of them are considered modes. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 5000)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1\le n\le5000)) — the size of multiset (a). The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((1\le a_i\le n)). It is guaranteed that the sum of (n) over all test cases does not exceed (5000). For each test case, print one line containing a single integer — the number of different multisets you can obtain, modulo (998\,244\,353). In the first test case, any non-empty subset of (\{1,2,3\}) can be achieved, for a total of (7) multisets. In the third test case, we can generate (4) different multisets: Partition the elements into set (\{1,2,2\}), resulting in multiset (\{2\}). Partition the elements into sets (\{1,2\},\{2\}), resulting in multiset (\{2,2\}). Partit |
| 148452 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 349317760 | -firefly- | B | Nov. 16, 2025, 4:14 p.m. | OK | C# 13 | TESTS | 19 | 343 | 102400 | ||
| 349300618 | GILGAMESH | B | Nov. 16, 2025, 3:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 61 | 0 | ||
| 349306325 | pandaforever | B | Nov. 16, 2025, 3:39 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 61 | 5120000 | ||
| 349303617 | Handsome2004 | B | Nov. 16, 2025, 3:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 61 | 207257600 | ||
| 349323551 | walizamanee | B | Nov. 16, 2025, 4:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 62 | 0 | ||
| 349320768 | kylin0610 | B | Nov. 16, 2025, 4:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 62 | 0 | ||
| 349283879 | ylf_cat | B | Nov. 16, 2025, 2:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 62 | 0 | ||
| 349289497 | TripleHappy | B | Nov. 16, 2025, 3:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 62 | 102400 | ||
| 349314626 | Ak_16 | B | Nov. 16, 2025, 4:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 62 | 7270400 | ||
| 349314445 | _themezzala | B | Nov. 16, 2025, 4:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 77 | 0 | ||
| 349314321 | sahilsingh177 | B | Nov. 16, 2025, 4:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 77 | 0 | ||
| 349310721 | Kniaz | B | Nov. 16, 2025, 3:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 46 | 0 | ||
| 349292294 | matchalover | B | Nov. 16, 2025, 3:07 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 46 | 0 | ||
| 349369617 | adam.jq.xu | B | Nov. 17, 2025, 3:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 46 | 102400 | ||
| 349305467 | wuhudsm | B | Nov. 16, 2025, 3:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 46 | 102400 | ||
| 349292658 | noya2 | B | Nov. 16, 2025, 3:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 61 | 0 | ||
| 349283394 | andrei6184 | B | Nov. 16, 2025, 2:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 61 | 0 | ||
| 349373792 | qiaodifehf | B | Nov. 17, 2025, 4:48 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 62 | 0 | ||
| 349361766 | Sana | B | Nov. 17, 2025, 1:56 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 62 | 0 | ||
| 349356027 | Westxrn | B | Nov. 17, 2025, 12:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 62 | 0 | ||
| 349320248 | dsolunov | B | Nov. 16, 2025, 4:22 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 62 | 0 | ||
| 349315831 | egor4kus | B | Nov. 16, 2025, 4:08 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 46 | 0 | ||
| 349300426 | Joler_ | B | Nov. 16, 2025, 3:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 46 | 0 | ||
| 349291344 | The-Winner | B | Nov. 16, 2025, 3:05 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 46 | 1638400 | ||
| 349331337 | Khalwsh | B | Nov. 16, 2025, 5:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349316182 | kubaoa | B | Nov. 16, 2025, 4:09 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349307757 | boleyn.su | B | Nov. 16, 2025, 3:43 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349304034 | KwisatzCoderach | B | Nov. 16, 2025, 3:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349292398 | FreNito | B | Nov. 16, 2025, 3:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349289550 | potatoo | B | Nov. 16, 2025, 3:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349288678 | AbdelmagedNour | B | Nov. 16, 2025, 3 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 61 | 0 | ||
| 349349830 | SayAnAditya_1by0 | B | Nov. 16, 2025, 9:23 p.m. | OK | GNU C11 | TESTS | 19 | 343 | 204800 | ||
| 349301634 | khuepr123 | B | Nov. 16, 2025, 3:27 p.m. | OK | Haskell | TESTS | 19 | 77 | 102400 | ||
| 349293164 | iamalizaidi | B | Nov. 16, 2025, 3:09 p.m. | OK | Java 21 | TESTS | 19 | 1343 | 512000 | ||
| 349301874 | anshwww | B | Nov. 16, 2025, 3:28 p.m. | OK | Java 21 | TESTS | 19 | 1593 | 1843200 | ||
| 349293368 | gua069 | B | Nov. 16, 2025, 3:09 p.m. | OK | Java 8 | TESTS | 19 | 296 | 0 | ||
| 349288956 | Tlatoani | B | Nov. 16, 2025, 3:01 p.m. | OK | Kotlin 2.2 | TESTS | 19 | 655 | 307200 | ||
| 349277505 | alexwice | B | Nov. 16, 2025, 2:42 p.m. | OK | PyPy 3-64 | TESTS | 19 | 124 | 3788800 | ||
| 349297489 | Maruzensky | B | Nov. 16, 2025, 3:18 p.m. | OK | PyPy 3-64 | TESTS | 19 | 171 | 4505600 | ||
| 349293417 | eepsilon | B | Nov. 16, 2025, 3:09 p.m. | OK | PyPy 3-64 | TESTS | 19 | 186 | 5427200 | ||
| 349295569 | kdy8128 | B | Nov. 16, 2025, 3:14 p.m. | OK | PyPy 3-64 | TESTS | 19 | 187 | 2867200 | ||
| 349316938 | Ayis137 | B | Nov. 16, 2025, 4:12 p.m. | OK | PyPy 3-64 | TESTS | 19 | 187 | 5017600 | ||
| 349293127 | SadMachine | B | Nov. 16, 2025, 3:09 p.m. | OK | PyPy 3-64 | TESTS | 19 | 187 | 5120000 | ||
| 349302685 | ow3nL | B | Nov. 16, 2025, 3:30 p.m. | OK | PyPy 3-64 | TESTS | 19 | 187 | 5324800 | ||
| 349298062 | mj1000j | B | Nov. 16, 2025, 3:19 p.m. | OK | PyPy 3-64 | TESTS | 19 | 202 | 3072000 | ||
| 349296547 | gawkmaster069 | B | Nov. 16, 2025, 3:16 p.m. | OK | PyPy 3-64 | TESTS | 19 | 202 | 4915200 | ||
| 349379091 | smilences | B | Nov. 17, 2025, 5:51 a.m. | OK | PyPy 3-64 | TESTS | 19 | 202 | 5120000 | ||
| 349291075 | sansen | B | Nov. 16, 2025, 3:05 p.m. | OK | Rust 2021 | TESTS | 19 | 140 | 0 | ||
| 349298775 | Monster027 | B | Nov. 16, 2025, 3:21 p.m. | OK | Rust 2024 | TESTS | 19 | 77 | 0 | ||
| 349364864 | 123gjweq2 | B | Nov. 17, 2025, 2:54 a.m. | OK | Rust 2024 | TESTS | 19 | 93 | 0 | ||
| 349314573 | null_lambda | B | Nov. 16, 2025, 4:04 p.m. | OK | Rust 2024 | TESTS | 19 | 124 | 0 |
Back to search problems