Codeforces Round 838 (Div. 2)

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
1762 Codeforces Round 838 (Div. 2) FINISHED False 9000 66151463 Dec. 15, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9379 ) C Binary Strings are Fun PROGRAMMING combinatorics dp

B'A binary string ^ dagger b of odd length m is good if b_i is the median ^ ddagger of b[1,i]^ S for all odd indices i ( 1 <= q i <= q m ). For a binary string a of length k , a binary string b of length 2k-1 is an extension of a if b_{2i-1}=a_i for all i such that 1 <= q i <= q k . For example, 1001011 and 1101001 are extensions of the string 1001. String x= 1011011 is not an extension of string y= 1001 because x_3 neq y_2 . Note that there are 2^{k-1} different extensions of a . You are given a binary string s of length n . Find the sum of the number of good extensions over all prefixes of s . In other words, find sum_{i=1}^{n} f(s[1,i]) , where f(x) gives number of good extensions of string x . Since the answer can be quite large, you only need to find it modulo 998 ,244 ,353 . ^ dagger A binary string is a string whose elements are either mathtt{0} or mathtt{1} . ^ ddagger For a binary string a of length 2m-1 , the median of a is the (unique) element that occurs at least m times in a . ^ S a[l,r] denotes the string of length r-l+1 which is formed by the concatenation of a_l,a_{l+1}, ldots,a_r in that order. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ), where n is the length of the binary string s . The second line of each test case contains the binary string s of length n . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print the answer modulo 998 ,244 ,353 . In the first and second test cases, f(s[1,1])=1 . I'...

Tutorials

Codeforces Round #838 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
185368460 ruban C Dec. 15, 2022, 5:01 p.m. OK Delphi TESTS 14 78 27033600
185373567 ShaoWan777 C Dec. 15, 2022, 5:35 p.m. OK GNU C11 TESTS 14 93 204800
185405883 UKEr C Dec. 16, 2022, 2:21 a.m. OK GNU C++14 TESTS 15 15 204800
185386196 happycrazzy C Dec. 15, 2022, 7:20 p.m. OK GNU C++14 TESTS 14 15 204800
185407815 YeahPotato C Dec. 16, 2022, 3:09 a.m. OK GNU C++14 TESTS 15 15 204800
185374256 silentsolver C Dec. 15, 2022, 5:39 p.m. OK GNU C++14 TESTS 14 15 512000
185408172 niyiqi C Dec. 16, 2022, 3:18 a.m. OK GNU C++14 TESTS 15 15 512000
185363321 viv2002 C Dec. 15, 2022, 4:47 p.m. OK GNU C++14 TESTS 14 15 512000
185363107 swsti C Dec. 15, 2022, 4:46 p.m. OK GNU C++14 TESTS 14 15 512000
185418279 ykodwani01 C Dec. 16, 2022, 6:01 a.m. OK GNU C++14 TESTS 15 15 512000
185400837 A.D. C Dec. 15, 2022, 11:50 p.m. OK GNU C++14 TESTS 14 15 512000
185415421 -Garbage_Collection- C Dec. 16, 2022, 5:25 a.m. OK GNU C++14 TESTS 15 15 614400
185396872 AlexRex0 C Dec. 15, 2022, 10 p.m. OK GNU C++17 TESTS 14 15 204800
185414754 ongweihong C Dec. 16, 2022, 5:16 a.m. OK GNU C++17 TESTS 15 15 512000
185412280 xgk2006805yjy C Dec. 16, 2022, 4:38 a.m. OK GNU C++17 TESTS 15 15 512000
185410221 uchikhaaa C Dec. 16, 2022, 4:03 a.m. OK GNU C++17 TESTS 15 15 512000
185409787 Anil.U.S.A C Dec. 16, 2022, 3:54 a.m. OK GNU C++17 TESTS 15 15 512000
185409159 Flatday C Dec. 16, 2022, 3:40 a.m. OK GNU C++17 TESTS 15 15 512000
185407941 LanYan C Dec. 16, 2022, 3:13 a.m. OK GNU C++17 TESTS 15 15 512000
185407854 Yy_dec06 C Dec. 16, 2022, 3:10 a.m. OK GNU C++17 TESTS 15 15 512000
185406786 djs100201 C Dec. 16, 2022, 2:43 a.m. OK GNU C++17 TESTS 15 15 512000
185416307 vishalaggarwal372 C Dec. 16, 2022, 5:37 a.m. OK GNU C++17 TESTS 15 15 512000
185396689 Hantek C Dec. 15, 2022, 9:56 p.m. OK GNU C++17 (64) TESTS 14 15 512000
185411316 1potato2potato C Dec. 16, 2022, 4:22 a.m. OK GNU C++17 (64) TESTS 15 15 512000
185410902 xinjiu C Dec. 16, 2022, 4:15 a.m. OK GNU C++17 (64) TESTS 15 15 512000
185410243 ggboyy C Dec. 16, 2022, 4:04 a.m. OK GNU C++17 (64) TESTS 15 15 512000
185408200 Sam_Jiang C Dec. 16, 2022, 3:19 a.m. OK GNU C++17 (64) TESTS 15 15 512000
185405973 HideInTheSea C Dec. 16, 2022, 2:24 a.m. OK GNU C++17 (64) TESTS 15 15 512000
185404130 RohitRKS C Dec. 16, 2022, 1:34 a.m. OK GNU C++17 (64) TESTS 14 15 512000
185403504 zihouzhong C Dec. 16, 2022, 1:16 a.m. OK GNU C++17 (64) TESTS 14 15 512000
185394666 uBpc C Dec. 15, 2022, 9:15 p.m. OK GNU C++17 (64) TESTS 14 15 512000
185386553 dgupta0812 C Dec. 15, 2022, 7:25 p.m. OK GNU C++17 (64) TESTS 14 15 512000
185411460 MinhNguyen546 C Dec. 16, 2022, 4:24 a.m. OK GNU C++20 (64) TESTS 15 0 512000
185370188 UnPolinomio C Dec. 15, 2022, 5:04 p.m. OK GNU C++20 (64) TESTS 14 15 0
185365803 llking C Dec. 15, 2022, 4:54 p.m. OK GNU C++20 (64) TESTS 14 15 0
185382985 SashaT9 C Dec. 15, 2022, 6:47 p.m. OK GNU C++20 (64) TESTS 14 15 0
185390701 JV1410 C Dec. 15, 2022, 8:15 p.m. OK GNU C++20 (64) TESTS 14 15 0
185363244 Nicklaus_mickelson C Dec. 15, 2022, 4:46 p.m. OK GNU C++20 (64) TESTS 14 15 102400
185372576 EgKng C Dec. 15, 2022, 5:30 p.m. OK GNU C++20 (64) TESTS 14 15 102400
185403829 PyTorch C Dec. 16, 2022, 1:25 a.m. OK GNU C++20 (64) TESTS 14 15 204800
185418299 BlindingKnight C Dec. 16, 2022, 6:02 a.m. OK GNU C++20 (64) TESTS 15 15 512000
185417170 M-29 C Dec. 16, 2022, 5:48 a.m. OK GNU C++20 (64) TESTS 15 15 512000
185405686 Hreshi C Dec. 16, 2022, 2:16 a.m. OK Java 11 TESTS 15 186 0
185393748 doomhammer. C Dec. 15, 2022, 8:58 p.m. OK Java 11 TESTS 14 202 0
185375191 Spidey2182 C Dec. 15, 2022, 5:45 p.m. OK Java 11 TESTS 14 218 0
185373351 HeXecutor C Dec. 15, 2022, 5:34 p.m. OK Java 11 TESTS 14 233 0
185399979 mcrash12 C Dec. 15, 2022, 11:23 p.m. OK Java 11 TESTS 14 249 0
185390254 qw_er__ty C Dec. 15, 2022, 8:10 p.m. OK Java 11 TESTS 14 311 80691200
185363929 deepu1877 C Dec. 15, 2022, 4:49 p.m. OK Java 11 TESTS 14 436 0
185372037 Utsav82 C Dec. 15, 2022, 5:28 p.m. OK Java 17 TESTS 14 202 614400
185417586 Mafishard C Dec. 16, 2022, 5:53 a.m. OK Java 17 TESTS 15 217 307200
185381438 merlin_ C Dec. 15, 2022, 6:33 p.m. OK Java 17 TESTS 14 218 204800
185377033 yashbhardwaj24 C Dec. 15, 2022, 5:58 p.m. OK Java 17 TESTS 14 233 819200
185366210 MThiaweng C Dec. 15, 2022, 4:55 p.m. OK Java 17 TESTS 14 234 0
185364055 maihitohu C Dec. 15, 2022, 4:49 p.m. OK Java 17 TESTS 14 326 512000
185387284 Mohamed_A7med C Dec. 15, 2022, 7:33 p.m. OK Java 8 TESTS 14 109 0
185373008 nikhil97agra C Dec. 15, 2022, 5:32 p.m. OK Java 8 TESTS 14 109 0
185372448 invincible777 C Dec. 15, 2022, 5:29 p.m. OK Java 8 TESTS 14 109 0
185403488 ikillmyself C Dec. 16, 2022, 1:15 a.m. OK Java 8 TESTS 14 124 0
185366546 Koka C Dec. 15, 2022, 4:56 p.m. OK Java 8 TESTS 14 124 0
185362352 vaibhav_1710 C Dec. 15, 2022, 4:44 p.m. OK Java 8 TESTS 14 187 0
185367567 mwen C Dec. 15, 2022, 4:59 p.m. OK Java 8 TESTS 14 202 0
185367579 Zahid_Hasan_Sahin C Dec. 15, 2022, 4:59 p.m. OK Java 8 TESTS 14 218 0
185369758 cys02 C Dec. 15, 2022, 5:04 p.m. OK Java 8 TESTS 14 218 5836800
185403059 omeganot C Dec. 16, 2022, 1:03 a.m. OK Java 8 TESTS 14 249 38195200
185373055 sky C Dec. 15, 2022, 5:32 p.m. OK Kotlin 1.7 TESTS 14 421 11673600
185377424 LLIEPJIOK C Dec. 15, 2022, 6:02 p.m. OK MS C++ 2017 TESTS 14 62 614400
185389799 Vitru C Dec. 15, 2022, 8:04 p.m. OK MS C++ 2017 TESTS 14 62 2252800
185389707 Vitru C Dec. 15, 2022, 8:03 p.m. OK MS C++ 2017 TESTS 14 77 2252800
185373975 sweetMilk C Dec. 15, 2022, 5:37 p.m. OK MS C++ 2017 TESTS 14 124 409600
185396084 WalrusRamen21 C Dec. 15, 2022, 9:43 p.m. OK PyPy 3 TESTS 14 124 3481600
185366766 olivermaxwell112358 C Dec. 15, 2022, 4:57 p.m. OK PyPy 3 TESTS 14 139 7168000
185362923 Mathevil C Dec. 15, 2022, 4:46 p.m. OK PyPy 3 TESTS 14 451 7270400
185401854 onemoreq C Dec. 16, 2022, 12:28 a.m. OK PyPy 3-64 TESTS 14 93 4096000
185372881 CinaDor C Dec. 15, 2022, 5:31 p.m. OK PyPy 3-64 TESTS 14 93 6656000
185390881 InciteRage27 C Dec. 15, 2022, 8:18 p.m. OK PyPy 3-64 TESTS 14 93 6758400
185378850 thevaibhavdixit C Dec. 15, 2022, 6:12 p.m. OK PyPy 3-64 TESTS 14 93 6758400
185398797 abcsumit C Dec. 15, 2022, 10:48 p.m. OK PyPy 3-64 TESTS 14 93 7065600
185380276 TitaniumCube C Dec. 15, 2022, 6:23 p.m. OK PyPy 3-64 TESTS 14 93 13824000
185406032 1__2345_6 C Dec. 16, 2022, 2:25 a.m. OK PyPy 3-64 TESTS 15 108 6451200
185403352 biglunchdude C Dec. 16, 2022, 1:11 a.m. OK PyPy 3-64 TESTS 14 108 6451200
185386988 Pawan_Lahoti C Dec. 15, 2022, 7:30 p.m. OK PyPy 3-64 TESTS 14 109 6246400
185372958 sarthak2308 C Dec. 15, 2022, 5:32 p.m. OK PyPy 3-64 TESTS 14 124 8089600
185374258 _Chiko_ C Dec. 15, 2022, 5:39 p.m. OK Python 3 TESTS 14 202 716800
185407107 Odin- C Dec. 16, 2022, 2:51 a.m. OK Python 3 TESTS 15 202 5017600
185373805 mguliyev12360 C Dec. 15, 2022, 5:37 p.m. OK Python 3 TESTS 14 202 5427200
185372933 nileshmalav C Dec. 15, 2022, 5:31 p.m. OK Python 3 TESTS 14 202 5427200
185377152 alex_777 C Dec. 15, 2022, 5:59 p.m. OK Python 3 TESTS 14 218 409600
185392732 hackerman_1010 C Dec. 15, 2022, 8:43 p.m. OK Python 3 TESTS 14 218 716800
185377570 saini.laxman2002 C Dec. 15, 2022, 6:03 p.m. OK Python 3 TESTS 14 233 716800
185364497 Norghauzen C Dec. 15, 2022, 4:50 p.m. OK Python 3 TESTS 14 265 716800
185414080 jain.68 C Dec. 16, 2022, 5:07 a.m. OK Python 3 TESTS 15 373 5632000
185363946 rohanmitra2420 C Dec. 15, 2022, 4:49 p.m. OK Python 3 TESTS 14 405 14028800
185392047 liut C Dec. 15, 2022, 8:33 p.m. OK Rust 2021 TESTS 14 15 716800
185367276 celestialidiot C Dec. 15, 2022, 4:58 p.m. OK Rust 2021 TESTS 14 15 2150400

remove filters

Back to search problems