Codeforces Round 789 (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
1678 Codeforces Round 789 (Div. 2) FINISHED False 7200 79802699 May 8, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15978 ) B1 Tokitsukaze and Good 01-String (easy version) PROGRAMMING implementation

B'This is the easy version of the problem. The only difference between the two versions is that the harder version asks additionally for a minimum number of subsegments. Tokitsukaze has a binary string s of length n , consisting only of zeros and ones, n is even. Now Tokitsukaze divides s into the minimum number of contiguous subsegments, and for each subsegment, all bits in each subsegment are the same. After that, s is considered good if the lengths of all subsegments are even. For example, if s is "11001111", it will be divided into "11", "00" and "1111". Their lengths are 2 , 2 , 4 respectively, which are all even numbers, so "11001111" is good. Another example, if s is "1110011000", it will be divided into "111", "00", "11" and "000", and their lengths are 3 , 2 , 2 , 3 . Obviously, "1110011000" is not good. Tokitsukaze wants to make s good by changing the values of some positions in s . Specifically, she can perform the operation any number of times: change the value of s_i to '0 ' or '1 '( 1 <= q i <= q n ). Can you tell her the minimum number of operations to make s good? The first contains a single positive integer t ( 1 <= q t <= q 10 ,000 ) -- the number of test cases. For each test case, the first line contains a single integer n ( 2 <= q n <= q 2 cdot 10^5 ) -- the length of s , it is guaranteed that n is even. The second line contains a binary string s of length n , consisting only of zeros and ones. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print a single line with one integer -- the minimum number of operations to make s good. In the first test case, one of the ways to make s good is the following. Change s_3 , s_6 and s_7 to '0 ', after that s becomes "1100000000", it can be divided int'...

Tutorials

Codeforces Round 789 Chinese Tutorial.pdf

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156352500 Salamander1983 B1 May 8, 2022, 5:34 p.m. OK C# 10 TESTS 25 77 819200
156348635 TheILICH B1 May 8, 2022, 4:34 p.m. OK C# 8 TESTS 25 124 13312000
156375523 Labib.BD B1 May 9, 2022, 2:29 a.m. OK GNU C11 TESTS 25 31 204800
156362572 carlosjoel.martinezlopez B1 May 8, 2022, 8:01 p.m. OK GNU C11 TESTS 25 31 204800
156342101 coolcooler22g B1 May 8, 2022, 4:15 p.m. OK GNU C11 TESTS 25 46 0
156345517 lianjinfeng B1 May 8, 2022, 4:26 p.m. OK GNU C11 TESTS 25 46 0
156343367 arky_13 B1 May 8, 2022, 4:19 p.m. OK GNU C11 TESTS 25 46 204800
156358525 carlosjoel.martinezlopez B1 May 8, 2022, 6:51 p.m. OK GNU C11 TESTS 25 46 204800
156336061 2104010904 B1 May 8, 2022, 3:55 p.m. OK GNU C++14 TESTS 25 15 0
156370020 chumeng B1 May 8, 2022, 11:53 p.m. OK GNU C++14 TESTS 25 15 0
156361219 BlackPanther112358 B1 May 8, 2022, 7:35 p.m. OK GNU C++14 TESTS 25 15 0
156378206 _whb B1 May 9, 2022, 3:35 a.m. OK GNU C++14 TESTS 25 15 204800
156351312 JCLinux B1 May 8, 2022, 5:25 p.m. OK GNU C++14 TESTS 25 15 204800
156348264 ISKa_dev B1 May 8, 2022, 4:34 p.m. OK GNU C++14 TESTS 25 15 204800
156336944 513487012 B1 May 8, 2022, 3:58 p.m. OK GNU C++14 TESTS 25 15 204800
156381663 0xcc B1 May 9, 2022, 4:57 a.m. OK GNU C++14 TESTS 25 15 204800
156384210 divsrivastava45 B1 May 9, 2022, 5:48 a.m. OK GNU C++14 TESTS 25 15 512000
156383610 SrinivasTeja B1 May 9, 2022, 5:35 a.m. OK GNU C++14 TESTS 25 15 512000
156364604 ELbe7a_EL7bouda B1 May 8, 2022, 8:46 p.m. OK GNU C++17 TESTS 25 15 0
156336895 CHINA_BEIQIAO B1 May 8, 2022, 3:58 p.m. OK GNU C++17 TESTS 25 15 204800
156377278 Beginner343 B1 May 9, 2022, 3:12 a.m. OK GNU C++17 TESTS 25 15 204800
156384327 diegoximenes B1 May 9, 2022, 5:49 a.m. OK GNU C++17 TESTS 25 15 204800
156384648 pvtr B1 May 9, 2022, 5:56 a.m. OK GNU C++17 TESTS 25 15 512000
156384619 Double_pipe_dream B1 May 9, 2022, 5:56 a.m. OK GNU C++17 TESTS 25 15 512000
156384537 vg869 B1 May 9, 2022, 5:54 a.m. OK GNU C++17 TESTS 25 15 512000
156384359 umangg_20 B1 May 9, 2022, 5:50 a.m. OK GNU C++17 TESTS 25 15 512000
156384343 Mukesh_Thakur B1 May 9, 2022, 5:50 a.m. OK GNU C++17 TESTS 25 15 512000
156383757 Sakr_ B1 May 9, 2022, 5:38 a.m. OK GNU C++17 TESTS 25 15 512000
156353237 propane B1 May 8, 2022, 5:41 p.m. OK GNU C++17 (64) TESTS 25 15 204800
156375644 panyanppyy B1 May 9, 2022, 2:32 a.m. OK GNU C++17 (64) TESTS 25 15 204800
156383349 zetaaaaaaaa B1 May 9, 2022, 5:30 a.m. OK GNU C++17 (64) TESTS 25 15 204800
156381504 soumyadeep_pal_21 B1 May 9, 2022, 4:53 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156382400 KevinSo25 B1 May 9, 2022, 5:12 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156381690 lovezah B1 May 9, 2022, 4:57 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156380010 Titi12 B1 May 9, 2022, 4:18 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156377156 korokseeds B1 May 9, 2022, 3:10 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156376224 Azusamitsusa B1 May 9, 2022, 2:47 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156373565 yaoveil B1 May 9, 2022, 1:55 a.m. OK GNU C++17 (64) TESTS 25 15 512000
156362318 Osama.Rafat100 B1 May 8, 2022, 7:55 p.m. OK GNU C++20 (64) TESTS 25 0 512000
156381346 TheMentalistPJ B1 May 9, 2022, 4:49 a.m. OK GNU C++20 (64) TESTS 25 0 512000
156373421 XLS_A B1 May 9, 2022, 1:51 a.m. OK GNU C++20 (64) TESTS 25 0 512000
156373145 bin_s B1 May 9, 2022, 1:44 a.m. OK GNU C++20 (64) TESTS 25 0 512000
156338119 amira. B1 May 8, 2022, 4:02 p.m. OK GNU C++20 (64) TESTS 25 0 1331200
156359691 adityam1 B1 May 8, 2022, 7:09 p.m. OK GNU C++20 (64) TESTS 25 15 204800
156377275 not_alone B1 May 9, 2022, 3:12 a.m. OK GNU C++20 (64) TESTS 25 15 409600
156382112 Niloy_Das_19 B1 May 9, 2022, 5:07 a.m. OK GNU C++20 (64) TESTS 25 15 512000
156382954 LEMMiNO B1 May 9, 2022, 5:23 a.m. OK GNU C++20 (64) TESTS 25 15 512000
156383456 OceanCat B1 May 9, 2022, 5:32 a.m. OK GNU C++20 (64) TESTS 25 15 512000
156373989 zelknow26 B1 May 9, 2022, 2:07 a.m. OK Go TESTS 25 61 1638400
156354447 MatthewRaker B1 May 8, 2022, 5:55 p.m. OK Java 11 TESTS 25 155 0
156381337 yaduahuja24 B1 May 9, 2022, 4:49 a.m. OK Java 11 TESTS 25 171 0
156375607 Amir_Coderest B1 May 9, 2022, 2:31 a.m. OK Java 11 TESTS 25 171 0
156351981 garg_lucifer B1 May 8, 2022, 5:29 p.m. OK Java 11 TESTS 25 171 0
156381739 Wuya B1 May 9, 2022, 4:58 a.m. OK Java 11 TESTS 25 186 0
156351730 sahilgupta2201 B1 May 8, 2022, 5:27 p.m. OK Java 11 TESTS 25 186 0
156338002 adhi_2311 B1 May 8, 2022, 4:01 p.m. OK Java 11 TESTS 25 187 0
156353681 the_unseen B1 May 8, 2022, 5:46 p.m. OK Java 11 TESTS 25 187 0
156341202 rwee1001 B1 May 8, 2022, 4:12 p.m. OK Java 11 TESTS 25 187 0
156335753 shubhamsb25 B1 May 8, 2022, 3:54 p.m. OK Java 11 TESTS 25 187 0
156353579 malekelkassas B1 May 8, 2022, 5:45 p.m. OK Java 8 TESTS 25 93 0
156366945 UniversalAdmin B1 May 8, 2022, 9:57 p.m. OK Java 8 TESTS 25 108 0
156350799 gssakash B1 May 8, 2022, 5:22 p.m. OK Java 8 TESTS 25 108 0
156375542 sharpen B1 May 9, 2022, 2:29 a.m. OK Java 8 TESTS 25 109 0
156363281 ak_ankit B1 May 8, 2022, 8:16 p.m. OK Java 8 TESTS 25 109 0
156357055 Koka B1 May 8, 2022, 6:28 p.m. OK Java 8 TESTS 25 109 0
156356624 ninjamayank B1 May 8, 2022, 6:22 p.m. OK Java 8 TESTS 25 109 0
156356374 ninjamayank B1 May 8, 2022, 6:19 p.m. OK Java 8 TESTS 25 109 0
156353223 UniversalAdmin B1 May 8, 2022, 5:41 p.m. OK Java 8 TESTS 25 109 0
156383770 swarup_312 B1 May 9, 2022, 5:38 a.m. OK Java 8 TESTS 25 124 0
156365340 thegeman B1 May 8, 2022, 9:06 p.m. OK Kotlin 1.6 TESTS 25 202 0
156352940 aislanfgc B1 May 8, 2022, 5:38 p.m. OK Kotlin 1.6 TESTS 25 249 0
156339723 Jerrylyc B1 May 8, 2022, 4:07 p.m. OK MS C++ 2017 TESTS 25 30 819200
156341596 Main_Slayer B1 May 8, 2022, 4:13 p.m. OK MS C++ 2017 TESTS 25 31 2048000
156366644 supergi B1 May 8, 2022, 9:47 p.m. OK MS C++ 2017 TESTS 25 31 2457600
156363915 mandinga B1 May 8, 2022, 8:30 p.m. OK MS C++ 2017 TESTS 25 46 512000
156357070 IlyinAD B1 May 8, 2022, 6:28 p.m. OK MS C++ 2017 TESTS 25 46 614400
156339880 lqbsb B1 May 8, 2022, 4:08 p.m. OK MS C++ 2017 TESTS 25 46 614400
156342510 wundersmith B1 May 8, 2022, 4:16 p.m. OK MS C++ 2017 TESTS 25 46 716800
156337250 Dybulina_Anna B1 May 8, 2022, 3:59 p.m. OK MS C++ 2017 TESTS 25 46 1433600
156344414 Mindaev_Damir B1 May 8, 2022, 4:23 p.m. OK MS C++ 2017 TESTS 25 46 2560000
156341884 TvixPlayer B1 May 8, 2022, 4:14 p.m. OK MS C++ 2017 TESTS 25 46 3481600
156354153 iparm B1 May 8, 2022, 5:52 p.m. OK Node.js TESTS 25 218 9728000
156351115 1_2_3_4_5_9 B1 May 8, 2022, 5:24 p.m. OK PyPy 2 TESTS 25 186 5939200
156338737 pigpole B1 May 8, 2022, 4:04 p.m. OK PyPy 3 TESTS 25 124 4403200
156350690 lemiao12 B1 May 8, 2022, 5:22 p.m. OK PyPy 3 TESTS 25 124 4505600
156372546 FrozenKandy B1 May 9, 2022, 1:25 a.m. OK PyPy 3 TESTS 25 139 6758400
156356120 Anti-Neutrino B1 May 8, 2022, 6:16 p.m. OK PyPy 3 TESTS 25 312 6144000
156384158 Driver12 B1 May 9, 2022, 5:47 a.m. OK PyPy 3 TESTS 25 326 18636800
156347762 jimmy14 B1 May 8, 2022, 4:33 p.m. OK PyPy 3 TESTS 25 327 5529600
156343679 RengarajR B1 May 8, 2022, 4:20 p.m. OK PyPy 3 TESTS 25 327 5734400
156342512 aditya_yadava B1 May 8, 2022, 4:17 p.m. OK PyPy 3 TESTS 25 327 8908800
156339521 Nagisa365 B1 May 8, 2022, 4:06 p.m. OK PyPy 3 TESTS 25 358 8908800
156357506 jd_254 B1 May 8, 2022, 6:34 p.m. OK PyPy 3 TESTS 25 373 9728000
156354771 davidchi B1 May 8, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 25 93 4915200
156356744 notTehlka B1 May 8, 2022, 6:24 p.m. OK PyPy 3-64 TESTS 25 93 9523200
156343378 Amay12 B1 May 8, 2022, 4:19 p.m. OK PyPy 3-64 TESTS 25 108 14745600
156344872 peach_lasagna B1 May 8, 2022, 4:24 p.m. OK PyPy 3-64 TESTS 25 109 6860800
156338202 niumeng B1 May 8, 2022, 4:02 p.m. OK PyPy 3-64 TESTS 25 155 8499200
156350797 Code_Breaker101 B1 May 8, 2022, 5:22 p.m. OK PyPy 3-64 TESTS 25 155 14438400
156376815 rivnam B1 May 9, 2022, 3:02 a.m. OK PyPy 3-64 TESTS 25 170 26112000
156356041 alex_mat B1 May 8, 2022, 6:15 p.m. OK PyPy 3-64 TESTS 25 186 11776000
156341003 Issin B1 May 8, 2022, 4:11 p.m. OK PyPy 3-64 TESTS 25 218 12800000
156357222 ghannu B1 May 8, 2022, 6:30 p.m. OK PyPy 3-64 TESTS 25 249 9728000
156339609 Ajax4code B1 May 8, 2022, 4:07 p.m. OK Python 3 TESTS 25 62 614400
156360315 rahulkshp2018 B1 May 8, 2022, 7:20 p.m. OK Python 3 TESTS 25 77 512000
156358764 PMiguelez B1 May 8, 2022, 6:55 p.m. OK Python 3 TESTS 25 78 512000
156353021 s1yegor B1 May 8, 2022, 5:39 p.m. OK Python 3 TESTS 25 78 716800
156373949 Ebtisam_Elahi B1 May 9, 2022, 2:06 a.m. OK Python 3 TESTS 25 108 512000
156378765 renuka1285 B1 May 9, 2022, 3:49 a.m. OK Python 3 TESTS 25 109 204800
156384624 pennymagic156 B1 May 9, 2022, 5:56 a.m. OK Python 3 TESTS 25 109 409600
156378626 renuka1285 B1 May 9, 2022, 3:45 a.m. OK Python 3 TESTS 25 124 204800
156342916 n8crawler B1 May 8, 2022, 4:18 p.m. OK Python 3 TESTS 25 139 1126400
156355742 aayush_chhabra B1 May 8, 2022, 6:11 p.m. OK Python 3 TESTS 25 140 512000
156371765 Spheniscine B1 May 9, 2022, 1 a.m. OK Rust 2021 TESTS 25 15 307200
156335593 8uk.8ak B1 May 8, 2022, 3:54 p.m. OK Rust 2021 TESTS 25 31 2355200

remove filters

Back to search problems