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 |
|---|---|---|---|---|---|---|
| 2048 | Codeforces Global Round 28 | FINISHED | False | 10800 | 41786723 | Dec. 19, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 245 ) | H | Kevin and Strange Operation | PROGRAMMING | data structures dp |
Kevin is exploring problems related to binary strings in Chinatown. When he was at a loss, a stranger approached him and introduced a peculiar operation: Suppose the current binary string is (t), with a length of (\vert t \vert). Choose an integer (1 \leq p \leq \vert t \vert). For all (1 \leq i < p), simultaneously perform the operation (t_i = \max(t_i, t_{i+1})), and then delete (t_p). For example, suppose the current binary string is 01001 , and you choose (p = 4). Perform (t_i = \max(t_i, t_{i+1})) for (t_1), (t_2), and (t_3), transforming the string into 11001 , then delete (t_4), resulting in 1101 . Kevin finds this strange operation quite interesting. Thus, he wants to ask you: Given a binary string (s), how many distinct non-empty binary strings can you obtain through any number of operations (possibly zero)? Since the answer may be very large, you only need to output the result modulo (998\,244\,353). Each test contains multiple test cases. The first line contains a single integer (t) ((1\le t \le 10^4)) — the number of test cases. For each test case, the only line contains a binary string (s) ((1 \le \lvert s \rvert \le 10^6)). It is guaranteed that the sum of (\lvert s \rvert) over all test cases does not exceed (10^6). For each test case, print a single integer in the only line of the output — the number of distinct non-empty binary strings you can obtain, modulo (998\,244\,353). In the first test case, all the binary strings you can obtain are: 11001 , 1001 , 1101 , 001 , 101 , 111 , 01 , 11 , and 1 . There are (9) in total. |
| Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 297338206 | grass8sheep | H | Dec. 19, 2024, 5:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 34 | 77 | 13107200 | ||
| 297376343 | wutongchun | H | Dec. 20, 2024, 2:30 a.m. | OK | C++17 (GCC 7-32) | TESTS | 34 | 171 | 47513600 | ||
| 297381522 | maxplus | H | Dec. 20, 2024, 4:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 62 | 2457600 | ||
| 297373778 | qiuzx | H | Dec. 20, 2024, 1:28 a.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 93 | 37683200 | ||
| 297351435 | jeroenodb | H | Dec. 19, 2024, 6:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 108 | 2457600 | ||
| 297344413 | tute7627 | H | Dec. 19, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 108 | 18944000 | ||
| 297387601 | CALLSIGN_NULL_ | H | Dec. 20, 2024, 5:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 109 | 8089600 | ||
| 297341177 | fengqiyuka | H | Dec. 19, 2024, 5:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 109 | 16076800 | ||
| 297350528 | BurnedChicken | H | Dec. 19, 2024, 6:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 124 | 9625600 | ||
| 297335181 | HIR180 | H | Dec. 19, 2024, 5 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 124 | 14950400 | ||
| 297342528 | cxm1024 | H | Dec. 19, 2024, 5:25 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 140 | 8089600 | ||
| 297335422 | Fido_Puppy | H | Dec. 19, 2024, 5:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 34 | 140 | 8089600 | ||
| 297368304 | neal | H | Dec. 19, 2024, 10:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 62 | 6963200 | ||
| 297368285 | neal | H | Dec. 19, 2024, 10:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 77 | 6963200 | ||
| 297368212 | neal | H | Dec. 19, 2024, 10:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 78 | 6553600 | ||
| 297345055 | Endagorion | H | Dec. 19, 2024, 5:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 92 | 4812800 | ||
| 297342170 | noimi | H | Dec. 19, 2024, 5:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 92 | 12800000 | ||
| 297368211 | neal | H | Dec. 19, 2024, 10:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 93 | 6553600 | ||
| 297343073 | potato167 | H | Dec. 19, 2024, 5:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 93 | 6553600 | ||
| 297341983 | Thienu | H | Dec. 19, 2024, 5:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 93 | 14745600 | ||
| 297335799 | Kevin114514 | H | Dec. 19, 2024, 5:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 109 | 21708800 | ||
| 297343246 | risujiroh | H | Dec. 19, 2024, 5:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 34 | 124 | 6553600 | ||
| 297368158 | rainboy | H | Dec. 19, 2024, 10:28 p.m. | OK | GNU C11 | TESTS | 34 | 93 | 9113600 | ||
| 297343856 | arvindf232 | H | Dec. 19, 2024, 5:29 p.m. | OK | Kotlin 1.9 | TESTS | 34 | 530 | 52940800 | ||
| 297337381 | chinerist | H | Dec. 19, 2024, 5:08 p.m. | OK | PyPy 3-64 | TESTS | 34 | 296 | 53043200 |
Back to search problems