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 |
|---|---|---|---|---|---|---|
| 2154 | Codeforces Round 1060 (Div. 2) | FINISHED | False | 7200 | 15521123 | Oct. 19, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 173 ) | F2 | Bombing (Hard Version) | PROGRAMMING | combinatorics dp |
This is the hard version of the problem. The difference between the versions is that in this version, (n \le 10^6). You can hack only if you solved all versions of this problem. A permutation(^{\text{∗}}) (b) is considered a riffle shuffle of a permutation (a) if (|a| = |b|) and there exists (k) where (1 \le k < |a|) such that (a_1,a_2,\ldots,a_k) and (a_{k + 1},a_{k + 2},\ldots,a_{|a|}) are both subsequences(^{\text{†}}) of (b). For example, (\color{red}{1}, \color{blue}{4}, \color{blue}{5}, \color{red}{2}, \color{red}{3}, \color{blue}{6}) is a riffle shuffle of (\color{red}{1}, \color{red}{2}, \color{red}{3}, \color{blue}{4}, \color{blue}{5}, \color{blue}{6}) because we can select (k = 3) and both (\color{red}{1}, \color{red}{2}, \color{red}{3}) and (\color{blue}{4}, \color{blue}{5}, \color{blue}{6}) are subsequences. You are given a permutation (p) of length (n) where some values are replaced with (-1). Determine the number of ways to replace each (-1) with an integer such that (p) becomes a riffle shuffle of (1,2,\ldots,n) (the sorted permutation). The number of ways could be gargantuan, so 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). (^{\text{†}})A sequence (c) is a subsequence of a sequence (d) if (c) can be obtained from (d) by the deletion of several (possibly, zero or all) element from arbitrary positions. 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 |
| Codeforces Round 1060 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 344789852 | volcano_2025 | F2 | Oct. 20, 2025, 1:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 249 | 23552000 | ||
| 344780948 | 244mhq | F2 | Oct. 19, 2025, 9:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 264 | 48230400 | ||
| 344752867 | Smirnov_Grigoriy | F2 | Oct. 19, 2025, 5:42 p.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 311 | 36249600 | ||
| 344792647 | emanuelapopescu46 | F2 | Oct. 20, 2025, 2 a.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 327 | 119705600 | ||
| 344755535 | Hamed_Ghaffari | F2 | Oct. 19, 2025, 5:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 358 | 92672000 | ||
| 344750284 | BurnedChicken | F2 | Oct. 19, 2025, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 359 | 32051200 | ||
| 344754719 | Rubikun | F2 | Oct. 19, 2025, 5:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 374 | 49664000 | ||
| 344801776 | SilverTwilights | F2 | Oct. 20, 2025, 4:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 546 | 56217600 | ||
| 344790710 | njwrz | F2 | Oct. 20, 2025, 1:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 561 | 71065600 | ||
| 344801742 | Austin__Griffin | F2 | Oct. 20, 2025, 4:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 58 | 593 | 56115200 | ||
| 344804472 | hungchi17 | F2 | Oct. 20, 2025, 4:48 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 218 | 24371200 | ||
| 344758155 | jiangly | F2 | Oct. 19, 2025, 6:10 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 233 | 24371200 | ||
| 344784508 | hungchi17 | F2 | Oct. 19, 2025, 10:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 264 | 9625600 | ||
| 344769862 | CipherXcel | F2 | Oct. 19, 2025, 7:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 265 | 9728000 | ||
| 344751335 | A_G | F2 | Oct. 19, 2025, 5:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 265 | 29593600 | ||
| 344777105 | makcvim | F2 | Oct. 19, 2025, 8:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 281 | 85811200 | ||
| 344784388 | hungchi17 | F2 | Oct. 19, 2025, 10:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 296 | 9728000 | ||
| 344779581 | makcvim | F2 | Oct. 19, 2025, 9:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 312 | 85811200 | ||
| 344779013 | makcvim | F2 | Oct. 19, 2025, 9:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 58 | 358 | 85913600 | ||
| 344750227 | LMeyling | F2 | Oct. 19, 2025, 5:31 p.m. | OK | PyPy 3-64 | TESTS | 58 | 843 | 214528000 |
Back to search problems