Codeforces Round 1003 (Div. 4)

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
2065 Codeforces Round 1003 (Div. 4) FINISHED False 8100 37293922 Feb. 9, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1953 ) H Bro Thinks He's Him PROGRAMMING combinatorics data structures dp matrices

Skibidus thinks he's Him! He proved it by solving this difficult task. Can you also prove yourself? Given a binary string(^{\text{∗}}) (t), (f(t)) is defined as the minimum number of contiguous substrings, each consisting of identical characters, into which (t) can be partitioned. For example, (f(00110001) = 4) because (t) can be partitioned as (00110001) where each bracketed segment consists of identical characters. Skibidus gives you a binary string (s) and (q) queries. In each query, a single character of the string is flipped (i.e. (0) changes to (1) and (1) changes to (0)); changes are saved after the query is processed. After each query, output the sum over all (f(b)) where (b) is a non-empty subsequence(^{\text{†}}) of (s), modulo (998\,244\,353). (^{\text{∗}})A binary string consists of only characters (0) and (1). (^{\text{†}})A subsequence of a string is a string which can be obtained by removing several (possibly zero) characters from the original string. The first line contains an integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains a binary string (s) ((1 \leq |s| \leq 2 \cdot 10^5)). The following line of each test case contains an integer (q) ((1 \leq q \leq 2 \cdot 10^5)) — the number of queries. The following line contains (q) integers (v_1, v_2, \ldots, v_q) ((1 \leq v_i \leq |s|)), denoting (s_{v_i}) is flipped for the (i)'th query. It is guaranteed that the sum of (|s|) and the sum of (q) over all test cases does not exceed (2 \cdot 10^5). For each test case, output (q) integers on a single line — the answer after each query modulo (998\,244\,353). In the first test case, (s) becomes (001) after the first query. Let's calculate the answer fo

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
305377274 failed_scholar H Feb. 9, 2025, 9:16 p.m. OK C++17 (GCC 7-32) TESTS 6 202 2457600
305404509 wistful23 H Feb. 10, 2025, 4:43 a.m. OK C++17 (GCC 7-32) TESTS 6 233 1638400
305397272 Aftglw H Feb. 10, 2025, 3:21 a.m. OK C++17 (GCC 7-32) TESTS 6 233 3993600
305380299 6ggkk9 H Feb. 9, 2025, 10:07 p.m. OK C++17 (GCC 7-32) TESTS 6 296 12800000
305379405 JOliva H Feb. 9, 2025, 9:52 p.m. OK C++17 (GCC 7-32) TESTS 6 374 14336000
305402532 Cloudy_Sky_ H Feb. 10, 2025, 4:24 a.m. OK C++17 (GCC 7-32) TESTS 6 405 8601600
305371184 anonymous6021 H Feb. 9, 2025, 7:55 p.m. OK C++17 (GCC 7-32) TESTS 6 437 4812800
305370910 prashant_1609 H Feb. 9, 2025, 7:53 p.m. OK C++17 (GCC 7-32) TESTS 6 437 6451200
305368433 adityapatel.devloper H Feb. 9, 2025, 7:27 p.m. OK C++17 (GCC 7-32) TESTS 6 452 6451200
305371197 Shayan H Feb. 9, 2025, 7:56 p.m. OK C++17 (GCC 7-32) TESTS 6 468 4710400
305381810 Justinshao H Feb. 9, 2025, 10:40 p.m. OK C++20 (GCC 13-64) TESTS 6 171 1433600
305404585 Mkswll H Feb. 10, 2025, 4:44 a.m. OK C++20 (GCC 13-64) TESTS 6 171 2457600
305391340 daoqi H Feb. 10, 2025, 2:02 a.m. OK C++20 (GCC 13-64) TESTS 6 187 614400
305406529 z_squared H Feb. 10, 2025, 5:05 a.m. OK C++20 (GCC 13-64) TESTS 6 187 1945600
305397107 Noodles H Feb. 10, 2025, 3:19 a.m. OK C++20 (GCC 13-64) TESTS 6 187 80179200
305386152 Khaled_Al_Awad H Feb. 10, 2025, 12:28 a.m. OK C++20 (GCC 13-64) TESTS 6 202 4812800
305405774 AGI H Feb. 10, 2025, 4:56 a.m. OK C++20 (GCC 13-64) TESTS 6 202 8089600
305362718 Taha_adeel H Feb. 9, 2025, 6:39 p.m. OK C++20 (GCC 13-64) TESTS 6 202 9830400
305408170 Little_Sheep_Yawn H Feb. 10, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 6 202 26726400
305376174 AlexW08 H Feb. 9, 2025, 9 p.m. OK C++20 (GCC 13-64) TESTS 6 203 819200
305365132 CutSandstone H Feb. 9, 2025, 6:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 140 716800
305371320 gk_ H Feb. 9, 2025, 7:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 217 5734400
305367142 Abdelrahman._. H Feb. 9, 2025, 7:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 218 11161600
305364880 KisuraOP H Feb. 9, 2025, 6:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 234 1433600
305396640 brownspy1 H Feb. 10, 2025, 3:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 234 4915200
305396100 U_L_T-Paoku H Feb. 10, 2025, 3:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 234 8908800
305372209 hell_hacker H Feb. 9, 2025, 8:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 234 9625600
305359660 aryanc403 H Feb. 9, 2025, 6:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 234 12288000
305371143 Ange1 H Feb. 9, 2025, 7:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 249 4710400
305357257 Abd H Feb. 9, 2025, 6:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 249 4812800
305381340 Drakiana H Feb. 9, 2025, 10:30 p.m. OK GNU C11 TESTS 6 1249 8089600
305379081 bengold10 H Feb. 9, 2025, 9:46 p.m. OK PyPy 3-64 TESTS 6 546 41472000
305385215 Mehran_usb H Feb. 10, 2025, 12:07 a.m. OK PyPy 3-64 TESTS 6 561 41267200
305359806 Aditya_kakrania H Feb. 9, 2025, 6:19 p.m. OK PyPy 3-64 TESTS 6 593 46182400
305361394 Naruto_x H Feb. 9, 2025, 6:29 p.m. OK PyPy 3-64 TESTS 6 733 36556800
305408967 _vhagar H Feb. 10, 2025, 5:26 a.m. OK PyPy 3-64 TESTS 6 1140 53657600
305389636 Spheniscine H Feb. 10, 2025, 1:36 a.m. OK Rust 2021 TESTS 6 515 34918400

remove filters

Back to search problems