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 |
|---|---|---|---|---|---|---|
| 2201 | Codeforces Round 1082 (Div. 1) | FINISHED | False | 9000 | 4548323 | Feb. 23, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 269 ) | E | ABBA Counting | PROGRAMMING | fft math number theory strings |
You are given a string (T) of length (n) ( (n) is even ), which consists of ' a ', ' b ', and ' ? '. Please count the strings (S) which satisfy the following conditions: (|S|=n); (S_i) is either ' a ' or ' b ' for all (1 \le i \le n); (S_i=T_i) for all (1 \le i \le n) such that (T_i) is not ' ? '; There exist two (possibly empty) strings (A) and (B) such that (S=A+B+B+A). Here, (+) denotes string concatenation . As the answer may be inexplicably huge, you are only asked to compute 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 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 400\,000), (n) is even ). The second line of each test case contains a string (T) of length (n), consisting of ' a ', ' b ', and ' ? '. It is guaranteed that the sum of (n) over all test cases does not exceed (400\,000). For each test case, output the answer modulo (998\,244\,353) on a separate line. For the fifth test case, there are (10) corresponding strings which are as follows: " aaaabaaaaaba " " aaaabbaaabba " " aaabbaaaabba " " aaabbbaabbba " " abaabbbaabba " " ababbbbabbba " " baaabaaababa " " baaababaaaba " " baaabbaabbba " " baabbabaabba " |
| Codeforces Round 1082 (Div. 1, Div. 2) Complete Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 364091174 | qwef_ | E | Feb. 23, 2026, 4:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 781 | 40652800 | ||
| 364111360 | Taha90411 | E | Feb. 23, 2026, 6:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 1140 | 26419200 | ||
| 364120508 | Joskmo | E | Feb. 23, 2026, 7:57 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 1640 | 31846400 | ||
| 364086673 | f_u_c_k_CCF | E | Feb. 23, 2026, 4:12 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 1734 | 32358400 | ||
| 364092047 | LiFar | E | Feb. 23, 2026, 4:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 2921 | 37785600 | ||
| 364103782 | Swistakk | E | Feb. 23, 2026, 5:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 3437 | 97382400 | ||
| 364154537 | Emikooh | E | Feb. 24, 2026, 5:55 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 78 | 11366400 | ||
| 364151963 | Emikooh | E | Feb. 24, 2026, 5:18 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 78 | 11366400 | ||
| 364081606 | kotatsugame | E | Feb. 23, 2026, 3:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 375 | 14233600 | ||
| 364083941 | PCTprobability | E | Feb. 23, 2026, 4:05 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 468 | 15462400 | ||
| 364109533 | Kude | E | Feb. 23, 2026, 6:07 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 484 | 15257600 | ||
| 364109002 | siganai | E | Feb. 23, 2026, 6:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 515 | 10035200 | ||
| 364112150 | turmax | E | Feb. 23, 2026, 6:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 546 | 41984000 | ||
| 364110479 | noya2 | E | Feb. 23, 2026, 6:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 609 | 24678400 | ||
| 364109542 | olmrgcsi | E | Feb. 23, 2026, 6:07 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 625 | 177561600 | ||
| 364056705 | tourist | E | Feb. 23, 2026, 3:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 640 | 25702400 | ||
| 364089536 | Sayonara_Eri | E | Feb. 23, 2026, 4:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 281 | 17612800 | ||
| 364097087 | Boboge | E | Feb. 23, 2026, 4:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 343 | 18227200 | ||
| 364099401 | JessieQY | E | Feb. 23, 2026, 4:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 359 | 16588800 | ||
| 364076130 | potato167 | E | Feb. 23, 2026, 3:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 406 | 10444800 | ||
| 364073479 | ecnerwala | E | Feb. 23, 2026, 3:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 406 | 18329600 | ||
| 364081664 | BurnedChicken | E | Feb. 23, 2026, 3:59 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 421 | 11366400 | ||
| 364076705 | 0.1w33hw3 | E | Feb. 23, 2026, 3:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 421 | 119808000 | ||
| 364106248 | wzj33300 | E | Feb. 23, 2026, 5:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 437 | 12492800 | ||
| 364102446 | toam | E | Feb. 23, 2026, 5:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 453 | 26521600 | ||
| 364106286 | Gold_Dino | E | Feb. 23, 2026, 5:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 468 | 19660800 | ||
| 364099842 | Darknef | E | Feb. 23, 2026, 4:53 p.m. | OK | Rust 2024 | TESTS | 24 | 906 | 43008000 | ||
| 364097005 | Mon_ster | E | Feb. 23, 2026, 4:44 p.m. | OK | Rust 2024 | TESTS | 24 | 1718 | 43417600 |
Back to search problems