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 |
|---|---|---|---|---|---|---|
| 2222 | Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) | FINISHED | False | 9000 | 1437864 | April 25, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 112 ) | H | Counting Sort? | PROGRAMMING | combinatorics dp |
For an array (b_1, b_2, \ldots, b_m) where (0 \le b_i \le m), define (f(b)) as an array (c_1, c_2, \ldots, c_m) such that (c_i) is the number of occurrences of (i) in the array (b). Define the value (g(b)) of an array (b_1, b_2, \ldots, b_m), where (0 \le b_i \le m), as follows: Initially, there is an empty set (S). Create an array (d) that is initially equal to (b). Then, you perform the following operation (100^{100}) times: Insert (d) into (S), then set (d \gets f(d)). (g(b)) is the number of distinct arrays in (S) after the operations. Now you are given two integers (n) and (k), as well as an array (r_1, r_2, \ldots, r_n). For every (1\le p\le k), count the number of arrays (a_1, a_2, \ldots, a_n) where (0 \le a_i \le r_i) such that (g(a) = p). Since this number may be large, output it modulo (998\,244\,353). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le n \le 50), (1 \le k \le 1000)). The second line contains (n) integers (r_1, r_2, \ldots, r_n) ((0 \le r_i \le n)). It is guaranteed that the sum of (n^3) over all test cases does not exceed (50^3). For each test case, output (k) integers — the number of arrays (a_1, a_2, \ldots, a_n) with (0 \le a_i \le r_i) such that (g(a) = 1, 2, \ldots, k), respectively. Print the answer modulo (998\,244\,353). In the first test case, (g(0, 0) = g(1, 0) = 1), (g(0, 1) = 2), (g(2, 0) = g(0, 2) = 3), (g(1, 1) = g(2, 2) = 4), and (g(1, 2) = g(2, 1) = 5). In the second test case, (f(4, 5, 1, 4, 5) = 1, 0, 0, 2, 2), (f(1, 0, 0, 2, 2) = 1, 2, 0, 0, 0), (f(1, 2, 0, 0, 0) = 1, 1, 0, 0, 0), $$$f([1, |
| Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 372550340 | codeBreaker_krrishb | H | April 25, 2026, 10:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 50 | 4671 | 167321600 | ||
| 372563110 | didxga | H | April 26, 2026, 2:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 50 | 6859 | 207155200 | ||
| 372564953 | gofrozen21 | H | April 26, 2026, 3:37 a.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 1718 | 159641600 | ||
| 372540155 | Ormlis | H | April 25, 2026, 7:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 2640 | 706355200 | ||
| 372552513 | love_seeker | H | April 25, 2026, 11:45 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 4156 | 431001600 | ||
| 372536580 | Suwan | H | April 25, 2026, 6:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 4375 | 135987200 | ||
| 372569178 | baby_awerty | H | April 26, 2026, 5 a.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 5156 | 573542400 | ||
| 372539978 | Ormlis | H | April 25, 2026, 7:35 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 5859 | 706457600 | ||
| 372519501 | superguymj | H | April 25, 2026, 4:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 6125 | 849305600 | ||
| 372526393 | tourist | H | April 25, 2026, 5:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 6296 | 513740800 | ||
| 372544008 | Geothermal | H | April 25, 2026, 8:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 7500 | 551936000 | ||
| 372567137 | gofrozen21 | H | April 26, 2026, 4:19 a.m. | OK | C++20 (GCC 13-64) | TESTS | 50 | 7859 | 116531200 | ||
| 372573269 | aan93 | H | April 26, 2026, 5:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 2093 | 104243200 | ||
| 372511121 | XVIII | H | April 25, 2026, 4:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 3156 | 97075200 | ||
| 372548252 | scorpion | H | April 25, 2026, 9:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 3312 | 196710400 | ||
| 372542130 | rusters | H | April 25, 2026, 8:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 4078 | 264806400 | ||
| 372555977 | jiangbowen | H | April 26, 2026, 1:26 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 4468 | 550604800 | ||
| 372562893 | hawk.chan | H | April 26, 2026, 2:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 4812 | 272486400 | ||
| 372565687 | SleeplessSouris | H | April 26, 2026, 3:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 4843 | 802713600 | ||
| 372517111 | rainboy | H | April 25, 2026, 4:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 5015 | 188006400 | ||
| 372566165 | gshbholanath19 | H | April 26, 2026, 4:01 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 5062 | 599552000 | ||
| 372523143 | FableWeaver | H | April 25, 2026, 4:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 50 | 5078 | 822476800 | ||
| 372526324 | bugfeature | H | April 25, 2026, 5:02 p.m. | OK | Go | TESTS | 50 | 4734 | 329932800 | ||
| 372563294 | didxga | H | April 26, 2026, 2:58 a.m. | OK | Java 21 | TESTS | 50 | 7718 | 133017600 |
Back to search problems