Codeforces Round 898 (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
1873 Codeforces Round 898 (Div. 4) FINISHED False 9000 36516299 Sept. 21, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 35690 ) D 1D Eraser PROGRAMMING greedy implementation

B'You are given a strip of paper s that is n cells long. Each cell is either black or white. In an operation you can take any k consecutive cells and make them all white. Find the minimum number of operations needed to remove all black cells. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 1 <= q k <= q n <= q 2 cdot 10^5 ) -- the length of the paper and the integer used in the operation. The second line of each test case contains a string s of length n consisting of characters texttt{B} (representing a black cell) or texttt{W} (representing a white cell). The sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the minimum number of operations needed to remove all black cells. In the first test case you can perform the following operations: color{red}{ texttt{WBW}} texttt{WWB} to texttt{WWW} color{red}{ texttt{WWB}} to texttt{WWWWWW} In the second test case you can perform the following operations: texttt{WW} color{red}{ texttt{BWB}} texttt{WW} to texttt{WWWWWWW} In the third test case you can perform the following operations: texttt{B} color{red}{ texttt{WBWB}} to color{red}{ texttt{BWWW}} texttt{W} to texttt{WWWWW} '...

Tutorials

120634

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
224536603 Morty_Coder D Sept. 21, 2023, 10:27 p.m. OK C# 10 TESTS 7 124 921600
224537710 bluemegane D Sept. 21, 2023, 10:54 p.m. OK C# 8 TESTS 7 93 2764800
224561190 sqqmr D Sept. 22, 2023, 5:31 a.m. OK Clang++17 Diagnostics TESTS 7 46 0
224558154 ltmh D Sept. 22, 2023, 4:55 a.m. OK Clang++17 Diagnostics TESTS 7 46 307200
224554617 qiaochu D Sept. 22, 2023, 4:06 a.m. OK Clang++20 Diagnostics TESTS 7 46 13209600
224553988 SlowMagic D Sept. 22, 2023, 3:56 a.m. OK Clang++20 Diagnostics TESTS 7 62 13004800
224545882 brightest66 D Sept. 22, 2023, 1:59 a.m. OK Clang++20 Diagnostics TESTS 7 62 13004800
224522546 Zaavan D Sept. 21, 2023, 7 p.m. OK GNU C11 TESTS 7 15 0
224546604 Rajorshi_Das D Sept. 22, 2023, 2:10 a.m. OK GNU C11 TESTS 7 15 204800
224516602 aastik231205 D Sept. 21, 2023, 6:09 p.m. OK GNU C11 TESTS 7 15 204800
224523961 naimPAiNamp D Sept. 21, 2023, 7:15 p.m. OK GNU C11 TESTS 7 15 204800
224557847 ahmedafeef D Sept. 22, 2023, 4:51 a.m. OK GNU C11 TESTS 7 15 204800
224530956 kingslayer268 D Sept. 21, 2023, 8:38 p.m. OK GNU C11 TESTS 7 31 204800
224562847 Zuko004 D Sept. 22, 2023, 5:48 a.m. OK GNU C11 TESTS 7 31 204800
224526379 be_lal D Sept. 21, 2023, 7:43 p.m. OK GNU C11 TESTS 7 31 204800
224526404 cakida D Sept. 21, 2023, 7:43 p.m. OK GNU C11 TESTS 7 31 204800
224545553 IkezawaHanako D Sept. 22, 2023, 1:53 a.m. OK GNU C11 TESTS 7 31 307200
224554429 Inception02 D Sept. 22, 2023, 4:02 a.m. OK GNU C++14 TESTS 7 15 204800
224539836 Kelvin_L D Sept. 21, 2023, 11:55 p.m. OK GNU C++14 TESTS 7 15 204800
224554404 dumb_s D Sept. 22, 2023, 4:02 a.m. OK GNU C++14 TESTS 7 15 512000
224563947 hnust_wunengwu D Sept. 22, 2023, 6 a.m. OK GNU C++14 TESTS 7 15 512000
224562664 Mostafa0021 D Sept. 22, 2023, 5:46 a.m. OK GNU C++14 TESTS 7 15 512000
224560703 akshay_2902 D Sept. 22, 2023, 5:26 a.m. OK GNU C++14 TESTS 7 15 512000
224558782 Akct D Sept. 22, 2023, 5:02 a.m. OK GNU C++14 TESTS 7 15 512000
224558425 XCPC D Sept. 22, 2023, 4:58 a.m. OK GNU C++14 TESTS 7 15 512000
224557172 _benben123 D Sept. 22, 2023, 4:43 a.m. OK GNU C++14 TESTS 7 15 512000
224555417 kuguadawang D Sept. 22, 2023, 4:18 a.m. OK GNU C++14 TESTS 7 15 512000
224548362 satvik2323 D Sept. 22, 2023, 2:39 a.m. OK GNU C++17 TESTS 7 0 512000
224557096 bikcrombiswas1234 D Sept. 22, 2023, 4:42 a.m. OK GNU C++17 TESTS 7 0 512000
224536834 The_White_Hat D Sept. 21, 2023, 10:32 p.m. OK GNU C++17 TESTS 7 0 512000
224523566 danielnoletodiscenteufg D Sept. 21, 2023, 7:11 p.m. OK GNU C++17 TESTS 7 0 512000
224559533 fireLUFFYY D Sept. 22, 2023, 5:12 a.m. OK GNU C++17 TESTS 7 0 3174400
224518375 3Dg4R-YZ D Sept. 21, 2023, 6:23 p.m. OK GNU C++17 TESTS 7 15 0
224552300 StayDetermined D Sept. 22, 2023, 3:39 a.m. OK GNU C++17 TESTS 7 15 102400
224563788 why_pulkit14 D Sept. 22, 2023, 5:58 a.m. OK GNU C++17 TESTS 7 15 204800
224563630 tnakao D Sept. 22, 2023, 5:56 a.m. OK GNU C++17 TESTS 7 15 204800
224563317 MehradSh D Sept. 22, 2023, 5:53 a.m. OK GNU C++17 TESTS 7 15 204800
224556829 Fast_submit D Sept. 22, 2023, 4:38 a.m. OK GNU C++17 (64) TESTS 7 0 512000
224546094 SugarT D Sept. 22, 2023, 2:02 a.m. OK GNU C++17 (64) TESTS 7 0 512000
224549831 Bhscer D Sept. 22, 2023, 3:02 a.m. OK GNU C++17 (64) TESTS 7 0 512000
224517861 chmod_777 D Sept. 21, 2023, 6:19 p.m. OK GNU C++17 (64) TESTS 7 0 512000
224520910 Dox__1 D Sept. 21, 2023, 6:44 p.m. OK GNU C++17 (64) TESTS 7 0 512000
224521542 ADAR2002 D Sept. 21, 2023, 6:50 p.m. OK GNU C++17 (64) TESTS 7 0 512000
224534760 berekuk D Sept. 21, 2023, 9:43 p.m. OK GNU C++17 (64) TESTS 7 0 512000
224544028 takeyeldean D Sept. 22, 2023, 1:26 a.m. OK GNU C++17 (64) TESTS 7 0 512000
224535742 omar_mahmoud1 D Sept. 21, 2023, 10:06 p.m. OK GNU C++17 (64) TESTS 7 0 614400
224532565 JuanFPTam D Sept. 21, 2023, 9:03 p.m. OK GNU C++17 (64) TESTS 7 0 2457600
224563169 The_Pirates D Sept. 22, 2023, 5:52 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224562484 mcuadros D Sept. 22, 2023, 5:44 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224562232 Eslam_Aymann22 D Sept. 22, 2023, 5:42 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224561855 Bronya147 D Sept. 22, 2023, 5:38 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224561307 MKRiyad D Sept. 22, 2023, 5:32 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224561133 david_magdy55 D Sept. 22, 2023, 5:30 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224560957 hirsuitedevil D Sept. 22, 2023, 5:28 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224560515 zfs732 D Sept. 22, 2023, 5:24 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224560447 raj_keshari D Sept. 22, 2023, 5:23 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224560227 sarthakjoleya D Sept. 22, 2023, 5:20 a.m. OK GNU C++20 (64) TESTS 7 0 512000
224531814 Kantoelite11 D Sept. 21, 2023, 8:51 p.m. OK Go TESTS 7 15 921600
224553008 79209748 D Sept. 22, 2023, 3:49 a.m. OK Go TESTS 7 15 1024000
224551726 katomasao D Sept. 22, 2023, 3:31 a.m. OK Haskell TESTS 7 30 10444800
224554567 harshitinfinix8 D Sept. 22, 2023, 4:05 a.m. OK Java 11 TESTS 7 171 0
224521784 ujjwal_a0001 D Sept. 21, 2023, 6:52 p.m. OK Java 11 TESTS 7 171 0
224557060 202312059 D Sept. 22, 2023, 4:41 a.m. OK Java 11 TESTS 7 202 0
224532478 dark_rays D Sept. 21, 2023, 9:01 p.m. OK Java 11 TESTS 7 202 0
224528661 vijay21 D Sept. 21, 2023, 8:08 p.m. OK Java 11 TESTS 7 202 0
224559851 bhavikkeswani17 D Sept. 22, 2023, 5:16 a.m. OK Java 11 TESTS 7 218 0
224559785 bhavikkeswani.18 D Sept. 22, 2023, 5:15 a.m. OK Java 11 TESTS 7 218 0
224552422 deybishal D Sept. 22, 2023, 3:41 a.m. OK Java 11 TESTS 7 218 0
224560265 lucifer1426 D Sept. 22, 2023, 5:21 a.m. OK Java 11 TESTS 7 233 0
224541924 karimkimo.amremam D Sept. 22, 2023, 12:44 a.m. OK Java 11 TESTS 7 233 0
224531854 swatishivam23 D Sept. 21, 2023, 8:52 p.m. OK Java 17 TESTS 7 202 512000
224555718 iVennt D Sept. 22, 2023, 4:22 a.m. OK Java 17 TESTS 7 217 409600
224549779 saumya2004 D Sept. 22, 2023, 3:01 a.m. OK Java 17 TESTS 7 218 614400
224532680 i.e.Dhruv D Sept. 21, 2023, 9:05 p.m. OK Java 17 TESTS 7 233 614400
224548709 Adityasingh01 D Sept. 22, 2023, 2:45 a.m. OK Java 17 TESTS 7 233 819200
224541219 vikash_45 D Sept. 22, 2023, 12:29 a.m. OK Java 17 TESTS 7 249 512000
224545875 arpit_aditya D Sept. 22, 2023, 1:59 a.m. OK Java 17 TESTS 7 249 716800
224560411 genus919 D Sept. 22, 2023, 5:22 a.m. OK Java 17 TESTS 7 249 819200
224517833 om_7521 D Sept. 21, 2023, 6:19 p.m. OK Java 17 TESTS 7 249 1024000
224542128 mannthehacker D Sept. 22, 2023, 12:48 a.m. OK Java 17 TESTS 7 264 819200
224527839 saurabh_2701 D Sept. 21, 2023, 7:59 p.m. OK Java 21 TESTS 7 249 0
224526507 karanprasad2121 D Sept. 21, 2023, 7:44 p.m. OK Java 21 TESTS 7 249 0
224527633 pshivesh8 D Sept. 21, 2023, 7:56 p.m. OK Java 21 TESTS 7 264 0
224538433 sary-bala D Sept. 21, 2023, 11:16 p.m. OK Java 8 TESTS 7 93 0
224529155 ZakiKurdya D Sept. 21, 2023, 8:14 p.m. OK Java 8 TESTS 7 93 0
224516320 Yousef_Badr D Sept. 21, 2023, 6:07 p.m. OK Java 8 TESTS 7 108 0
224546074 Autunomy D Sept. 22, 2023, 2:02 a.m. OK Java 8 TESTS 7 109 0
224521230 Sumitsingh7 D Sept. 21, 2023, 6:47 p.m. OK Java 8 TESTS 7 109 5836800
224552293 Sri_ram_Prasad_01 D Sept. 22, 2023, 3:39 a.m. OK Java 8 TESTS 7 124 0
224520608 Toosid D Sept. 21, 2023, 6:41 p.m. OK Java 8 TESTS 7 124 0
224530105 Abood19 D Sept. 21, 2023, 8:26 p.m. OK Java 8 TESTS 7 124 614400
224533120 Jeank_016 D Sept. 21, 2023, 9:12 p.m. OK Java 8 TESTS 7 155 0
224524234 nikhilsoni2910 D Sept. 21, 2023, 7:18 p.m. OK Java 8 TESTS 7 155 0
224540618 huaerbujizewang D Sept. 22, 2023, 12:16 a.m. OK MS C++ 2017 TESTS 7 15 614400
224560710 Partik_Malasi D Sept. 22, 2023, 5:26 a.m. OK MS C++ 2017 TESTS 7 30 614400
224532135 Alexit D Sept. 21, 2023, 8:56 p.m. OK MS C++ 2017 TESTS 7 31 0
224529322 myloyo D Sept. 21, 2023, 8:16 p.m. OK MS C++ 2017 TESTS 7 46 204800
224544131 YMSeah D Sept. 22, 2023, 1:28 a.m. OK PyPy 3 TESTS 7 77 2560000
224523419 Rache_Bartmoss D Sept. 21, 2023, 7:09 p.m. OK PyPy 3 TESTS 7 108 2764800
224516882 DRDIV D Sept. 21, 2023, 6:12 p.m. OK PyPy 3 TESTS 7 108 2867200
224533304 samliu12 D Sept. 21, 2023, 9:16 p.m. OK PyPy 3 TESTS 7 155 4915200
224541038 julondonor D Sept. 22, 2023, 12:25 a.m. OK PyPy 3 TESTS 7 202 8601600
224544552 goh29932 D Sept. 22, 2023, 1:35 a.m. OK PyPy 3 TESTS 7 218 8192000
224530186 buts D Sept. 21, 2023, 8:27 p.m. OK PyPy 3 TESTS 7 342 5017600
224538125 HaonnoaH D Sept. 21, 2023, 11:07 p.m. OK PyPy 3-64 TESTS 7 61 2560000
224533202 Quick-One D Sept. 21, 2023, 9:14 p.m. OK PyPy 3-64 TESTS 7 62 2457600
224522809 stand_by D Sept. 21, 2023, 7:03 p.m. OK PyPy 3-64 TESTS 7 62 2969600
224561001 bailimice D Sept. 22, 2023, 5:29 a.m. OK PyPy 3-64 TESTS 7 77 3072000
224544714 Mr-muzimu D Sept. 22, 2023, 1:38 a.m. OK PyPy 3-64 TESTS 7 77 4198400
224543425 Solaca D Sept. 22, 2023, 1:14 a.m. OK PyPy 3-64 TESTS 7 78 2457600
224562489 gs3122 D Sept. 22, 2023, 5:44 a.m. OK PyPy 3-64 TESTS 7 92 4505600
224518657 gardengnome D Sept. 21, 2023, 6:26 p.m. OK PyPy 3-64 TESTS 7 92 4710400
224524724 to0th_less D Sept. 21, 2023, 7:23 p.m. OK PyPy 3-64 TESTS 7 93 4710400
224532733 AZron D Sept. 21, 2023, 9:05 p.m. OK PyPy 3-64 TESTS 7 108 6553600
224520018 Ysb04 D Sept. 21, 2023, 6:36 p.m. OK Python 3 TESTS 7 46 307200
224556376 vasudha_1610 D Sept. 22, 2023, 4:32 a.m. OK Python 3 TESTS 7 46 409600
224550145 Roronoa.Zoro D Sept. 22, 2023, 3:07 a.m. OK Python 3 TESTS 7 46 409600
224549164 sivaji_d D Sept. 22, 2023, 2:52 a.m. OK Python 3 TESTS 7 46 409600
224548763 Vaishnavi_054 D Sept. 22, 2023, 2:46 a.m. OK Python 3 TESTS 7 46 409600
224542222 Mohamed_Mostafaa D Sept. 22, 2023, 12:50 a.m. OK Python 3 TESTS 7 46 409600
224533372 sadat00 D Sept. 21, 2023, 9:17 p.m. OK Python 3 TESTS 7 46 409600
224533291 sadat00 D Sept. 21, 2023, 9:16 p.m. OK Python 3 TESTS 7 46 409600
224519381 ssundar.kars D Sept. 21, 2023, 6:31 p.m. OK Python 3 TESTS 7 46 409600
224519259 Fantom007 D Sept. 21, 2023, 6:30 p.m. OK Python 3 TESTS 7 46 409600
224559100 GYM_04 D Sept. 22, 2023, 5:06 a.m. OK Rust 2021 TESTS 7 15 716800

remove filters

Back to search problems