Codeforces Round 521 (Div. 3)

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
1077 Codeforces Round 521 (Div. 3) FINISHED False 7200 195146724 Nov. 16, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19262 ) B Disturbed People PROGRAMMING greedy 1000

B'There is a house with n flats situated on the main street of Berlatov. Vova is watching this house every night. The house can be represented as an array of n integer numbers a_1, a_2, ... , a_n , where a_i = 1 if in the i -th flat the light is on and a_i = 0 otherwise. Vova thinks that people in the i -th flats are disturbed and cannot sleep if and only if 1 < i < n and a_{i - 1} = a_{i + 1} = 1 and a_i = 0 . Vova is concerned by the following question: what is the minimum number k such that if people from exactly k pairwise distinct flats will turn off the lights then nobody will be disturbed? Your task is to find this number k . The first line of the input contains one integer n ( 3 <= n <= 100 ) -- the number of flats in the house. The second line of the input contains n integers a_1, a_2, ... , a_n ( a_i in {0, 1 } ), where a_i is the state of light in the i -th flat. Print only one integer -- the minimum number k such that if people from exactly k pairwise distinct flats will turn off the light then nobody will be disturbed. In the first example people from flats 2 and 7 or 4 and 7 can turn off the light and nobody will be disturbed. It can be shown that there is no better answer in this example. There are no disturbed people in second and third examples. '...

Tutorials

Codeforces Round #521 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
47856162 vjudge2 B Jan. 2, 2019, 10:30 p.m. OK Clang++17 Diagnostics TESTS 38 31 0 1000
67019581 vjudge4 B Dec. 16, 2019, 12:33 p.m. OK Clang++17 Diagnostics TESTS 38 46 0 1000
47856156 toysmars B Jan. 2, 2019, 10:30 p.m. OK Clang++17 Diagnostics TESTS 38 46 0 1000
49946525 Harshil_Goti_2209 B Feb. 15, 2019, 12:18 p.m. OK Clang++17 Diagnostics TESTS 38 46 0 1000
46008624 thezodiac007 B Nov. 20, 2018, 6:35 p.m. OK Clang++17 Diagnostics TESTS 38 46 307200 1000
47026180 hkyiitd B Dec. 15, 2018, 7:03 a.m. OK Clang++17 Diagnostics TESTS 38 46 307200 1000
46125514 rr_ B Nov. 23, 2018, 6:51 p.m. OK D TESTS 38 31 0 1000
54995606 Denor B June 2, 2019, 11:03 p.m. OK Delphi TESTS 38 31 0 1000
51342646 ruban B March 15, 2019, 4:54 p.m. OK Delphi TESTS 38 31 13926400 1000
48059413 Meibisu B Jan. 7, 2019, 2:14 p.m. OK FPC TESTS 38 30 0 1000
46048053 leedinh B Nov. 22, 2018, 4:43 a.m. OK FPC TESTS 38 30 0 1000
47184167 tumbleweed B Dec. 18, 2018, 2:04 a.m. OK FPC TESTS 38 30 102400 1000
51440261 chaorenhaha B March 18, 2019, 9:29 a.m. OK FPC TESTS 38 30 614400 1000
47858894 NewbieMisis B Jan. 3, 2019, 3:40 a.m. OK FPC TESTS 38 31 0 1000
46284330 TaeRon0816 B Nov. 27, 2018, 3:09 p.m. OK FPC TESTS 38 31 0 1000
46053735 lele9h0st B Nov. 22, 2018, 9:36 a.m. OK FPC TESTS 38 31 0 1000
46053391 huyhoan652002 B Nov. 22, 2018, 9:20 a.m. OK FPC TESTS 38 31 0 1000
46051962 minhlong9514 B Nov. 22, 2018, 8:10 a.m. OK FPC TESTS 38 31 0 1000
46051844 luongskyfa B Nov. 22, 2018, 8:04 a.m. OK FPC TESTS 38 31 0 1000
46844513 indentuum B Dec. 10, 2018, 10:05 a.m. OK GNU C11 TESTS 38 30 0 1000
46942899 selena101 B Dec. 12, 2018, 5:50 p.m. OK GNU C11 TESTS 38 30 0 1000
46970743 vjudge2 B Dec. 13, 2018, 1:42 p.m. OK GNU C11 TESTS 38 30 0 1000
47375168 vjudge3 B Dec. 22, 2018, 4:47 p.m. OK GNU C11 TESTS 38 30 0 1000
47548591 frozen. B Dec. 27, 2018, 11:44 a.m. OK GNU C11 TESTS 38 30 0 1000
49865406 vjudge4 B Feb. 13, 2019, 11:48 a.m. OK GNU C11 TESTS 38 30 0 1000
52283503 patilc125 B April 3, 2019, 6:22 p.m. OK GNU C11 TESTS 38 30 0 1000
54247275 rubber_duckieOwOwO B May 16, 2019, 3:27 p.m. OK GNU C11 TESTS 38 30 0 1000
55272723 vjudge5 B June 7, 2019, 5:15 p.m. OK GNU C11 TESTS 38 30 0 1000
55866320 Erfan7135 B June 21, 2019, 12:21 p.m. OK GNU C11 TESTS 38 30 0 1000
46434928 bogdi B Dec. 1, 2018, 8:25 a.m. OK GNU C++11 TESTS 38 15 0 1000
46850377 thakkar2804 B Dec. 10, 2018, 11:58 a.m. OK GNU C++11 TESTS 38 15 0 1000
47616301 vjudge2 B Dec. 28, 2018, 10:39 a.m. OK GNU C++11 TESTS 38 15 0 1000
60141856 parsee1053 B Sept. 5, 2019, 8:42 p.m. OK GNU C++11 TESTS 38 30 0 1000
61986749 luogu_bot4 B Oct. 6, 2019, 1:46 p.m. OK GNU C++11 TESTS 38 30 0 1000
53754068 hossain95 B May 4, 2019, 5:53 p.m. OK GNU C++11 TESTS 38 30 0 1000
63964450 vjudge3 B Nov. 1, 2019, 6:38 a.m. OK GNU C++11 TESTS 38 30 0 1000
63554213 vjudge5 B Oct. 27, 2019, 12:26 p.m. OK GNU C++11 TESTS 38 30 0 1000
54825273 vjudge5 B May 30, 2019, 6:05 a.m. OK GNU C++11 TESTS 38 30 0 1000
54971037 prahladchaudhary14 B June 2, 2019, 8:36 a.m. OK GNU C++11 TESTS 38 30 0 1000
66678117 iwriaw B Dec. 12, 2019, 12:07 p.m. OK GNU C++14 TESTS 38 15 0 1000
68487064 the_boy_who_lived_ B Jan. 10, 2020, 10:11 a.m. OK GNU C++14 TESTS 38 15 0 1000
66638504 Dbvivi B Dec. 11, 2019, 1:50 p.m. OK GNU C++14 TESTS 38 15 0 1000
66302407 Hyado B Dec. 5, 2019, 7:51 a.m. OK GNU C++14 TESTS 38 15 0 1000
64755880 calmachint B Nov. 12, 2019, 4:54 p.m. OK GNU C++14 TESTS 38 15 0 1000
64366398 vjudge4 B Nov. 6, 2019, 1:09 p.m. OK GNU C++14 TESTS 38 15 0 1000
58940513 rko27 B Aug. 17, 2019, 6:42 a.m. OK GNU C++14 TESTS 38 15 0 1000
56514433 cauchyg B July 4, 2019, 12:03 p.m. OK GNU C++14 TESTS 38 15 0 1000
56140455 ankur314 B June 27, 2019, 2:55 a.m. OK GNU C++14 TESTS 38 15 0 1000
56039672 buddy_1 B June 25, 2019, 1:43 p.m. OK GNU C++14 TESTS 38 15 0 1000
57798699 Nipen_Paul B July 26, 2019, 12:26 p.m. OK GNU C++17 TESTS 38 15 0 1000
58846264 vjudge4 B Aug. 15, 2019, 5:29 a.m. OK GNU C++17 TESTS 38 15 0 1000
58954375 Expired. B Aug. 17, 2019, 12:19 p.m. OK GNU C++17 TESTS 38 15 0 1000
59091252 vjudge2 B Aug. 19, 2019, 12:49 p.m. OK GNU C++17 TESTS 38 15 0 1000
59551434 vjudge1 B Aug. 27, 2019, 3:19 a.m. OK GNU C++17 TESTS 38 15 0 1000
60366853 lnkandies B Sept. 10, 2019, 9:35 p.m. OK GNU C++17 TESTS 38 15 0 1000
61175613 T--o_o--T B Sept. 23, 2019, 6:23 p.m. OK GNU C++17 TESTS 38 15 0 1000
62556229 fiber B Oct. 14, 2019, 10:39 a.m. OK GNU C++17 TESTS 38 15 0 1000
63642348 vjudge5 B Oct. 28, 2019, 8:31 a.m. OK GNU C++17 TESTS 38 15 0 1000
64082573 reetik B Nov. 2, 2019, 10:37 a.m. OK GNU C++17 TESTS 38 15 0 1000
46624373 stefan.sakalik B Dec. 4, 2018, 7:43 p.m. OK Go TESTS 38 30 0 1000
50998470 fayzzz B March 8, 2019, 5:33 a.m. OK Go TESTS 38 31 0 1000
47243025 ledinhbao B Dec. 19, 2018, 3:37 a.m. OK Go TESTS 38 31 0 1000
47396328 sinapusu2002 B Dec. 23, 2018, 11:26 a.m. OK Haskell TESTS 38 15 8499200 1000
52925134 code_report B April 17, 2019, 8:04 p.m. OK Haskell TESTS 38 31 102400 1000
57770205 jmazon B July 25, 2019, 11:53 p.m. OK Haskell TESTS 38 46 102400 1000
68644139 cribabby B Jan. 12, 2020, 8:29 a.m. OK Java 11 TESTS 38 171 0 1000
69905619 GiantTornado B Jan. 31, 2020, 2:04 p.m. OK Java 11 TESTS 38 187 0 1000
65936782 bleh0.5 B Nov. 29, 2019, 2:52 a.m. OK Java 11 TESTS 38 202 0 1000
56008717 caoash B June 24, 2019, 4:57 p.m. OK Java 8 TESTS 38 108 0 1000
51416017 bencebosko B March 17, 2019, 2:03 p.m. OK Java 8 TESTS 38 108 0 1000
46098596 Omegaxis213 B Nov. 23, 2018, 3:21 a.m. OK Java 8 TESTS 38 108 0 1000
46004175 riyasnh B Nov. 20, 2018, 4:05 p.m. OK Java 8 TESTS 38 108 0 1000
69649681 luchy0120 B Jan. 28, 2020, 4:22 a.m. OK Java 8 TESTS 38 109 0 1000
67482687 adzi B Dec. 23, 2019, 4:27 p.m. OK Java 8 TESTS 38 109 0 1000
61032968 Hoctopus B Sept. 21, 2019, 6:26 p.m. OK Java 8 TESTS 38 109 0 1000
59240364 YahiaMostafa B Aug. 21, 2019, 7:22 p.m. OK Java 8 TESTS 38 109 0 1000
59041009 Vatsal53 B Aug. 18, 2019, 3:34 p.m. OK Java 8 TESTS 38 109 0 1000
57836708 vvenkai B July 27, 2019, 7:49 a.m. OK Java 8 TESTS 38 109 0 1000
55332170 pere B June 9, 2019, 11:38 a.m. OK Kotlin TESTS 38 155 102400 1000
46760953 hast_ B Dec. 8, 2018, 1:25 p.m. OK Kotlin TESTS 38 155 102400 1000
46943737 Psionicist B Dec. 12, 2018, 6:22 p.m. OK Mono C# TESTS 38 46 0 1000
55687434 maxusD B June 17, 2019, 4:14 p.m. OK Mono C# TESTS 38 46 0 1000
52537238 Dima1247 B April 9, 2019, 4:13 p.m. OK Mono C# TESTS 38 46 0 1000
46842289 Skndr801 B Dec. 10, 2018, 8:33 a.m. OK Mono C# TESTS 38 46 0 1000
46385883 zazak B Nov. 29, 2018, 10:39 p.m. OK Mono C# TESTS 38 46 0 1000
46286504 Tep B Nov. 27, 2018, 4:35 p.m. OK Mono C# TESTS 38 46 0 1000
53990307 og.kostya B May 11, 2019, 11:58 a.m. OK Mono C# TESTS 38 46 102400 1000
47257566 AlexTemp B Dec. 19, 2018, 11:03 a.m. OK Mono C# TESTS 38 46 204800 1000
61793349 TheThing B Oct. 3, 2019, 4:30 p.m. OK Mono C# TESTS 38 61 0 1000
59206105 shohag_16030 B Aug. 21, 2019, 6:58 a.m. OK Mono C# TESTS 38 61 0 1000
47089747 vjudge4 B Dec. 16, 2018, 4:47 a.m. OK MS C++ TESTS 38 15 0 1000
51251330 vjudge5 B March 13, 2019, 8:52 a.m. OK MS C++ TESTS 38 30 0 1000
50905351 vjudge1 B March 6, 2019, 7:41 p.m. OK MS C++ TESTS 38 30 0 1000
50762325 vjudge1 B March 3, 2019, 8:18 p.m. OK MS C++ TESTS 38 30 0 1000
50606641 vjudge5 B Feb. 28, 2019, 2:51 p.m. OK MS C++ TESTS 38 30 0 1000
51480628 vjudge1 B March 19, 2019, 11:26 a.m. OK MS C++ TESTS 38 30 0 1000
51483448 vjudge4 B March 19, 2019, 12:35 p.m. OK MS C++ TESTS 38 30 0 1000
58846765 vjudge3 B Aug. 15, 2019, 5:44 a.m. OK MS C++ TESTS 38 30 0 1000
63433793 vjudge5 B Oct. 26, 2019, 9:56 a.m. OK MS C++ TESTS 38 30 0 1000
65150349 vjudge5 B Nov. 16, 2019, 7:14 a.m. OK MS C++ TESTS 38 30 0 1000
50910667 work_hard. B March 7, 2019, 1:42 a.m. OK MS C++ 2017 TESTS 38 15 0 1000
63719017 Ekrte B Oct. 29, 2019, 10:46 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
65801540 vjudge2 B Nov. 27, 2019, 7:41 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
64206627 vjudge2 B Nov. 4, 2019, 1:02 p.m. OK MS C++ 2017 TESTS 38 31 0 1000
65232088 vjudge1 B Nov. 17, 2019, 5:34 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
65761193 vjudge1 B Nov. 26, 2019, 3:53 p.m. OK MS C++ 2017 TESTS 38 31 0 1000
65801588 vjudge5 B Nov. 27, 2019, 7:42 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
65801725 vjudge2 B Nov. 27, 2019, 7:46 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
66434801 khsustudent B Dec. 7, 2019, 5:37 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
65801485 vjudge2 B Nov. 27, 2019, 7:39 a.m. OK MS C++ 2017 TESTS 38 31 0 1000
49869171 vjudge4 B Feb. 13, 2019, 1:13 p.m. OK Node.js TESTS 38 155 409600 1000
50926539 rnd B March 7, 2019, 12:07 p.m. OK Ocaml TESTS 38 30 0 1000
47084670 Valiors B Dec. 16, 2018, 12:28 a.m. OK Ocaml TESTS 38 31 0 1000
46391638 zubik6 B Nov. 30, 2018, 6:20 a.m. OK PascalABC.NET TESTS 38 46 0 1000
46354919 matuxxa B Nov. 29, 2018, 7:42 a.m. OK PascalABC.NET TESTS 38 46 102400 1000
46285537 TaeRon0816 B Nov. 27, 2018, 3:56 p.m. OK PascalABC.NET TESTS 38 46 102400 1000
46260616 cristi17 B Nov. 26, 2018, 7:41 p.m. OK PascalABC.NET TESTS 38 46 102400 1000
46026334 MrCriss1 B Nov. 21, 2018, 11:28 a.m. OK PascalABC.NET TESTS 38 62 102400 1000
48206712 arkey77 B Jan. 11, 2019, 9:20 a.m. OK PascalABC.NET TESTS 38 280 307200 1000
55305397 Houy3 B June 8, 2019, 2:07 p.m. OK PascalABC.NET TESTS 38 295 307200 1000
48206632 arkey77 B Jan. 11, 2019, 9:17 a.m. OK PascalABC.NET TESTS 38 311 204800 1000
51987497 rm.R0b0T B March 29, 2019, 6:12 p.m. OK PascalABC.NET TESTS 38 327 0 1000
48206599 arkey77 B Jan. 11, 2019, 9:15 a.m. OK PascalABC.NET TESTS 38 373 204800 1000
64706388 egaeus B Nov. 11, 2019, 4:41 p.m. OK PyPy 2 TESTS 38 124 0 1000
46169389 jhilary B Nov. 24, 2018, 12:12 p.m. OK PyPy 2 TESTS 38 156 0 1000
54852592 gatsko B May 30, 2019, 5:23 p.m. OK PyPy 2 TESTS 38 217 7680000 1000
46063980 wangkan2001 B Nov. 22, 2018, 3:02 p.m. OK PyPy 2 TESTS 38 233 0 1000
53203729 deadguy B April 23, 2019, 7:37 p.m. OK PyPy 3 TESTS 38 124 0 1000
51892160 MEJlAHXOJluK B March 27, 2019, 9:43 a.m. OK PyPy 3 TESTS 38 124 0 1000
48485857 nik-in-au B Jan. 17, 2019, 8:21 a.m. OK PyPy 3 TESTS 38 124 0 1000
46890169 kyuna B Dec. 11, 2018, 5:17 a.m. OK PyPy 3 TESTS 38 124 0 1000
46169762 rmihael B Nov. 24, 2018, 12:21 p.m. OK PyPy 3 TESTS 38 124 0 1000
61118202 vjudge1 B Sept. 23, 2019, 1:34 p.m. OK PyPy 3 TESTS 38 124 0 1000
59652935 propashii B Aug. 29, 2019, 9:03 a.m. OK PyPy 3 TESTS 38 139 0 1000
57342746 139pavlusha B July 19, 2019, 7:57 p.m. OK PyPy 3 TESTS 38 139 0 1000
49136563 ashwaththama B Jan. 29, 2019, 7:58 a.m. OK PyPy 3 TESTS 38 139 0 1000
46106041 Skybytskyi.Nikita B Nov. 23, 2018, 9:15 a.m. OK PyPy 3 TESTS 38 139 0 1000
47180682 alessandrosolbiati B Dec. 17, 2018, 8:34 p.m. OK Python 2 TESTS 38 156 102400 1000
55516194 Pratik_dey18 B June 13, 2019, 5:27 a.m. OK Python 2 TESTS 38 170 0 1000
46536902 nihalgeorge01 B Dec. 3, 2018, 9:33 a.m. OK Python 2 TESTS 38 171 0 1000
57993062 bsr011 B July 30, 2019, 1:59 p.m. OK Python 2 TESTS 38 171 0 1000
55486150 SarveshDubey B June 12, 2019, 7:57 a.m. OK Python 2 TESTS 38 171 0 1000
47330387 vjudge3 B Dec. 21, 2018, 12:37 p.m. OK Python 2 TESTS 38 171 0 1000
47195623 kaif_7 B Dec. 18, 2018, 2:24 p.m. OK Python 2 TESTS 38 171 0 1000
47166787 alessandrosolbiati B Dec. 17, 2018, 12:55 p.m. OK Python 2 TESTS 38 171 0 1000
46998351 wateret B Dec. 14, 2018, 10:01 a.m. OK Python 2 TESTS 38 171 0 1000
48438039 scambret B Jan. 15, 2019, 10:47 p.m. OK Python 2 TESTS 38 187 0 1000
51755277 chauhain B March 23, 2019, 11:17 a.m. OK Python 3 TESTS 38 93 0 1000
49607180 younes38 Amin_AZER B Feb. 7, 2019, 8:14 p.m. OK Python 3 TESTS 38 93 0 1000
54502449 vchilikov B May 22, 2019, 11:19 p.m. OK Python 3 TESTS 38 108 0 1000
49884750 Sarilanoo B Feb. 13, 2019, 8:22 p.m. OK Python 3 TESTS 38 108 0 1000
49771763 Varvara_Dmitrievna B Feb. 11, 2019, 1:54 p.m. OK Python 3 TESTS 38 108 0 1000
48417914 krylov.sergey.1999 ztitova B Jan. 15, 2019, 11:31 a.m. OK Python 3 TESTS 38 108 0 1000
48211308 eddy1021 B Jan. 11, 2019, 12:11 p.m. OK Python 3 TESTS 38 108 0 1000
61587762 Just__Nick B Oct. 1, 2019, 5:47 a.m. OK Python 3 TESTS 38 108 0 1000
58852418 zahra.kh B Aug. 15, 2019, 8:01 a.m. OK Python 3 TESTS 38 108 0 1000
66412147 GaMeR-X B Dec. 6, 2019, 3:41 p.m. OK Python 3 TESTS 38 109 0 1000
46253483 cielavenir B Nov. 26, 2018, 3:21 p.m. OK Ruby TESTS 38 77 0 1000
64392226 tuna_salad B Nov. 6, 2019, 3:47 p.m. OK Rust TESTS 38 31 0 1000
66050718 ten- B Nov. 30, 2019, 5:06 p.m. OK Rust TESTS 38 31 204800 1000
46246873 yakamoto B Nov. 26, 2018, 11:55 a.m. OK Scala TESTS 38 405 0 1000
57863374 dcordb B July 27, 2019, 7:10 p.m. OK Scala TESTS 38 436 0 1000
46124379 kharivitalij B Nov. 23, 2018, 6:10 p.m. OK Scala TESTS 38 468 0 1000
46826907 hot_yoghurt B Dec. 9, 2018, 7:05 p.m. OK Scala TESTS 38 483 0 1000

remove filters

Back to search problems