Codeforces Round 830 (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
1732 Codeforces Round 830 (Div. 2) FINISHED False 7200 65303699 Oct. 23, 2022, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15163 ) B Ugu PROGRAMMING dp greedy 900

B'A binary string is a string consisting only of the characters 0 and 1. You are given a binary string s_1 s_2 ldots s_n . It is necessary to make this string non-decreasing in the least number of operations. In other words, each character should be not less than the previous. In one operation, you can do the following: What is the minimum number of operations needed to make the string non-decreasing? Each test consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of test cases follows. The first line of each test cases a single integer n ( 1 <= q n <= q 10^5 ) -- the length of the string. The second line of each test case contains a 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, output a single integer -- the minimum number of operations that are needed to make the string non-decreasing. In the first test case, the string is already non-decreasing. In the second test case, you can select i = 1 and then s = mathtt{01} . In the third test case, you can select i = 1 and get s = mathtt{010} , and then select i = 2 . As a result, we get s = mathtt{001} , that is, a non-decreasing string. In the sixth test case, you can select i = 5 at the first iteration and get s = mathtt{100001} . Then choose i = 2 , then s = mathtt{111110} . Then we select i = 1 , getting the non-decreasing string s = mathtt{000001} . '...

Tutorials

108327

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
177700036 sergmel B Oct. 23, 2022, 9:40 p.m. OK C# 10 TESTS 20 77 2764800 900
177671413 TIN-slayer B Oct. 23, 2022, 4:15 p.m. OK C# 10 TESTS 20 77 4608000 900
177637255 sabaraz B Oct. 23, 2022, 11:47 a.m. OK C# 8 TESTS 20 124 921600 900
177633675 Reyhane_Shrkh B Oct. 23, 2022, 11:34 a.m. OK C# 8 TESTS 20 124 921600 900
177705810 Longed4Power B Oct. 24, 2022, 12:37 a.m. OK Clang++17 Diagnostics TESTS 20 156 13619200 900
177649598 cyrus_msk B Oct. 23, 2022, 1:31 p.m. OK D TESTS 20 31 4198400 900
177633266 Bronie B Oct. 23, 2022, 11:32 a.m. OK GNU C11 TESTS 20 46 0 900
177634799 zl17 B Oct. 23, 2022, 11:38 a.m. OK GNU C11 TESTS 20 46 102400 900
177714255 zzjd12321 B Oct. 24, 2022, 3:34 a.m. OK GNU C++14 TESTS 20 15 102400 900
177711642 Feynn B Oct. 24, 2022, 2:49 a.m. OK GNU C++14 TESTS 20 15 102400 900
177707260 chs007 B Oct. 24, 2022, 1:20 a.m. OK GNU C++14 TESTS 20 15 102400 900
177704962 Obsession_de_Population B Oct. 24, 2022, 12:12 a.m. OK GNU C++14 TESTS 20 15 102400 900
177703264 Lq122030 B Oct. 23, 2022, 11:18 p.m. OK GNU C++14 TESTS 20 15 102400 900
177658102 _DarkHorse_ B Oct. 23, 2022, 2:28 p.m. OK GNU C++14 TESTS 20 15 102400 900
177649672 Febleaf B Oct. 23, 2022, 1:32 p.m. OK GNU C++14 TESTS 20 15 102400 900
177636338 2019wangminxiao B Oct. 23, 2022, 11:43 a.m. OK GNU C++14 TESTS 20 15 102400 900
177714666 xsjhh B Oct. 24, 2022, 3:41 a.m. OK GNU C++14 TESTS 20 15 102400 900
177718384 rui_er B Oct. 24, 2022, 4:51 a.m. OK GNU C++14 TESTS 20 15 102400 900
177631462 wwwfq B Oct. 23, 2022, 11:26 a.m. OK GNU C++17 TESTS 20 15 102400 900
177719381 kennethsnow B Oct. 24, 2022, 5:08 a.m. OK GNU C++17 TESTS 20 15 102400 900
177633991 Yzm007 B Oct. 23, 2022, 11:35 a.m. OK GNU C++17 TESTS 20 15 102400 900
177636197 Dmitriy888 B Oct. 23, 2022, 11:43 a.m. OK GNU C++17 TESTS 20 15 204800 900
177653991 456117 B Oct. 23, 2022, 1:58 p.m. OK GNU C++17 TESTS 20 15 204800 900
177710316 happycrazzy B Oct. 24, 2022, 2:26 a.m. OK GNU C++17 TESTS 20 15 204800 900
177668718 HaPpY1213 B Oct. 23, 2022, 3:52 p.m. OK GNU C++17 TESTS 20 15 204800 900
177661599 DavidC. B Oct. 23, 2022, 2:55 p.m. OK GNU C++17 TESTS 20 15 307200 900
177713080 defaultedplayer B Oct. 24, 2022, 3:14 a.m. OK GNU C++17 TESTS 20 15 307200 900
177689573 15raeb B Oct. 23, 2022, 6:53 p.m. OK GNU C++17 TESTS 20 15 307200 900
177654386 strange14 B Oct. 23, 2022, 2:01 p.m. OK GNU C++17 (64) TESTS 20 0 409600 900
177698251 Osama_Saleh B Oct. 23, 2022, 9 p.m. OK GNU C++17 (64) TESTS 20 15 102400 900
177633820 rushAC B Oct. 23, 2022, 11:34 a.m. OK GNU C++17 (64) TESTS 20 15 102400 900
177639958 Szyang B Oct. 23, 2022, 11:57 a.m. OK GNU C++17 (64) TESTS 20 15 204800 900
177713415 OMG_wc B Oct. 24, 2022, 3:20 a.m. OK GNU C++17 (64) TESTS 20 15 307200 900
177655157 edenooo B Oct. 23, 2022, 2:06 p.m. OK GNU C++17 (64) TESTS 20 15 307200 900
177651547 Jack00 B Oct. 23, 2022, 1:42 p.m. OK GNU C++17 (64) TESTS 20 15 307200 900
177662337 Tet B Oct. 23, 2022, 3:01 p.m. OK GNU C++17 (64) TESTS 20 15 307200 900
177723110 Superposition B Oct. 24, 2022, 6:02 a.m. OK GNU C++17 (64) TESTS 20 15 409600 900
177706572 enslaved B Oct. 24, 2022, 1:01 a.m. OK GNU C++17 (64) TESTS 20 15 409600 900
177690277 _AhmedMohamed_ B Oct. 23, 2022, 7:01 p.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177717073 AIBH B Oct. 24, 2022, 4:27 a.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177713015 Siddharth_777 B Oct. 24, 2022, 3:13 a.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177693387 CARBINE B Oct. 23, 2022, 7:42 p.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177686411 S.D.GH.M B Oct. 23, 2022, 6:42 p.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177667099 Mohamed_Gemmy B Oct. 23, 2022, 3:38 p.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177631268 JaberSH1 B Oct. 23, 2022, 11:25 a.m. OK GNU C++20 (64) TESTS 20 0 307200 900
177721278 ooo3yyy B Oct. 24, 2022, 5:37 a.m. OK GNU C++20 (64) TESTS 20 0 409600 900
177722110 ooo3yyy B Oct. 24, 2022, 5:49 a.m. OK GNU C++20 (64) TESTS 20 0 409600 900
177696449 ahmdehab B Oct. 23, 2022, 8:29 p.m. OK GNU C++20 (64) TESTS 20 0 2560000 900
177649352 D05T0N B Oct. 23, 2022, 1:30 p.m. OK Go TESTS 20 30 35225600 900
177659569 RahulJangir B Oct. 23, 2022, 2:39 p.m. OK Java 11 TESTS 20 202 0 900
177649315 shojin_pro B Oct. 23, 2022, 1:30 p.m. OK Java 11 TESTS 20 217 0 900
177665279 aditya2024 B Oct. 23, 2022, 3:24 p.m. OK Java 11 TESTS 20 233 0 900
177660178 kaifkhan.biz B Oct. 23, 2022, 2:44 p.m. OK Java 11 TESTS 20 265 0 900
177719671 Sachin872003 B Oct. 24, 2022, 5:12 a.m. OK Java 11 TESTS 20 280 0 900
177675979 Robot1 B Oct. 23, 2022, 4:57 p.m. OK Java 11 TESTS 20 327 0 900
177675279 __bing007___ B Oct. 23, 2022, 4:50 p.m. OK Java 11 TESTS 20 327 0 900
177638003 kkz666 B Oct. 23, 2022, 11:50 a.m. OK Java 17 TESTS 20 202 204800 900
177673040 koolkartik B Oct. 23, 2022, 4:30 p.m. OK Java 17 TESTS 20 202 716800 900
177685283 Kay0 B Oct. 23, 2022, 6:28 p.m. OK Java 17 TESTS 20 233 921600 900
177683790 Kay0 B Oct. 23, 2022, 6:12 p.m. OK Java 17 TESTS 20 248 819200 900
177629703 Vectorss B Oct. 23, 2022, 11:20 a.m. OK Java 17 TESTS 20 374 204800 900
177717837 gtiwari912 B Oct. 24, 2022, 4:41 a.m. OK Java 8 TESTS 20 93 0 900
177694126 gagan_6730 B Oct. 23, 2022, 7:53 p.m. OK Java 8 TESTS 20 93 0 900
177629202 3.1415926535... B Oct. 23, 2022, 11:18 a.m. OK Java 8 TESTS 20 109 0 900
177669192 Koka B Oct. 23, 2022, 3:56 p.m. OK Java 8 TESTS 20 109 0 900
177653499 ikillmyself B Oct. 23, 2022, 1:55 p.m. OK Java 8 TESTS 20 109 0 900
177663987 Mr.Awesome B Oct. 23, 2022, 3:14 p.m. OK Java 8 TESTS 20 109 7168000 900
177676041 ahmedtawfik B Oct. 23, 2022, 4:58 p.m. OK Java 8 TESTS 20 124 0 900
177657248 youtsuha B Oct. 23, 2022, 2:21 p.m. OK Java 8 TESTS 20 124 0 900
177630114 aplaypeak B Oct. 23, 2022, 11:21 a.m. OK Java 8 TESTS 20 124 0 900
177670038 Tac1337 B Oct. 23, 2022, 4:03 p.m. OK Java 8 TESTS 20 124 38297600 900
177654173 Gompu123 B Oct. 23, 2022, 1:59 p.m. OK Kotlin 1.5 TESTS 20 218 0 900
177665815 ktropin B Oct. 23, 2022, 3:28 p.m. OK Mono C# TESTS 20 77 7168000 900
177634051 Chin_chinless B Oct. 23, 2022, 11:35 a.m. OK MS C++ 2017 TESTS 20 30 307200 900
177707970 Halcyflict B Oct. 24, 2022, 1:37 a.m. OK MS C++ 2017 TESTS 20 31 13004800 900
177632269 MaratShchur B Oct. 23, 2022, 11:29 a.m. OK MS C++ 2017 TESTS 20 46 307200 900
177631306 MEGAvova2005 B Oct. 23, 2022, 11:25 a.m. OK MS C++ 2017 TESTS 20 46 307200 900
177639493 koynov B Oct. 23, 2022, 11:55 a.m. OK MS C++ 2017 TESTS 20 46 1843200 900
177634566 KAKTUS126 B Oct. 23, 2022, 11:37 a.m. OK MS C++ 2017 TESTS 20 62 307200 900
177632688 lxllxs B Oct. 23, 2022, 11:30 a.m. OK MS C++ 2017 TESTS 20 62 409600 900
177642278 a.j.rimmer.bdzp B Oct. 23, 2022, 12:04 p.m. OK PyPy 3 TESTS 20 358 6144000 900
177629642 Araldo B Oct. 23, 2022, 11:20 a.m. OK PyPy 3 TESTS 20 390 8908800 900
177659886 USYDLDH B Oct. 23, 2022, 2:41 p.m. OK PyPy 3-64 TESTS 20 93 6553600 900
177672532 ASawe2.6Main B Oct. 23, 2022, 4:25 p.m. OK PyPy 3-64 TESTS 20 93 13721600 900
177686600 ahmedsiad B Oct. 23, 2022, 6:44 p.m. OK PyPy 3-64 TESTS 20 108 6963200 900
177649134 1_2_3_4_5_9 B Oct. 23, 2022, 1:29 p.m. OK PyPy 3-64 TESTS 20 171 26419200 900
177666115 lucky_333 B Oct. 23, 2022, 3:31 p.m. OK PyPy 3-64 TESTS 20 218 5529600 900
177637088 Suxan B Oct. 23, 2022, 11:46 a.m. OK PyPy 3-64 TESTS 20 218 6553600 900
177693021 ahmedraoouf123 B Oct. 23, 2022, 7:36 p.m. OK PyPy 3-64 TESTS 20 249 8806400 900
177672056 anyaakak B Oct. 23, 2022, 4:21 p.m. OK PyPy 3-64 TESTS 20 264 7884800 900
177661941 Mohit1802 B Oct. 23, 2022, 2:58 p.m. OK PyPy 3-64 TESTS 20 265 8806400 900
177671326 Dinesh_devanaboina B Oct. 23, 2022, 4:14 p.m. OK PyPy 3-64 TESTS 20 280 8806400 900
177698866 RuoqiCCC B Oct. 23, 2022, 9:13 p.m. OK Python 3 TESTS 20 124 614400 900
177675905 juandavidarce B Oct. 23, 2022, 4:57 p.m. OK Python 3 TESTS 20 124 614400 900
177640150 Quaqqer B Oct. 23, 2022, 11:57 a.m. OK Python 3 TESTS 20 124 1126400 900
177672724 Pawan_Lahoti B Oct. 23, 2022, 4:27 p.m. OK Python 3 TESTS 20 139 409600 900
177632656 divyamkakkar24 B Oct. 23, 2022, 11:30 a.m. OK Python 3 TESTS 20 139 614400 900
177633281 picturezbackup B Oct. 23, 2022, 11:32 a.m. OK Python 3 TESTS 20 139 1228800 900
177637201 Cypher13 B Oct. 23, 2022, 11:46 a.m. OK Python 3 TESTS 20 139 2969600 900
177632583 rajaprismsagar001 B Oct. 23, 2022, 11:30 a.m. OK Python 3 TESTS 20 140 307200 900
177634085 _magnus_carlsen_ B Oct. 23, 2022, 11:35 a.m. OK Python 3 TESTS 20 140 1228800 900
177629617 Jassi_2003 B Oct. 23, 2022, 11:20 a.m. OK Python 3 TESTS 20 155 512000 900

remove filters

Back to search problems