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 |
|---|---|---|---|---|---|---|
| 2255 | Codeforces Round 1116 (Div. 1) | FINISHED | False | 9000 | 2820275 | Aug. 9, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 6959 ) | B | A Ribbon for Tomorrow | PROGRAMMING | combinatorics math |
Nephren has never been fond of long farewells. Before Chtholly leaves for her next mission, she says nothing and begins preparing a small ribbon for her instead. She places (n) glass beads in a row on the table before threading them onto the ribbon. Each bead is either white or black. A binary(^{\text{∗}}) string (s) represents their colors: the character (\mathtt{0}) represents a white bead, and the character (\mathtt{1}) represents a black bead. To make the arrangement less ordinary, Nephren turns it into a small game. She can perform the following operation any number of times (possibly zero): Choose two indices (l) and (r) ((1 \le l \le r \le n)) such that (s_l=s_r) in the current string, and reverse(^{\text{†}}) the substring (s_l s_{l+1}\ldots s_r). For example, if (s=\mathtt{00110}), Nephren may choose (l=1) and (r=5), since (s_1=s_5=\mathtt{0}). After the operation, the string becomes (\mathtt{01100}). Determine the number of different binary strings that can be obtained from (s). Since this number may be large, output it modulo (998\,244\,353). (^{\text{∗}})A binary string is a string where each character is either (\mathtt 0) or (\mathtt 1). (^{\text{†}})To reverse a substring (s_l s_{l+1}\ldots s_r) means to replace it with (s_r s_{r-1}\ldots s_l). 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 one integer (n) ((1 \le n \le 10^6)) — the number of beads. The second line contains a binary string (s) of length (n), describing the colors of the beads. It is guaranteed that the sum of (n) over all test cases does not exceed (10^6). For each test case, output a single integer — the number of different binary strings that can be obtained from (s), modulo $$$998\,244\,353$$ |
| 155840 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 386407775 | SlowerFun | B | Aug. 9, 2026, 6:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 62 | 8089600 | ||
| 386360990 | Miaoborui | B | Aug. 9, 2026, 3:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 62 | 8089600 | ||
| 386350618 | dyzets | B | Aug. 9, 2026, 2:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 62 | 8089600 | ||
| 386362182 | supercoder888 | B | Aug. 9, 2026, 3:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 62 | 16076800 | ||
| 386349843 | Lucas4732 | B | Aug. 9, 2026, 2:55 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 62 | 37171200 | ||
| 386424621 | lmjsjg | B | Aug. 10, 2026, 1:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 78 | 1024000 | ||
| 386356795 | _LuoGu715948_ | B | Aug. 9, 2026, 3:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 78 | 1024000 | ||
| 386358092 | Mehryad | B | Aug. 9, 2026, 3:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 78 | 8089600 | ||
| 386365749 | Alexanderter10 | B | Aug. 9, 2026, 3:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 78 | 8908800 | ||
| 386363050 | gregson | B | Aug. 9, 2026, 3:18 p.m. | OK | C++17 (GCC 7-32) | TESTS | 26 | 78 | 9113600 | ||
| 386367480 | NULLx0 | B | Aug. 9, 2026, 3:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 0 | ||
| 386350484 | greateric | B | Aug. 9, 2026, 2:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 102400 | ||
| 386366248 | nwblanton | B | Aug. 9, 2026, 3:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 6246400 | ||
| 386359362 | siganai | B | Aug. 9, 2026, 3:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 6246400 | ||
| 386357616 | t98slider | B | Aug. 9, 2026, 3:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 6246400 | ||
| 386348353 | Fake121 | B | Aug. 9, 2026, 2:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 7270400 | ||
| 386354682 | Kustov_Vadim_533 | B | Aug. 9, 2026, 3:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 8089600 | ||
| 386354306 | Art.ogo | B | Aug. 9, 2026, 3:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 8089600 | ||
| 386353350 | nikhil_thogaru | B | Aug. 9, 2026, 3 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 8089600 | ||
| 386345507 | kotatsugame | B | Aug. 9, 2026, 2:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 26 | 46 | 10342400 | ||
| 386347209 | ecnerwala | B | Aug. 9, 2026, 2:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 0 | ||
| 386344634 | makeit427 | B | Aug. 9, 2026, 2:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 0 | ||
| 386359766 | dang3r | B | Aug. 9, 2026, 3:12 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 102400 | ||
| 386344880 | fIower | B | Aug. 9, 2026, 2:48 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 102400 | ||
| 386365118 | oblememan | B | Aug. 9, 2026, 3:22 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 4096000 | ||
| 386364512 | leo2810 | B | Aug. 9, 2026, 3:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 4096000 | ||
| 386392906 | jorgevmg31 | B | Aug. 9, 2026, 4:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 6348800 | ||
| 386380872 | HubertM6 | B | Aug. 9, 2026, 4 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 6348800 | ||
| 386364383 | rehaan.ahmad | B | Aug. 9, 2026, 3:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 8089600 | ||
| 386359665 | DJeniUp | B | Aug. 9, 2026, 3:11 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 26 | 46 | 8089600 | ||
| 386353279 | Gassa | B | Aug. 9, 2026, 3 p.m. | OK | D | TESTS | 26 | 203 | 27545600 | ||
| 386377152 | pengin_2000 | B | Aug. 9, 2026, 3:49 p.m. | OK | GNU C11 | TESTS | 26 | 515 | 17100800 | ||
| 386356142 | codecrasher_ | B | Aug. 9, 2026, 3:05 p.m. | OK | Go | TESTS | 26 | 62 | 20787200 | ||
| 386353680 | LT1 | B | Aug. 9, 2026, 3:01 p.m. | OK | Java 21 | TESTS | 26 | 312 | 18432000 | ||
| 386348385 | MBBN | B | Aug. 9, 2026, 2:53 p.m. | OK | Java 21 | TESTS | 26 | 328 | 18636800 | ||
| 386359775 | iam_bk | B | Aug. 9, 2026, 3:12 p.m. | OK | Java 21 | TESTS | 26 | 328 | 36966400 | ||
| 386366329 | sefirah | B | Aug. 9, 2026, 3:24 p.m. | OK | Java 21 | TESTS | 26 | 359 | 18944000 | ||
| 386350123 | AJ123496 | B | Aug. 9, 2026, 2:55 p.m. | OK | Java 21 | TESTS | 26 | 437 | 18841600 | ||
| 386366217 | malachi_toney_goat | B | Aug. 9, 2026, 3:24 p.m. | OK | Java 8 | TESTS | 26 | 187 | 27033600 | ||
| 386355811 | dark_slayer007 | B | Aug. 9, 2026, 3:04 p.m. | OK | Java 8 | TESTS | 26 | 187 | 29900800 | ||
| 386347056 | Tlatoani | B | Aug. 9, 2026, 2:51 p.m. | OK | Kotlin 2.2 | TESTS | 26 | 218 | 16588800 | ||
| 386343295 | arvindf232 | B | Aug. 9, 2026, 2:46 p.m. | OK | Kotlin 2.2 | TESTS | 26 | 265 | 11878400 | ||
| 386354192 | Hallowno4 | B | Aug. 9, 2026, 3:02 p.m. | OK | PyPy 3-64 | TESTS | 26 | 125 | 21913600 | ||
| 386360319 | dparth_7 | B | Aug. 9, 2026, 3:12 p.m. | OK | PyPy 3-64 | TESTS | 26 | 140 | 23756800 | ||
| 386352466 | PaperMemory | B | Aug. 9, 2026, 2:59 p.m. | OK | PyPy 3-64 | TESTS | 26 | 156 | 24371200 | ||
| 386344227 | toam | B | Aug. 9, 2026, 2:47 p.m. | OK | PyPy 3-64 | TESTS | 26 | 156 | 39116800 | ||
| 386373021 | chhillarankit74 | B | Aug. 9, 2026, 3:39 p.m. | OK | PyPy 3-64 | TESTS | 26 | 156 | 48128000 | ||
| 386352311 | code.demon | B | Aug. 9, 2026, 2:59 p.m. | OK | PyPy 3-64 | TESTS | 26 | 187 | 43315200 | ||
| 386351155 | x0rque | B | Aug. 9, 2026, 2:57 p.m. | OK | PyPy 3-64 | TESTS | 26 | 203 | 23040000 | ||
| 386424037 | Little_Sheep_Yawn | B | Aug. 10, 2026, 12:47 a.m. | OK | PyPy 3-64 | TESTS | 26 | 203 | 32153600 | ||
| 386401478 | towersfreak2006 | B | Aug. 9, 2026, 5:30 p.m. | OK | PyPy 3-64 | TESTS | 26 | 218 | 22425600 | ||
| 386357282 | Maruzensky | B | Aug. 9, 2026, 3:07 p.m. | OK | PyPy 3-64 | TESTS | 26 | 218 | 56422400 | ||
| 386347871 | maworkin | B | Aug. 9, 2026, 2:52 p.m. | OK | Python 3 | TESTS | 26 | 390 | 42700800 | ||
| 386358321 | de1uxegg | B | Aug. 9, 2026, 3:09 p.m. | OK | Python 3 | TESTS | 26 | 468 | 85811200 | ||
| 386356176 | d11maan | B | Aug. 9, 2026, 3:05 p.m. | OK | Rust 2024 | TESTS | 26 | 46 | 14233600 | ||
| 386352045 | DanielAnker | B | Aug. 9, 2026, 2:58 p.m. | OK | Rust 2024 | TESTS | 26 | 46 | 16179200 | ||
| 386351984 | will_wang | B | Aug. 9, 2026, 2:58 p.m. | OK | Rust 2024 | TESTS | 26 | 62 | 204800 | ||
| 386353498 | darkkcyan | B | Aug. 9, 2026, 3:01 p.m. | OK | Rust 2024 | TESTS | 26 | 62 | 8908800 | ||
| 386352125 | sansen | B | Aug. 9, 2026, 2:58 p.m. | OK | Rust 2024 | TESTS | 26 | 62 | 12902400 | ||
| 386364018 | cvs-650 | B | Aug. 9, 2026, 3:19 p.m. | OK | Rust 2024 | TESTS | 26 | 62 | 40448000 | ||
| 386357335 | trycatchcry | B | Aug. 9, 2026, 3:07 p.m. | OK | Rust 2024 | TESTS | 26 | 78 | 16076800 | ||
| 386350442 | Solalyth | B | Aug. 9, 2026, 2:56 p.m. | OK | Rust 2024 | TESTS | 26 | 93 | 45465600 |
Back to search problems