CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!)

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
1896 CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 9000 36256163 Nov. 25, 2023, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 770 ) F Bracket Xoring PROGRAMMING constructive algorithms implementation

B'You are given a binary string s of length 2n where each element is mathtt{0} or mathtt{1} . You can do the following operation: Your task is to find a sequence of no more than 10 operations that changes all elements of s to mathtt{0} , or determine that it is impossible to do so. Note that you do not have to minimize the number of operations. Under the given constraints, it can be proven that if it is possible to change all elements of s to mathtt{0} , there exists a way that requires no more than 10 operations. ^ dagger A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters + and 1 . For example, sequences "(())()", "()", and "(()(()))" are balanced, while ")(", "(()", and "(()))(" are not. ^ ddagger If we perform a range toggle operation from l to r on a binary string s , then we toggle all values of s_i such that l <= q i <= q r . If s_i is toggled, we will set s_i := mathtt{0} if s_i = mathtt{1} or vice versa. For example, if s= mathtt{1000101} and we perform a range toggle operation from 3 to 5 , s will be changed to s= mathtt{1011001} . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). 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 2n is the length of string s . The second line of each test case contains a binary string s of length 2n ( s_i = mathtt{0} or s_i = mathtt{1} ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output -1 in a single line if it is impossible to change all elements of s to mathtt{0} . Otherwise, output a single integer '...

Tutorials

CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
234306190 KumaTachiRen F Nov. 25, 2023, 5:10 p.m. OK C# 8 TESTS 35 233 22323200
234328478 rainboy F Nov. 25, 2023, 8:27 p.m. OK GNU C11 TESTS 41 78 819200
234340927 zltzlt F Nov. 26, 2023, 12:35 a.m. OK GNU C++14 TESTS 41 31 2867200
234341289 zltzlt F Nov. 26, 2023, 12:46 a.m. OK GNU C++14 TESTS 41 31 3481600
234309458 pring F Nov. 25, 2023, 5:19 p.m. OK GNU C++14 TESTS 35 31 4915200
234317300 qwqFomalhaut F Nov. 25, 2023, 6:20 p.m. OK GNU C++14 TESTS 36 31 5120000
234298374 realskc F Nov. 25, 2023, 4:44 p.m. OK GNU C++14 TESTS 35 31 5734400
234343226 KnownError_ F Nov. 26, 2023, 1:34 a.m. OK GNU C++14 TESTS 41 46 1228800
234296641 cqbzdj F Nov. 25, 2023, 4:37 p.m. OK GNU C++14 TESTS 35 46 5222400
234297245 awu F Nov. 25, 2023, 4:40 p.m. OK GNU C++14 TESTS 35 46 8601600
234342799 sell_gram_wind F Nov. 26, 2023, 1:24 a.m. OK GNU C++14 TESTS 41 46 14643200
234296655 Flamire F Nov. 25, 2023, 4:38 p.m. OK GNU C++14 TESTS 35 46 20070400
234298344 -is-this-fft- F Nov. 25, 2023, 4:43 p.m. OK GNU C++17 TESTS 35 30 4812800
234320569 patou F Nov. 25, 2023, 6:52 p.m. OK GNU C++17 TESTS 41 31 1433600
234316431 NakiriAyame F Nov. 25, 2023, 6:13 p.m. OK GNU C++17 TESTS 36 31 3174400
234318086 Kaitokid F Nov. 25, 2023, 6:27 p.m. OK GNU C++17 TESTS 37 31 3584000
234293096 alireza_kaviani F Nov. 25, 2023, 4:25 p.m. OK GNU C++17 TESTS 35 31 5427200
234313753 LTL_td F Nov. 25, 2023, 5:55 p.m. OK GNU C++17 TESTS 35 46 1228800
234312988 Ant_Man F Nov. 25, 2023, 5:51 p.m. OK GNU C++17 TESTS 35 46 1536000
234327273 TooTrashyToCompete F Nov. 25, 2023, 8:11 p.m. OK GNU C++17 TESTS 41 46 2457600
234308944 Puranya_ F Nov. 25, 2023, 5:19 p.m. OK GNU C++17 TESTS 35 46 3174400
234295659 DmitryGrigorev F Nov. 25, 2023, 4:34 p.m. OK GNU C++17 TESTS 35 46 4300800
234303009 YocyCraft F Nov. 25, 2023, 4:59 p.m. OK GNU C++17 (64) TESTS 35 30 5427200
234355383 ITworker_Z F Nov. 26, 2023, 5:16 a.m. OK GNU C++17 (64) TESTS 41 31 1740800
234295600 Karuna F Nov. 25, 2023, 4:34 p.m. OK GNU C++17 (64) TESTS 35 31 2560000
234293235 kotatsugame F Nov. 25, 2023, 4:26 p.m. OK GNU C++17 (64) TESTS 35 31 2662400
234315420 apoorv_me F Nov. 25, 2023, 6:05 p.m. OK GNU C++17 (64) TESTS 36 31 3072000
234294504 gisp_zjz F Nov. 25, 2023, 4:30 p.m. OK GNU C++17 (64) TESTS 35 31 3174400
234294823 fuppy F Nov. 25, 2023, 4:31 p.m. OK GNU C++17 (64) TESTS 35 31 3379200
234295154 Sana F Nov. 25, 2023, 4:32 p.m. OK GNU C++17 (64) TESTS 35 31 3584000
234290252 cxm1024 F Nov. 25, 2023, 4:15 p.m. OK GNU C++17 (64) TESTS 35 31 3686400
234293835 Rubikun F Nov. 25, 2023, 4:28 p.m. OK GNU C++17 (64) TESTS 35 31 3788800
234306021 neko_nyaaaaaaaaaaaaaaaaa F Nov. 25, 2023, 5:10 p.m. OK GNU C++20 (64) TESTS 35 15 2252800
234307968 A_G F Nov. 25, 2023, 5:16 p.m. OK GNU C++20 (64) TESTS 35 15 3276800
234291511 AmazingTalker_Frank F Nov. 25, 2023, 4:20 p.m. OK GNU C++20 (64) TESTS 35 15 5632000
234302778 zidder F Nov. 25, 2023, 4:59 p.m. OK GNU C++20 (64) TESTS 35 30 2662400
234295107 risujiroh F Nov. 25, 2023, 4:32 p.m. OK GNU C++20 (64) TESTS 35 30 2764800
234299560 Meijer F Nov. 25, 2023, 4:48 p.m. OK GNU C++20 (64) TESTS 35 30 3072000
234303941 hyforces F Nov. 25, 2023, 5:03 p.m. OK GNU C++20 (64) TESTS 35 30 3072000
234347378 Crying F Nov. 26, 2023, 2:58 a.m. OK GNU C++20 (64) TESTS 41 30 3174400
234333926 manizare F Nov. 25, 2023, 9:48 p.m. OK GNU C++20 (64) TESTS 41 30 3686400
234308231 sevlll777 F Nov. 25, 2023, 5:17 p.m. OK GNU C++20 (64) TESTS 35 30 3686400
234325504 arvindf232 F Nov. 25, 2023, 7:49 p.m. OK Kotlin 1.6 TESTS 41 249 4608000
234316063 Tlatoani F Nov. 25, 2023, 6:10 p.m. OK Kotlin 1.6 TESTS 36 576 32256000
234306221 Maruzensky F Nov. 25, 2023, 5:10 p.m. OK PyPy 3-64 TESTS 35 264 58982400
234298192 dyppp F Nov. 25, 2023, 4:43 p.m. OK PyPy 3-64 TESTS 35 374 63590400

remove filters

Back to search problems