Codeforces Round 857 (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
1802 Codeforces Round 857 (Div. 2) FINISHED False 10800 58911863 March 9, 2023, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13608 ) B Settlement of Guinea Pigs PROGRAMMING implementation math

B"Dasha loves guinea pigs very much. In this regard, she decided to settle as many guinea pigs at home as possible and developed a plan for the next n days. Every day, she will either buy a new guinea pig or call a doctor to examine all her pets. Unfortunately, the store where she was going to buy guinea pigs does not understand them. Therefore, it cannot determine their gender. Dasha can't do it either. The only one who can help is a doctor. To keep guinea pigs, aviaries are needed. Dasha plans to buy them in the same store. Unfortunately, only one species is sold there -- a double aviary. No more than two guinea pigs can live in it. Since Dasha does not want to cause moral injury to her pets -- she will not settle two guinea pigs of different genders in one aviary. Help Dasha calculate how many aviaries in the worst case you need to buy so that you can be sure that at no moment of time do two guinea pigs of different genders live in the same aviary. As part of this task, we believe that guinea pigs have only two genders -- male and female. The first line of input data contains one number t ( 1 <= qslant t <= qslant 10^5 ) -- the number of input data sets. The first line of each input data set contains one number n ( 1 <= qslant n <= qslant 10^5 ) -- the number of days Dasha has a plan for. The next line contains n numbers b_1, b_2, b_3, ldots, b_n ( 1 <= qslant b_i <= qslant 2 ) -- Dasha's plan. If b_i = 1 , then on the i th day, Dasha will buy a new guinea pig. If b_i = 2 , then on the i th day, a doctor will come to Dasha and help determine the sex of all guinea pigs that Dasha already has. It is guaranteed that the sum of n for all input data sets does not exceed 10^5 . For each set of input data, output one number -- the minimum number of aviaries Dasha needs to buy so that no matter what the genders of the pigs turn out to be, we can settle them so that at no point in ti"...

Tutorials

Codeforces Round #857 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
196715753 NenadDapic B March 9, 2023, 8:59 p.m. OK FPC TESTS 20 31 102400
196686022 DarkWillow B March 9, 2023, 4:18 p.m. OK GNU C11 TESTS 20 31 0
196654873 tkddn5623 B March 9, 2023, 12:25 p.m. OK GNU C11 TESTS 20 31 409600
196687301 Smallorange B March 9, 2023, 4:28 p.m. OK GNU C11 TESTS 20 46 0
196675379 klu_2100031810 B March 9, 2023, 2:49 p.m. OK GNU C11 TESTS 20 46 0
196720548 eternalDiamond B March 9, 2023, 10:16 p.m. OK GNU C11 TESTS 20 46 0
196720679 eternalDiamond B March 9, 2023, 10:19 p.m. OK GNU C11 TESTS 20 46 0
196648287 ritika.sharma.met21 B March 9, 2023, 12:04 p.m. OK GNU C11 TESTS 20 62 0
196650727 deku_1 B March 9, 2023, 12:12 p.m. OK GNU C11 TESTS 20 62 0
196646915 _DRIN_ B March 9, 2023, noon OK GNU C11 TESTS 20 62 0
196650084 adi2004waghmare B March 9, 2023, 12:10 p.m. OK GNU C11 TESTS 20 62 0
196714430 J.Ahmed B March 9, 2023, 8:41 p.m. OK GNU C++14 TESTS 20 31 0
196738710 wust-zzl B March 10, 2023, 5:10 a.m. OK GNU C++14 TESTS 20 31 0
196735618 snail29565613 B March 10, 2023, 4:19 a.m. OK GNU C++14 TESTS 20 31 0
196732167 Xaeric B March 10, 2023, 3:09 a.m. OK GNU C++14 TESTS 20 31 0
196726873 prosader B March 10, 2023, 1 a.m. OK GNU C++14 TESTS 20 31 0
196726627 Chtholly_Nephren B March 10, 2023, 12:53 a.m. OK GNU C++14 TESTS 20 31 0
196713449 CODE_LOVER4655 B March 9, 2023, 8:29 p.m. OK GNU C++14 TESTS 20 31 0
196705952 ramalzaher B March 9, 2023, 7:02 p.m. OK GNU C++14 TESTS 20 31 0
196679697 iamattri0001 B March 9, 2023, 3:21 p.m. OK GNU C++14 TESTS 20 31 0
196673517 QHJ123456 B March 9, 2023, 2:37 p.m. OK GNU C++14 TESTS 20 31 0
196726759 y3llow B March 10, 2023, 12:56 a.m. OK GNU C++17 TESTS 20 31 0
196728069 dipo8 B March 10, 2023, 1:31 a.m. OK GNU C++17 TESTS 20 31 0
196729650 hnust_wanjiawen B March 10, 2023, 2:11 a.m. OK GNU C++17 TESTS 20 31 0
196731214 bkifhr7 B March 10, 2023, 2:48 a.m. OK GNU C++17 TESTS 20 31 0
196731494 Hharry B March 10, 2023, 2:55 a.m. OK GNU C++17 TESTS 20 31 0
196732158 T3T____ B March 10, 2023, 3:09 a.m. OK GNU C++17 TESTS 20 31 0
196734318 Sino_2009 B March 10, 2023, 3:55 a.m. OK GNU C++17 TESTS 20 31 0
196735915 Tenjin B March 10, 2023, 4:24 a.m. OK GNU C++17 TESTS 20 31 0
196740860 Sayan_Jasu B March 10, 2023, 5:35 a.m. OK GNU C++17 TESTS 20 31 0
196742142 abir_ashab37 B March 10, 2023, 5:51 a.m. OK GNU C++17 TESTS 20 31 0
196683098 Monir B March 9, 2023, 3:55 p.m. OK GNU C++17 (64) TESTS 20 15 0
196705940 Huntik_03 B March 9, 2023, 7:02 p.m. OK GNU C++17 (64) TESTS 20 15 102400
196735003 xioachou B March 10, 2023, 4:09 a.m. OK GNU C++17 (64) TESTS 20 31 0
196732951 Husanboy B March 10, 2023, 3:26 a.m. OK GNU C++17 (64) TESTS 20 31 0
196725896 PCC B March 10, 2023, 12:33 a.m. OK GNU C++17 (64) TESTS 20 31 0
196717864 GILGAMESH B March 9, 2023, 9:31 p.m. OK GNU C++17 (64) TESTS 20 31 0
196735773 kayumov_muhammad B March 10, 2023, 4:21 a.m. OK GNU C++17 (64) TESTS 20 31 0
196700242 MJSoto B March 9, 2023, 6:11 p.m. OK GNU C++17 (64) TESTS 20 31 0
196692892 codingsuju B March 9, 2023, 5:12 p.m. OK GNU C++17 (64) TESTS 20 31 0
196685434 enslaved B March 9, 2023, 4:13 p.m. OK GNU C++17 (64) TESTS 20 31 0
196674785 LostPrince B March 9, 2023, 2:45 p.m. OK GNU C++20 (64) TESTS 20 15 0
196736842 Walid238 B March 10, 2023, 4:40 a.m. OK GNU C++20 (64) TESTS 20 15 0
196735963 nuclear_bomb B March 10, 2023, 4:25 a.m. OK GNU C++20 (64) TESTS 20 15 0
196734728 PotremZ B March 10, 2023, 4:03 a.m. OK GNU C++20 (64) TESTS 20 15 0
196710711 elotelo966 B March 9, 2023, 7:54 p.m. OK GNU C++20 (64) TESTS 20 15 0
196698131 Tkehsihba B March 9, 2023, 5:54 p.m. OK GNU C++20 (64) TESTS 20 15 0
196693694 Saidul_1 B March 9, 2023, 5:18 p.m. OK GNU C++20 (64) TESTS 20 15 0
196669650 Sevendeis B March 9, 2023, 2:12 p.m. OK GNU C++20 (64) TESTS 20 15 0
196667464 Mostafa__Fouad B March 9, 2023, 2 p.m. OK GNU C++20 (64) TESTS 20 15 0
196663656 coderdhanraj B March 9, 2023, 1:27 p.m. OK GNU C++20 (64) TESTS 20 15 0
196720584 Hinnawi24 B March 9, 2023, 10:17 p.m. OK Java 11 TESTS 20 186 0
196687158 anikethend1234 B March 9, 2023, 4:27 p.m. OK Java 11 TESTS 20 218 0
196658681 XIN B March 9, 2023, 12:34 p.m. OK Java 11 TESTS 20 218 0
196710844 the_half_blood_prince B March 9, 2023, 7:56 p.m. OK Java 11 TESTS 20 234 0
196716546 Ankita1129 B March 9, 2023, 9:09 p.m. OK Java 11 TESTS 20 248 0
196670488 profchi B March 9, 2023, 2:17 p.m. OK Java 11 TESTS 20 265 0
196677197 Siyaram_13 B March 9, 2023, 3:02 p.m. OK Java 11 TESTS 20 280 0
196733433 wdjuruo B March 10, 2023, 3:36 a.m. OK Java 11 TESTS 20 327 0
196701874 shoryakmr2719 B March 9, 2023, 6:25 p.m. OK Java 11 TESTS 20 343 0
196673069 Un_sung B March 9, 2023, 2:34 p.m. OK Java 11 TESTS 20 343 0
196674055 luci9868 B March 9, 2023, 2:40 p.m. OK Java 17 TESTS 20 202 512000
196714871 Abdelrahman.M.3 B March 9, 2023, 8:47 p.m. OK Java 17 TESTS 20 233 716800
196688173 utkarsh3112 B March 9, 2023, 4:35 p.m. OK Java 17 TESTS 20 248 716800
196689529 manish47 B March 9, 2023, 4:46 p.m. OK Java 17 TESTS 20 249 512000
196677996 Abdelrahim303 B March 9, 2023, 3:08 p.m. OK Java 17 TESTS 20 264 204800
196666841 Eslam_Ahmed B March 9, 2023, 1:56 p.m. OK Java 17 TESTS 20 265 204800
196652492 pranav__muj B March 9, 2023, 12:17 p.m. OK Java 17 TESTS 20 296 307200
196673420 Code_leaner_18 B March 9, 2023, 2:36 p.m. OK Java 17 TESTS 20 358 614400
196678025 faresbadr316 B March 9, 2023, 3:08 p.m. OK Java 17 TESTS 20 358 614400
196694700 Thiain B March 9, 2023, 5:26 p.m. OK Java 17 TESTS 20 358 819200
196730916 megaspazz B March 10, 2023, 2:40 a.m. OK Java 8 TESTS 20 108 0
196703691 IanISam B March 9, 2023, 6:42 p.m. OK Java 8 TESTS 20 109 0
196674275 soyebsarkar B March 9, 2023, 2:42 p.m. OK Java 8 TESTS 20 109 0
196664604 raj_shahh B March 9, 2023, 1:46 p.m. OK Java 8 TESTS 20 109 0
196742227 oneafter B March 10, 2023, 5:53 a.m. OK Java 8 TESTS 20 124 0
196722433 safarisoul B March 9, 2023, 10:56 p.m. OK Java 8 TESTS 20 124 0
196721726 Sylvester_ B March 9, 2023, 10:41 p.m. OK Java 8 TESTS 20 156 0
196730402 Sylvester_ B March 10, 2023, 2:29 a.m. OK Java 8 TESTS 20 171 0
196728623 Sylvester_ B March 10, 2023, 1:45 a.m. OK Java 8 TESTS 20 171 0
196724624 -crazy_coder- B March 9, 2023, 11:55 p.m. OK Java 8 TESTS 20 171 0
196721395 endless_code B March 9, 2023, 10:33 p.m. OK Kotlin 1.7 TESTS 20 498 25804800
196695305 Mhmd_Bakr B March 9, 2023, 5:31 p.m. OK Mono C# TESTS 20 280 2969600
196650289 Zolotarev__dla_fedorenco B March 9, 2023, 12:10 p.m. OK MS C++ 2017 TESTS 20 46 0
196678841 213B_MasterLord B March 9, 2023, 3:14 p.m. OK MS C++ 2017 TESTS 20 93 0
196654092 Renat315 B March 9, 2023, 12:22 p.m. OK MS C++ 2017 TESTS 20 108 0
196652031 arkapravaray B March 9, 2023, 12:16 p.m. OK MS C++ 2017 TESTS 20 109 0
196648378 Tojer B March 9, 2023, 12:04 p.m. OK MS C++ 2017 TESTS 20 109 0
196690522 Yash_Nandwana B March 9, 2023, 4:54 p.m. OK PyPy 3 TESTS 20 170 5836800
196682913 jvatsal0709 B March 9, 2023, 3:53 p.m. OK PyPy 3 TESTS 20 342 7577600
196725037 bpdolson B March 10, 2023, 12:08 a.m. OK PyPy 3 TESTS 20 358 9113600
196684024 polinaramyasri B March 9, 2023, 4:02 p.m. OK PyPy 3-64 TESTS 20 93 8089600
196683867 Triump_0112 B March 9, 2023, 4:01 p.m. OK PyPy 3-64 TESTS 20 93 8089600
196733160 iinaamasum B March 10, 2023, 3:31 a.m. OK PyPy 3-64 TESTS 20 108 7987200
196719552 gardengnome B March 9, 2023, 9:57 p.m. OK PyPy 3-64 TESTS 20 108 7987200
196691644 MartinXu6 B March 9, 2023, 5:03 p.m. OK PyPy 3-64 TESTS 20 109 8601600
196704859 wety B March 9, 2023, 6:52 p.m. OK PyPy 3-64 TESTS 20 109 8601600
196729820 voicon B March 10, 2023, 2:15 a.m. OK PyPy 3-64 TESTS 20 124 6758400
196734206 Youarenotgood B March 10, 2023, 3:53 a.m. OK PyPy 3-64 TESTS 20 124 8294400
196652055 andrey545454 B March 9, 2023, 12:16 p.m. OK PyPy 3-64 TESTS 20 124 8294400
196670711 Ana_naS B March 9, 2023, 2:18 p.m. OK PyPy 3-64 TESTS 20 124 9318400
196727187 chenjiahui B March 10, 2023, 1:08 a.m. OK Python 3 TESTS 20 108 512000
196682348 2100031435klu B March 9, 2023, 3:49 p.m. OK Python 3 TESTS 20 109 614400
196667561 Muhammad_Aneeq B March 9, 2023, 2 p.m. OK Python 3 TESTS 20 109 614400
196664771 Muhammad_Aneeq B March 9, 2023, 1:47 p.m. OK Python 3 TESTS 20 124 716800
196714541 Tirth11 B March 9, 2023, 8:43 p.m. OK Python 3 TESTS 20 156 409600
196684628 Aaditya1149 B March 9, 2023, 4:06 p.m. OK Python 3 TESTS 20 170 409600
196650396 pranjal_99 B March 9, 2023, 12:11 p.m. OK Python 3 TESTS 20 187 409600
196648717 learn_cute B March 9, 2023, 12:05 p.m. OK Python 3 TESTS 20 218 409600

remove filters

Back to search problems