Codeforces Round 1060 (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
2154 Codeforces Round 1060 (Div. 2) FINISHED False 7200 15521123 Oct. 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 23043 ) A Notelock PROGRAMMING greedy two pointers

Teto is playing the hit rhythm game osu! . The game can be described by a binary string(^{\text{∗}}) (s) of length (n) and a positive integer (k) where the following will happen in order: You will choose some positions in (s) to protect. Then for each (i) ((1 \le i \le n)) in increasing order, Teto can set (s_i) to (\mathtt{0}) if all the following are true: (s_i = \mathtt{1}), (s_i) is not protected, the previous (k - 1) elements do not contain (\mathtt{1}). More formally, (\mathtt{1}) does not occur in (s_{\max(1, i - k + 1)},\ldots,s_{i - 1}). (s_i = \mathtt{1}), (s_i) is not protected, the previous (k - 1) elements do not contain (\mathtt{1}). More formally, (\mathtt{1}) does not occur in (s_{\max(1, i - k + 1)},\ldots,s_{i - 1}). You dislike Teto (for some reason). So determine the minimum number of positions you need to protect to force her to leave (s) unchanged. (^{\text{∗}})A binary string is a string that only consists of characters (\mathtt{0}) and (\mathtt{1}). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each testcase contains integers (n) and (k) ((2 \le n \le 1000); (2 \le k \le n)) — the length of (s) and (k). The second line of each test case contains a binary string (s) of length (n) consisting of characters (\mathtt{0}) and (\mathtt{1}). The sum of (n) across all testcases does not exceed (1000). For each testcase, output the minimum number of positions you need to protect to force Teto to leave the string unchanged. For the first testcase, you can protect the first element and have: (s = \mathtt{\color{red}{1}1}). Now Teto cannot change (s_1) because it is protected and cannot change (s_2) because (s_1 = \mathtt{1}). It can be proven this i

Tutorials

Codeforces Round 1060 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
344770940 ksandr1v A Oct. 19, 2025, 7:40 p.m. OK C# 13 TESTS 4 93 0
344795928 stubborn_coder_ A Oct. 20, 2025, 2:50 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
344805588 13201862045npy A Oct. 20, 2025, 5:01 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344800793 QodeXpert A Oct. 20, 2025, 3:57 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344800408 rohit74 A Oct. 20, 2025, 3:52 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344800357 OurLokman A Oct. 20, 2025, 3:51 a.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344785622 warbubbles A Oct. 19, 2025, 11:20 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344755837 _shivam__chaudhary A Oct. 19, 2025, 5:57 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344753420 bhargav_gande A Oct. 19, 2025, 5:45 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344753372 teja060607 A Oct. 19, 2025, 5:45 p.m. OK C++17 (GCC 7-32) TESTS 4 30 0
344808281 rohitginni A Oct. 20, 2025, 5:29 a.m. OK C++17 (GCC 7-32) TESTS 4 31 0
344809798 raghava118 A Oct. 20, 2025, 5:43 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344799367 mzxqltyogb A Oct. 20, 2025, 3:38 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344796138 JuanSoria A Oct. 20, 2025, 2:53 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344792006 _MJX_555 A Oct. 20, 2025, 1:48 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344789519 sunil_patel A Oct. 20, 2025, 12:59 a.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344785876 Dipu5 A Oct. 19, 2025, 11:28 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344782418 Arwill A Oct. 19, 2025, 10:06 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344755237 rohithpurchury12 A Oct. 19, 2025, 5:54 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0
344786349 The_fastest_one A Oct. 19, 2025, 11:41 p.m. OK C++20 (GCC 13-64) TESTS 4 30 204800
344786133 ACE0172 A Oct. 19, 2025, 11:35 p.m. OK C++20 (GCC 13-64) TESTS 4 30 1945600
344810954 akshanshpawar120 A Oct. 20, 2025, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344807738 InviBull A Oct. 20, 2025, 5:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344807649 EdGrass A Oct. 20, 2025, 5:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344805855 jef_22_12 A Oct. 20, 2025, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344804263 ROHIT_MAHAWAR A Oct. 20, 2025, 4:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344803486 tasnim07 A Oct. 20, 2025, 4:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344797760 5htb A Oct. 20, 2025, 3:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344796490 ahmed_osamaa A Oct. 20, 2025, 2:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344784305 GunjanMahor01 A Oct. 19, 2025, 10:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344780431 ahmed_samy_hekal A Oct. 19, 2025, 9:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
344800012 jai314 A Oct. 20, 2025, 3:46 a.m. OK GNU C11 TESTS 4 15 0
344802617 joyeedev A Oct. 20, 2025, 4:23 a.m. OK GNU C11 TESTS 4 31 0
344759312 Blank_yoma A Oct. 19, 2025, 6:16 p.m. OK GNU C11 TESTS 4 31 0
344778054 ilkham_s A Oct. 19, 2025, 8:58 p.m. OK GNU C11 TESTS 4 31 102400
344774450 shivam_9939 A Oct. 19, 2025, 8:15 p.m. OK GNU C11 TESTS 4 31 102400
344772680 Aryannnn711 A Oct. 19, 2025, 7:56 p.m. OK GNU C11 TESTS 4 31 102400
344771706 Aryannnn711 A Oct. 19, 2025, 7:47 p.m. OK GNU C11 TESTS 4 31 102400
344754223 hk_moistduck A Oct. 19, 2025, 5:49 p.m. OK GNU C11 TESTS 4 46 0
344811486 lucky_888 A Oct. 20, 2025, 5:59 a.m. OK GNU C11 TESTS 4 46 102400
344802912 _slayer17 A Oct. 20, 2025, 4:27 a.m. OK GNU C11 TESTS 4 46 102400
344791067 uffhottie A Oct. 20, 2025, 1:30 a.m. OK Go TESTS 4 78 0
344763086 Goutham_808 A Oct. 19, 2025, 6:40 p.m. OK Java 21 TESTS 4 187 409600
344799392 akashtiwariaku A Oct. 20, 2025, 3:38 a.m. OK Java 21 TESTS 4 202 0
344773258 Amrit_0407 A Oct. 19, 2025, 8:01 p.m. OK Java 21 TESTS 4 202 0
344761521 LakhimpurKheri A Oct. 19, 2025, 6:30 p.m. OK Java 21 TESTS 4 202 0
344791547 h_maano A Oct. 20, 2025, 1:39 a.m. OK Java 21 TESTS 4 202 307200
344792211 GuLLu05 A Oct. 20, 2025, 1:52 a.m. OK Java 21 TESTS 4 202 512000
344761143 disha00 A Oct. 19, 2025, 6:27 p.m. OK Java 21 TESTS 4 203 716800
344772979 akshat.codes A Oct. 19, 2025, 7:59 p.m. OK Java 21 TESTS 4 217 0
344791832 bomakhamchha A Oct. 20, 2025, 1:45 a.m. OK Java 21 TESTS 4 218 0
344805503 __Aviral__ A Oct. 20, 2025, 5 a.m. OK Java 21 TESTS 4 218 307200
344760820 newaz420 A Oct. 19, 2025, 6:26 p.m. OK Java 8 TESTS 4 140 0
344765724 sarthaKKharKa_18 A Oct. 19, 2025, 6:57 p.m. OK Java 8 TESTS 4 155 0
344752068 Eslam_Ahmed A Oct. 19, 2025, 5:39 p.m. OK Java 8 TESTS 4 171 0
344789593 suntansoker A Oct. 20, 2025, 1 a.m. OK Java 8 TESTS 4 186 0
344785053 swseverance A Oct. 19, 2025, 11:05 p.m. OK Node.js TESTS 4 93 102400
344761756 dakshagarwaliitd A Oct. 19, 2025, 6:31 p.m. OK PyPy 3 TESTS 4 77 0
344788148 Biggaypig A Oct. 20, 2025, 12:28 a.m. OK PyPy 3 TESTS 4 78 0
344754273 Aquib_is_coder A Oct. 19, 2025, 5:49 p.m. OK PyPy 3 TESTS 4 93 1433600
344797138 qyzm123 A Oct. 20, 2025, 3:07 a.m. OK PyPy 3-64 TESTS 4 61 0
344757842 Ashaman04 A Oct. 19, 2025, 6:08 p.m. OK PyPy 3-64 TESTS 4 61 0
344803927 hiibuddy A Oct. 20, 2025, 4:40 a.m. OK PyPy 3-64 TESTS 4 62 0
344774900 codeforces_inesh A Oct. 19, 2025, 8:20 p.m. OK PyPy 3-64 TESTS 4 62 0
344767998 Flaminate A Oct. 19, 2025, 7:16 p.m. OK PyPy 3-64 TESTS 4 62 0
344808935 The_dark_lord_1308 A Oct. 20, 2025, 5:35 a.m. OK PyPy 3-64 TESTS 4 77 0
344807381 Shyam414 A Oct. 20, 2025, 5:20 a.m. OK PyPy 3-64 TESTS 4 77 0
344807187 Lamohehe A Oct. 20, 2025, 5:18 a.m. OK PyPy 3-64 TESTS 4 77 0
344804149 learnerdaily5 A Oct. 20, 2025, 4:43 a.m. OK PyPy 3-64 TESTS 4 77 0
344800267 Emikooh A Oct. 20, 2025, 3:50 a.m. OK PyPy 3-64 TESTS 4 77 0
344796163 santhoshduggana A Oct. 20, 2025, 2:54 a.m. OK Python 3 TESTS 4 46 0
344779907 pranshu11 A Oct. 19, 2025, 9:25 p.m. OK Python 3 TESTS 4 46 0
344753013 Rudrashis_231006 A Oct. 19, 2025, 5:43 p.m. OK Python 3 TESTS 4 46 0
344805438 sujeethreddy00077 A Oct. 20, 2025, 4:59 a.m. OK Python 3 TESTS 4 61 0
344803671 Vivekdonka A Oct. 20, 2025, 4:37 a.m. OK Python 3 TESTS 4 61 0
344803608 srirammaddimsetti A Oct. 20, 2025, 4:36 a.m. OK Python 3 TESTS 4 61 0
344802367 Tulasi_02 A Oct. 20, 2025, 4:19 a.m. OK Python 3 TESTS 4 61 0
344801607 Maha_palepu A Oct. 20, 2025, 4:09 a.m. OK Python 3 TESTS 4 61 0
344795557 surendravarma780 A Oct. 20, 2025, 2:45 a.m. OK Python 3 TESTS 4 61 0
344788131 Koishi_114514 A Oct. 20, 2025, 12:28 a.m. OK Python 3 TESTS 4 61 0
344770381 RezwanAhmedRatul A Oct. 19, 2025, 7:35 p.m. OK Rust 2024 TESTS 4 46 0
344769621 reljoubbeh A Oct. 19, 2025, 7:29 p.m. OK Rust 2024 TESTS 4 61 0

remove filters

Back to search problems