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 |
|---|---|---|---|---|---|---|
| 2245 | Spectral::Cup 2026 Round 3 (Codeforces Round 1110, Div. 1 + Div. 2) | FINISHED | False | 9000 | 2387684 | July 16, 2026, 2:45 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 279 ) | F | Familiar? | PROGRAMMING | brute force combinatorics dp |
Note the unusual memory limit. Consider the following pseudocode that processes a permutation (p) of length (n)(^{\text{∗}}): You are given an array (a) of length (n). Your task is to count the number of permutations (p) of length (n) such that, if (b) is the array returned by mystery(p) , the condition (a_i = b_i) holds for all (i) ((1 \le i \le n)) where (a_i \neq -1). Since the answer can be very large, output it modulo (998\,244\,353). (^{\text{∗}})A permutation of length (n) is an array consisting of (n) distinct integers from (1) to (n) in arbitrary order. For example, (2,3,1,5,4) is a permutation, but (1,2,2) is not a permutation ((2) appears twice in the array), and (1,3,4) is also not a permutation ((n=3) but there is (4) in the array). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains an integer (n) ((1 \le n \le 500)), representing the length of (a). The second line contains (n) integers (a_1,a_2,\ldots,a_n) ((-1 \le a_i \le n)), representing the elements in (a). It is guaranteed that the sum of (n^3) over all test cases does not exceed (500^3). For each test case, output an integer representing the number of permutations, modulo (998\,244\,353). In the first and second test cases, the only valid permutation is (1). In the fourth test case, the valid permutations are (1,2,4,3), (3,4,2,1), and (1,4,3,2). In the fifth test case, all permutations of length (6) are valid. |
| Spectral::Cup 2026 Round 3 (Codeforces Round 1110, 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 383013030 | caffeine2ac | F | July 16, 2026, 5:09 p.m. | OK | C# 13 | TESTS | 29 | 156 | 6963200 | ||
| 383008286 | -firefly- | F | July 16, 2026, 4:52 p.m. | OK | C# 13 | TESTS | 29 | 609 | 7372800 | ||
| 383012728 | bloo12 | F | July 16, 2026, 5:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 437 | 0 | ||
| 383014340 | dcinside | F | July 16, 2026, 5:13 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 484 | 2150400 | ||
| 383028578 | aslam_45 | F | July 16, 2026, 7:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 718 | 6656000 | ||
| 383014587 | siixku | F | July 16, 2026, 5:13 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 718 | 6656000 | ||
| 383058195 | sunyata258 | F | July 17, 2026, 3:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 1171 | 1024000 | ||
| 383022857 | CFmomoko | F | July 16, 2026, 6:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 1421 | 9932800 | ||
| 383066293 | Leo_W | F | July 17, 2026, 4:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 2093 | 5324800 | ||
| 383001894 | lucri | F | July 16, 2026, 4:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 2562 | 92057600 | ||
| 383015037 | chintu | F | July 16, 2026, 5:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 4562 | 3174400 | ||
| 383012003 | tnecsed | F | July 16, 2026, 5:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 29 | 4937 | 4198400 | ||
| 383014938 | islingr | F | July 16, 2026, 5:14 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 140 | 102400 | ||
| 382999231 | dog_of_Nesraychan | F | July 16, 2026, 4:22 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 156 | 1126400 | ||
| 383054726 | cyx | F | July 17, 2026, 2:12 a.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 156 | 2969600 | ||
| 383019056 | _acsm_ | F | July 16, 2026, 5:45 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 156 | 4198400 | ||
| 383016340 | Acheronlt | F | July 16, 2026, 5:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 187 | 102400 | ||
| 383009038 | superguymj | F | July 16, 2026, 4:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 218 | 102400 | ||
| 383014141 | hexahydride | F | July 16, 2026, 5:12 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 218 | 2150400 | ||
| 383016354 | dlalswp25 | F | July 16, 2026, 5:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 234 | 6144000 | ||
| 383010103 | 244mhq | F | July 16, 2026, 4:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 250 | 2150400 | ||
| 383009480 | _Diu_ | F | July 16, 2026, 4:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 29 | 250 | 2150400 | ||
| 383069042 | liaoyanxu | F | July 17, 2026, 5:27 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 93 | 2048000 | ||
| 383011742 | ShmilyTY | F | July 16, 2026, 5:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 109 | 1126400 | ||
| 383013867 | makeit427 | F | July 16, 2026, 5:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 109 | 2150400 | ||
| 382994725 | Otomachi_Una | F | July 16, 2026, 4:09 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 125 | 2150400 | ||
| 383054800 | go_tidy | F | July 17, 2026, 2:13 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 156 | 102400 | ||
| 383019259 | Nyaan | F | July 16, 2026, 5:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 171 | 2150400 | ||
| 383013961 | Dmitriy146 | F | July 16, 2026, 5:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 171 | 4198400 | ||
| 383021606 | beaaaan | F | July 16, 2026, 6:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 187 | 102400 | ||
| 383008700 | aduwahi | F | July 16, 2026, 4:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 187 | 102400 | ||
| 383019636 | wxy2010 | F | July 16, 2026, 5:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 29 | 187 | 102297600 | ||
| 383014025 | AJ123496 | F | July 16, 2026, 5:12 p.m. | OK | Java 21 | TESTS | 29 | 609 | 1536000 | ||
| 383055458 | edmondium2 | F | July 17, 2026, 2:23 a.m. | OK | Java 21 | TESTS | 31 | 1484 | 716800 | ||
| 383018238 | doner | F | July 16, 2026, 5:39 p.m. | OK | PyPy 3-64 | TESTS | 29 | 1046 | 26624000 | ||
| 383069462 | dumb_god | F | July 17, 2026, 5:32 a.m. | OK | PyPy 3-64 | TESTS | 31 | 3328 | 43110400 | ||
| 383066041 | Tryent | F | July 17, 2026, 4:50 a.m. | OK | PyPy 3-64 | TESTS | 31 | 3328 | 43110400 | ||
| 383013743 | trycatchcry | F | July 16, 2026, 5:11 p.m. | OK | Rust 2024 | TESTS | 29 | 125 | 0 | ||
| 383002658 | d11maan | F | July 16, 2026, 4:34 p.m. | OK | Rust 2024 | TESTS | 29 | 203 | 0 | ||
| 383010385 | Egor | F | July 16, 2026, 4:59 p.m. | OK | Rust 2024 | TESTS | 29 | 1109 | 921600 |
Back to search problems