Codeforces Round 829 (Div. 1)

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
1753 Codeforces Round 829 (Div. 1) FINISHED False 7200 65311799 Oct. 23, 2022, 7:50 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15065 ) A1 Make Nonzero Sum (easy version) PROGRAMMING constructive algorithms dp greedy 1300

B"This is the easy version of the problem. The difference is that in this version the array can not contain zeros. You can make hacks only if both versions of the problem are solved. You are given an array [a_1, a_2, ldots a_n] consisting of integers -1 and 1 . You have to build a partition of this array into the set of segments [l_1, r_1], [l_2, r_2], ldots, [l_k, r_k] with the following property: Note that each s_i does not have to be equal to zero, this property is about sum of s_i over all segments of partition. The set of segments [l_1, r_1], [l_2, r_2], ldots, [l_k, r_k] is called a partition of the array a of length n if 1 = l_1 <= r_1, l_2 <= r_2, ldots, l_k <= r_k = n and r_i + 1 = l_{i+1} for all i = 1, 2, ldots k-1 . In other words, each element of the array must belong to exactly one segment. You have to build a partition of the given array with properties described above or determine that such partition does not exist. Note that it is not required to minimize the number of segments in the partition. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10 ,000 ). Description of the test cases follows. The first line of each test case contains an integer n ( 1 <= n <= 200 ,000 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( a_i is -1 or 1 ) -- the elements of the given array. It's guaranteed that the sum of n over all test cases does not exceed 200 ,000 . For each test case, if required partition does not exist, print -1 . Otherwise, print an integer k -- the number of segments in the partition. Then in the i -th of the following k lines print two integers l_i and r_i -- description of the i -th segment. The following conditions should be satisfi"...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
177547069 mban259 A1 Oct. 23, 2022, 8:04 a.m. OK C# 10 TESTS 12 93 25395200 1300
177545917 DmitriyAnikeyev A1 Oct. 23, 2022, 8:03 a.m. OK C# 10 TESTS 12 436 25395200 1300
177538417 KumaTachiRen A1 Oct. 23, 2022, 7:57 a.m. OK C# 8 TESTS 12 155 32665600 1300
177544997 hos.lyric A1 Oct. 23, 2022, 8:02 a.m. OK D TESTS 12 109 13516800 1300
177555903 Gassa A1 Oct. 23, 2022, 8:14 a.m. OK D TESTS 12 124 24371200 1300
177646819 SAFIN07 A1 Oct. 23, 2022, 1:06 p.m. OK GNU C11 TESTS 12 655 819200 1300
177565579 Leasier A1 Oct. 23, 2022, 8:27 a.m. OK GNU C11 TESTS 12 701 3174400 1300
177548159 chro4896 A1 Oct. 23, 2022, 8:05 a.m. OK GNU C11 TESTS 12 842 2355200 1300
177546844 enoamaoae A1 Oct. 23, 2022, 8:04 a.m. OK GNU C++14 TESTS 12 31 22323200 1300
177550454 DingWentao2004 A1 Oct. 23, 2022, 8:08 a.m. OK GNU C++14 TESTS 12 46 819200 1300
177707510 hereiszd A1 Oct. 24, 2022, 1:25 a.m. OK GNU C++14 TESTS 12 46 819200 1300
177702772 JoesSR A1 Oct. 23, 2022, 11:01 p.m. OK GNU C++14 TESTS 12 46 1740800 1300
177568328 zltzlt A1 Oct. 23, 2022, 8:31 a.m. OK GNU C++14 TESTS 12 46 2662400 1300
177707697 ducati A1 Oct. 24, 2022, 1:30 a.m. OK GNU C++14 TESTS 12 46 2662400 1300
177704081 ducati A1 Oct. 23, 2022, 11:45 p.m. OK GNU C++14 TESTS 12 46 2662400 1300
177549250 ykl A1 Oct. 23, 2022, 8:06 a.m. OK GNU C++14 TESTS 12 46 3174400 1300
177550165 szhlg A1 Oct. 23, 2022, 8:07 a.m. OK GNU C++14 TESTS 12 46 4812800 1300
177557653 MoQZ A1 Oct. 23, 2022, 8:16 a.m. OK GNU C++14 TESTS 12 46 4812800 1300
177561136 SenseAnone A1 Oct. 23, 2022, 8:21 a.m. OK GNU C++17 TESTS 12 31 921600 1300
177583890 Bobocan A1 Oct. 23, 2022, 9 a.m. OK GNU C++17 TESTS 12 31 3686400 1300
177547155 zhaojinxi A1 Oct. 23, 2022, 8:04 a.m. OK GNU C++17 TESTS 12 31 8192000 1300
177553892 Amel A1 Oct. 23, 2022, 8:11 a.m. OK GNU C++17 TESTS 12 46 819200 1300
177652757 madmax A1 Oct. 23, 2022, 1:50 p.m. OK GNU C++17 TESTS 12 46 921600 1300
177563605 Pcjmy A1 Oct. 23, 2022, 8:24 a.m. OK GNU C++17 TESTS 12 46 1638400 1300
177679984 jagi_song A1 Oct. 23, 2022, 5:35 p.m. OK GNU C++17 TESTS 12 46 1740800 1300
177578084 fhqTreap A1 Oct. 23, 2022, 8:48 a.m. OK GNU C++17 TESTS 12 46 2048000 1300
177541697 bit5 A1 Oct. 23, 2022, 8 a.m. OK GNU C++17 TESTS 12 46 12390400 1300
177581803 Paizen A1 Oct. 23, 2022, 8:56 a.m. OK GNU C++17 TESTS 12 61 1843200 1300
177552056 Hackenbush A1 Oct. 23, 2022, 8:09 a.m. OK GNU C++17 (64) TESTS 12 15 819200 1300
177660462 TheLostCookie A1 Oct. 23, 2022, 2:46 p.m. OK GNU C++17 (64) TESTS 12 31 3276800 1300
177655086 enslaved A1 Oct. 23, 2022, 2:05 p.m. OK GNU C++17 (64) TESTS 12 31 4096000 1300
177543624 QAQAutoMaton A1 Oct. 23, 2022, 8:01 a.m. OK GNU C++17 (64) TESTS 12 31 8704000 1300
177552289 Freedom__King A1 Oct. 23, 2022, 8:09 a.m. OK GNU C++17 (64) TESTS 12 31 20787200 1300
177545584 CuKing A1 Oct. 23, 2022, 8:03 a.m. OK GNU C++17 (64) TESTS 12 46 716800 1300
177542116 ALILILILILI-KHAN A1 Oct. 23, 2022, 8 a.m. OK GNU C++17 (64) TESTS 12 46 1638400 1300
177550096 J_B_Y A1 Oct. 23, 2022, 8:07 a.m. OK GNU C++17 (64) TESTS 12 46 2662400 1300
177541128 zihouzhong A1 Oct. 23, 2022, 7:59 a.m. OK GNU C++17 (64) TESTS 12 46 2969600 1300
177678901 PurpleCrayon A1 Oct. 23, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 12 46 5017600 1300
177549837 CLT A1 Oct. 23, 2022, 8:07 a.m. OK GNU C++20 (64) TESTS 12 30 4403200 1300
177547107 maspy A1 Oct. 23, 2022, 8:04 a.m. OK GNU C++20 (64) TESTS 12 30 11161600 1300
177541816 Sakuyalove A1 Oct. 23, 2022, 8 a.m. OK GNU C++20 (64) TESTS 12 30 13721600 1300
177547067 Hencecho A1 Oct. 23, 2022, 8:04 a.m. OK GNU C++20 (64) TESTS 12 30 139468800 1300
177582186 TheDaVinci A1 Oct. 23, 2022, 8:56 a.m. OK GNU C++20 (64) TESTS 12 31 819200 1300
177548188 LeoPro A1 Oct. 23, 2022, 8:05 a.m. OK GNU C++20 (64) TESTS 12 31 819200 1300
177544851 dl720125 A1 Oct. 23, 2022, 8:02 a.m. OK GNU C++20 (64) TESTS 12 31 819200 1300
177584296 risujiroh A1 Oct. 23, 2022, 9:01 a.m. OK GNU C++20 (64) TESTS 12 31 921600 1300
177550780 Zzt13579 A1 Oct. 23, 2022, 8:08 a.m. OK GNU C++20 (64) TESTS 12 31 1024000 1300
177579743 zxynothing A1 Oct. 23, 2022, 8:51 a.m. OK GNU C++20 (64) TESTS 12 31 1536000 1300
177678596 djrfrn A1 Oct. 23, 2022, 5:23 p.m. OK Java 11 TESTS 12 249 0 1300
177539366 earl_of_byteland A1 Oct. 23, 2022, 7:58 a.m. OK Java 11 TESTS 12 342 16281600 1300
177648523 uros A1 Oct. 23, 2022, 1:25 p.m. OK Java 11 TESTS 12 467 5427200 1300
177664192 kasiru_69 A1 Oct. 23, 2022, 3:15 p.m. OK Java 11 TESTS 12 1185 3481600 1300
177541051 dusty.and.rusty A1 Oct. 23, 2022, 7:59 a.m. OK Java 17 TESTS 12 467 16281600 1300
177536391 megaspazz A1 Oct. 23, 2022, 7:55 a.m. OK Java 8 TESTS 12 171 2560000 1300
177549623 fetetriste A1 Oct. 23, 2022, 8:07 a.m. OK Java 8 TESTS 12 171 7884800 1300
177658818 lcheeme1 A1 Oct. 23, 2022, 2:33 p.m. OK Java 8 TESTS 12 186 4608000 1300
177544714 DarLam A1 Oct. 23, 2022, 8:02 a.m. OK Java 8 TESTS 12 218 1024000 1300
177668450 anonxx5 A1 Oct. 23, 2022, 3:49 p.m. OK Java 8 TESTS 12 233 27648000 1300
177548898 EduRoundOnly A1 Oct. 23, 2022, 8:06 a.m. OK Kotlin 1.4 TESTS 12 233 13209600 1300
177571045 ItamarNir A1 Oct. 23, 2022, 8:36 a.m. OK MS C++ 2017 TESTS 12 218 3481600 1300
177712938 LiuZhaocheng A1 Oct. 24, 2022, 3:12 a.m. OK MS C++ 2017 TESTS 12 733 819200 1300
177542380 bcollet A1 Oct. 23, 2022, 8 a.m. OK PyPy 2 TESTS 12 186 20070400 1300
177551641 SPD_9X2 A1 Oct. 23, 2022, 8:09 a.m. OK PyPy 3 TESTS 12 389 27955200 1300
177560216 tassei903 A1 Oct. 23, 2022, 8:19 a.m. OK PyPy 3 TESTS 12 390 18124800 1300
177540571 conqueror_of_tourist A1 Oct. 23, 2022, 7:59 a.m. OK PyPy 3-64 TESTS 12 155 25804800 1300
177557388 suncup224 A1 Oct. 23, 2022, 8:16 a.m. OK PyPy 3-64 TESTS 12 187 21094400 1300
177537356 szjlove A1 Oct. 23, 2022, 7:56 a.m. OK PyPy 3-64 TESTS 12 217 27955200 1300
177668827 zhenfisher A1 Oct. 23, 2022, 3:53 p.m. OK PyPy 3-64 TESTS 12 217 31539200 1300
177535843 titia A1 Oct. 23, 2022, 7:55 a.m. OK PyPy 3-64 TESTS 12 218 25395200 1300
177544737 delena0702 A1 Oct. 23, 2022, 8:02 a.m. OK PyPy 3-64 TESTS 12 233 22835200 1300
177549410 9.86960440109 A1 Oct. 23, 2022, 8:07 a.m. OK PyPy 3-64 TESTS 12 233 27033600 1300
177552880 xxh1999 A1 Oct. 23, 2022, 8:10 a.m. OK PyPy 3-64 TESTS 12 249 28876800 1300
177551174 toam A1 Oct. 23, 2022, 8:08 a.m. OK PyPy 3-64 TESTS 12 264 28569600 1300
177566115 eepsilon A1 Oct. 23, 2022, 8:28 a.m. OK PyPy 3-64 TESTS 12 265 29081600 1300
177545520 Jimanbanashi A1 Oct. 23, 2022, 8:03 a.m. OK Python 2 TESTS 12 342 24166400 1300
177547607 r57shell A1 Oct. 23, 2022, 8:05 a.m. OK Python 3 TESTS 12 171 14643200 1300
177544446 sansen A1 Oct. 23, 2022, 8:02 a.m. OK Rust 2021 TESTS 12 31 8192000 1300
177555320 katand A1 Oct. 23, 2022, 8:13 a.m. OK Rust 2021 TESTS 12 77 18432000 1300
177549030 sufficiently_large_boss A1 Oct. 23, 2022, 8:06 a.m. OK Rust 2021 TESTS 12 1216 3174400 1300

remove filters

Back to search problems