Codeforces Round 515 (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
1066 Codeforces Round 515 (Div. 3) FINISHED False 7200 198170723 Oct. 12, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8456 ) B Heaters PROGRAMMING greedy two pointers 1500

B"Vova's house is an array consisting of n elements (yeah, this is the first problem, I think, where someone lives in the array). There are heaters in some positions of the array. The i -th element of the array is 1 if there is a heater in the position i , otherwise the i -th element of the array is 0 . Each heater has a value r ( r is the same for all heaters). This value means that the heater at the position pos can warm up all the elements in range [pos - r + 1; pos + r - 1] . Vova likes to walk through his house while he thinks, and he hates cold positions of his house. Vova wants to switch some of his heaters on in such a way that each element of his house will be warmed up by at least one heater. Vova's target is to warm up the whole house (all the elements of the array), i.e. if n = 6 , r = 2 and heaters are at positions 2 and 5 , then Vova can warm up the whole house if he switches all the heaters in the house on (then the first 3 elements will be warmed up by the first heater and the last 3 elements will be warmed up by the second heater). Initially, all the heaters are off. But from the other hand, Vova didn't like to pay much for the electricity. So he wants to switch the minimum number of heaters on in such a way that each element of his house is warmed up by at least one heater. Your task is to find this number of heaters or say that it is impossible to warm up the whole house. The first line of the input contains two integers n and r ( 1 <= n, r <= 1000 ) -- the number of elements in the array and the value of heaters. The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= 1 ) -- the Vova's house description. Print one integer -- the minimum number of heaters needed to warm up the whole house or -1 if it is impossible to do it. In the first example the heater at the position 2 warms up elements $$"...

Tutorials

62419

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
44280233 vjudge4 B Oct. 14, 2018, 3:40 a.m. OK Clang++17 Diagnostics TESTS 65 46 0 1500
44280307 Tommorew B Oct. 14, 2018, 3:46 a.m. OK Clang++17 Diagnostics TESTS 65 46 0 1500
64038294 vjudge3 B Nov. 1, 2019, 5:15 p.m. OK Clang++17 Diagnostics TESTS 65 61 0 1500
64049080 vjudge3 B Nov. 1, 2019, 8:39 p.m. OK Clang++17 Diagnostics TESTS 65 62 819200 1500
45172155 nanae1914 B Nov. 1, 2018, 1:14 p.m. OK D TESTS 65 31 4198400 1500
44624638 vjudge1 B Oct. 21, 2018, 8:14 a.m. OK FPC TESTS 65 31 0 1500
44723926 njsfdxfszx59 B Oct. 23, 2018, 7:05 a.m. OK FPC TESTS 65 31 0 1500
44762922 vjudge4 B Oct. 24, 2018, 8:12 a.m. OK FPC TESTS 65 31 0 1500
45129238 chaorenhaha B Oct. 31, 2018, 9:30 a.m. OK FPC TESTS 65 31 0 1500
44443207 vdanh7277 B Oct. 17, 2018, 12:57 p.m. OK FPC TESTS 65 31 0 1500
44627624 vjudge3 B Oct. 21, 2018, 8:22 a.m. OK FPC TESTS 65 31 0 1500
44624063 vjudge4 B Oct. 21, 2018, 8:10 a.m. OK FPC TESTS 65 31 0 1500
44622968 vjudge3 B Oct. 21, 2018, 7:32 a.m. OK FPC TESTS 65 31 0 1500
44622116 vjudge5 B Oct. 21, 2018, 7:01 a.m. OK FPC TESTS 65 31 0 1500
54848051 biabeogo147 B May 30, 2019, 3:02 p.m. OK FPC TESTS 65 31 102400 1500
45856310 newhh B Nov. 17, 2018, 2:17 a.m. OK GNU C11 TESTS 65 30 0 1500
46237497 jee B Nov. 26, 2018, 4:48 a.m. OK GNU C11 TESTS 65 31 0 1500
46777136 anascimento B Dec. 8, 2018, 9:26 p.m. OK GNU C11 TESTS 65 31 0 1500
49771456 vjudge5 B Feb. 11, 2019, 1:48 p.m. OK GNU C11 TESTS 65 31 0 1500
50467832 vjudge3 B Feb. 24, 2019, 9:02 p.m. OK GNU C11 TESTS 65 31 0 1500
50631518 kolibre B March 1, 2019, 9:21 a.m. OK GNU C11 TESTS 65 31 0 1500
51707521 Romul B March 22, 2019, 4:09 p.m. OK GNU C11 TESTS 65 31 0 1500
55538534 adarshsiva B June 13, 2019, 6:01 p.m. OK GNU C11 TESTS 65 31 0 1500
64053423 vjudge1 B Nov. 1, 2019, 11:24 p.m. OK GNU C11 TESTS 65 31 0 1500
64053702 vjudge5 B Nov. 1, 2019, 11:40 p.m. OK GNU C11 TESTS 65 31 0 1500
44281562 ACMWGR B Oct. 14, 2018, 5:05 a.m. OK GNU C++11 TESTS 65 30 0 1500
44346628 dymsh B Oct. 15, 2018, 7:42 a.m. OK GNU C++11 TESTS 65 30 0 1500
51459992 vjudge3 B March 18, 2019, 7:02 p.m. OK GNU C++11 TESTS 65 30 0 1500
52600970 vjudge3 B April 11, 2019, 11:53 a.m. OK GNU C++11 TESTS 65 30 102400 1500
69726269 vjudge1 B Jan. 29, 2020, 12:21 p.m. OK GNU C++11 TESTS 65 31 0 1500
69117169 vjudge1 B Jan. 19, 2020, 2:09 p.m. OK GNU C++11 TESTS 65 31 0 1500
69873017 Gabrielbc7 B Jan. 31, 2020, 1:56 a.m. OK GNU C++11 TESTS 65 31 0 1500
69117555 Nyse B Jan. 19, 2020, 2:10 p.m. OK GNU C++11 TESTS 65 31 0 1500
69163857 vjudge5 B Jan. 20, 2020, 2:21 a.m. OK GNU C++11 TESTS 65 31 0 1500
69302090 _-Noob-_ B Jan. 22, 2020, 2:07 p.m. OK GNU C++11 TESTS 65 31 0 1500
44320469 ciscodeewane B Oct. 14, 2018, 2:01 p.m. OK GNU C++14 TESTS 65 15 0 1500
55869526 dreamer_98 B June 21, 2019, 1:57 p.m. OK GNU C++14 TESTS 65 15 0 1500
51722788 vjudge5 B March 22, 2019, 5:46 p.m. OK GNU C++14 TESTS 65 15 0 1500
46236649 chetan52720 B Nov. 26, 2018, 3:44 a.m. OK GNU C++14 TESTS 65 15 0 1500
44543798 GodHyum B Oct. 19, 2018, 12:39 p.m. OK GNU C++14 TESTS 65 15 0 1500
44463041 speed_geek B Oct. 17, 2018, 10:13 p.m. OK GNU C++14 TESTS 65 15 0 1500
44327905 Towfiq379 B Oct. 14, 2018, 4:53 p.m. OK GNU C++14 TESTS 65 15 0 1500
44255434 Ari B Oct. 13, 2018, 12:10 p.m. OK GNU C++14 TESTS 65 15 0 1500
44229613 DXTsT B Oct. 12, 2018, 10:08 p.m. OK GNU C++14 TESTS 65 15 0 1500
44225992 Franco1010 B Oct. 12, 2018, 7:33 p.m. OK GNU C++14 TESTS 65 15 0 1500
51416285 DustyBun B March 17, 2019, 2:11 p.m. OK GNU C++17 TESTS 65 15 0 1500
52812393 P4L B April 16, 2019, 9:36 a.m. OK GNU C++17 TESTS 65 15 0 1500
44826059 gyang B Oct. 25, 2018, 6:04 a.m. OK GNU C++17 TESTS 65 15 307200 1500
44885796 abdelrahman____tarek B Oct. 25, 2018, 9:59 p.m. OK GNU C++17 TESTS 65 15 307200 1500
44234244 827852427 B Oct. 13, 2018, 3:15 a.m. OK GNU C++17 TESTS 65 15 307200 1500
44348027 vjudge1 B Oct. 15, 2018, 8:28 a.m. OK GNU C++17 TESTS 65 15 307200 1500
45246029 BlackRain B Nov. 3, 2018, 1:59 p.m. OK GNU C++17 TESTS 65 15 4300800 1500
67651986 Prateek B Dec. 26, 2019, 12:28 p.m. OK GNU C++17 TESTS 65 30 0 1500
67652682 wan-_-s B Dec. 26, 2019, 12:45 p.m. OK GNU C++17 TESTS 65 30 0 1500
66640543 Rund.Rasheed B Dec. 11, 2019, 2:34 p.m. OK GNU C++17 TESTS 65 30 0 1500
44340613 ADJA B Oct. 15, 2018, 3:04 a.m. OK Go TESTS 65 31 0 1500
44246763 Marii B Oct. 13, 2018, 9 a.m. OK Go TESTS 65 31 0 1500
47522663 zstu_jack B Dec. 26, 2018, 1:58 p.m. OK Go TESTS 65 46 0 1500
45342783 davidguandev B Nov. 5, 2018, 10:48 p.m. OK Go TESTS 65 46 0 1500
44263410 lvs7k B Oct. 13, 2018, 3:25 p.m. OK Haskell TESTS 65 31 8499200 1500
69892462 GiantTornado B Jan. 31, 2020, 10:31 a.m. OK Java 11 TESTS 65 187 0 1500
59811173 yatharthbabbar1 B Aug. 31, 2019, 1:39 p.m. OK Java 8 TESTS 65 109 0 1500
67148933 bluesky111 B Dec. 18, 2019, 9:58 a.m. OK Java 8 TESTS 65 109 0 1500
63896084 goyalnikhil064 B Oct. 31, 2019, 2:04 a.m. OK Java 8 TESTS 65 109 0 1500
56646416 Dejokz B July 7, 2019, 6:48 a.m. OK Java 8 TESTS 65 109 0 1500
54814157 thisbeit B May 29, 2019, 6:40 p.m. OK Java 8 TESTS 65 109 0 1500
54609033 lebaur B May 25, 2019, 10:30 a.m. OK Java 8 TESTS 65 109 0 1500
53318692 Hemose B April 26, 2019, 11:49 a.m. OK Java 8 TESTS 65 109 0 1500
51465816 tiagoss2005 B March 19, 2019, 1:17 a.m. OK Java 8 TESTS 65 109 0 1500
49922962 Ahmed..Adel..Selim B Feb. 14, 2019, 8:06 p.m. OK Java 8 TESTS 65 109 0 1500
46837540 dyhu083 B Dec. 10, 2018, 4:33 a.m. OK Java 8 TESTS 65 109 0 1500
44260001 xkor B Oct. 13, 2018, 2:04 p.m. OK Kotlin TESTS 65 140 102400 1500
53271585 Farwent B April 25, 2019, 6:42 a.m. OK Kotlin TESTS 65 140 102400 1500
64057327 vjudge1 B Nov. 2, 2019, 2:06 a.m. OK Mono C# TESTS 65 62 0 1500
56223828 og.kostya B June 28, 2019, 11:01 a.m. OK Mono C# TESTS 65 62 0 1500
68839554 mban259 B Jan. 15, 2020, 5:11 a.m. OK Mono C# TESTS 65 62 0 1500
44893146 witchu B Oct. 26, 2018, 4:48 a.m. OK Mono C# TESTS 65 62 0 1500
44444570 Roverandom B Oct. 17, 2018, 1:26 p.m. OK Mono C# TESTS 65 62 3584000 1500
44222024 Zvigintsev B Oct. 12, 2018, 5:39 p.m. OK Mono C# TESTS 65 62 3584000 1500
44411248 nemars B Oct. 16, 2018, 4:53 p.m. OK Mono C# TESTS 65 62 3584000 1500
47107705 satta_93 B Dec. 16, 2018, 1:48 p.m. OK Mono C# TESTS 65 62 3584000 1500
44255896 azukun B Oct. 13, 2018, 12:19 p.m. OK Mono C# TESTS 65 77 3686400 1500
52292618 lvthanhapcs18 B April 4, 2019, 3:33 a.m. OK MS C++ TESTS 65 30 0 1500
50705687 vjudge4 B March 3, 2019, 3:39 a.m. OK MS C++ TESTS 65 30 0 1500
45753407 vjudge1 B Nov. 15, 2018, 3:39 a.m. OK MS C++ TESTS 65 30 0 1500
45393459 vjudge2 B Nov. 7, 2018, 12:59 a.m. OK MS C++ TESTS 65 30 0 1500
45267285 vjudge4 B Nov. 4, 2018, 6:37 a.m. OK MS C++ TESTS 65 30 0 1500
65433373 vjudge5 B Nov. 20, 2019, 12:42 p.m. OK MS C++ TESTS 65 31 0 1500
65663180 vjudge1 B Nov. 24, 2019, 1:13 p.m. OK MS C++ TESTS 65 31 0 1500
65915491 vjudge4 B Nov. 28, 2019, 2:24 p.m. OK MS C++ TESTS 65 31 0 1500
66086621 vjudge3 B Dec. 1, 2019, 5:12 a.m. OK MS C++ TESTS 65 31 0 1500
69166208 vjudge3 B Jan. 20, 2020, 3:55 a.m. OK MS C++ TESTS 65 31 0 1500
53386486 skychocowhite B April 27, 2019, 3:56 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
64062613 vjudge2 B Nov. 2, 2019, 4:33 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
64059041 vjudge1 B Nov. 2, 2019, 2:55 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
64075306 vjudge1 B Nov. 2, 2019, 8:37 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
69162882 vjudge1 B Jan. 20, 2020, 1:36 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
64063467 vjudge5 B Nov. 2, 2019, 4:53 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
64054166 vjudge2 B Nov. 2, 2019, 12:05 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
61900934 Boryan07 B Oct. 5, 2019, 8:33 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
58354578 yorky B Aug. 5, 2019, 6:46 p.m. OK MS C++ 2017 TESTS 65 31 0 1500
54238188 Still_Theory B May 16, 2019, 11:44 a.m. OK MS C++ 2017 TESTS 65 31 0 1500
49769258 vjudge2 B Feb. 11, 2019, 12:59 p.m. OK Node.js TESTS 65 171 1331200 1500
44237484 pikmike B Oct. 13, 2018, 5:30 a.m. OK PascalABC.NET TESTS 65 46 0 1500
64798888 licey43u B Nov. 13, 2019, 1:53 p.m. OK PascalABC.NET TESTS 65 311 204800 1500
44226269 0x2f8f B Oct. 12, 2018, 7:42 p.m. OK PHP TESTS 65 31 409600 1500
44229580 mayakin B Oct. 12, 2018, 10:06 p.m. OK PHP TESTS 65 46 0 1500
45189277 jhilary B Nov. 1, 2018, 11:46 p.m. OK PyPy 2 TESTS 65 124 0 1500
45189224 jhilary B Nov. 1, 2018, 11:42 p.m. OK PyPy 2 TESTS 65 124 0 1500
44269732 bbc_yy B Oct. 13, 2018, 6:26 p.m. OK PyPy 2 TESTS 65 124 0 1500
58548550 wolffd B Aug. 10, 2019, 6:10 p.m. OK PyPy 2 TESTS 65 124 204800 1500
58548222 wolffd B Aug. 10, 2019, 5:59 p.m. OK PyPy 2 TESTS 65 124 204800 1500
44418333 FatherofBenoni B Oct. 16, 2018, 8:26 p.m. OK PyPy 2 TESTS 65 124 819200 1500
45189191 jhilary B Nov. 1, 2018, 11:40 p.m. OK PyPy 2 TESTS 65 140 0 1500
44280345 SerChirag B Oct. 14, 2018, 3:49 a.m. OK PyPy 2 TESTS 65 140 921600 1500
45189130 jhilary B Nov. 1, 2018, 11:35 p.m. OK PyPy 2 TESTS 65 249 512000 1500
44562968 DedMartyn B Oct. 19, 2018, 8:35 p.m. OK PyPy 3 TESTS 65 124 0 1500
44356928 Kyuu B Oct. 15, 2018, 12:50 p.m. OK PyPy 3 TESTS 65 139 0 1500
44238835 Axyzv B Oct. 13, 2018, 6:05 a.m. OK PyPy 3 TESTS 65 139 307200 1500
64626190 gnomus042 B Nov. 10, 2019, 8:36 a.m. OK PyPy 3 TESTS 65 140 0 1500
55211333 Red4Ru B June 6, 2019, 2:45 p.m. OK PyPy 3 TESTS 65 140 0 1500
44722025 atharva456 B Oct. 23, 2018, 5:51 a.m. OK PyPy 3 TESTS 65 140 0 1500
44722011 limitbreaker37 B Oct. 23, 2018, 5:50 a.m. OK PyPy 3 TESTS 65 140 0 1500
44670118 MBillah B Oct. 21, 2018, 8:38 p.m. OK PyPy 3 TESTS 65 140 0 1500
44333812 Yans B Oct. 14, 2018, 7:54 p.m. OK PyPy 3 TESTS 65 140 0 1500
44251826 qguaihudou B Oct. 13, 2018, 10:49 a.m. OK PyPy 3 TESTS 65 140 0 1500
44381672 entri B Oct. 16, 2018, 4:18 a.m. OK Python 2 TESTS 65 171 0 1500
44343664 mukeremali B Oct. 15, 2018, 5:43 a.m. OK Python 2 TESTS 65 171 0 1500
44276533 EoinDavey B Oct. 13, 2018, 10:16 p.m. OK Python 2 TESTS 65 171 0 1500
44241563 shehebe B Oct. 13, 2018, 7:09 a.m. OK Python 2 TESTS 65 171 0 1500
44216723 wangkan2001 B Oct. 12, 2018, 4:30 p.m. OK Python 2 TESTS 65 171 0 1500
44459846 nealzane B Oct. 17, 2018, 7:50 p.m. OK Python 2 TESTS 65 186 0 1500
44224421 mihir_94 B Oct. 12, 2018, 6:43 p.m. OK Python 2 TESTS 65 187 0 1500
64057656 vjudge4 B Nov. 2, 2019, 2:15 a.m. OK Python 2 TESTS 65 218 102400 1500
44316618 noob77777 B Oct. 14, 2018, 12:28 p.m. OK Python 2 TESTS 65 451 204800 1500
49647730 zhaoy1ping B Feb. 9, 2019, 5:50 a.m. OK Python 3 TESTS 65 108 0 1500
66256297 Annvv B Dec. 4, 2019, 6:07 a.m. OK Python 3 TESTS 65 109 0 1500
53997624 Arhimason B May 11, 2019, 3:26 p.m. OK Python 3 TESTS 65 109 0 1500
53289269 echikawa B April 25, 2019, 3:02 p.m. OK Python 3 TESTS 65 109 0 1500
53218229 gaidash B April 24, 2019, 10:19 a.m. OK Python 3 TESTS 65 109 0 1500
53163203 paramk B April 22, 2019, 5 p.m. OK Python 3 TESTS 65 109 0 1500
47717497 jacksparrowthepirate B Dec. 30, 2018, 8:52 a.m. OK Python 3 TESTS 65 109 0 1500
47523539 zstu_jack B Dec. 26, 2018, 2:28 p.m. OK Python 3 TESTS 65 109 0 1500
47517840 nowyyz B Dec. 26, 2018, 11:08 a.m. OK Python 3 TESTS 65 109 0 1500
46635459 Vasiliy_48 B Dec. 5, 2018, 6:24 a.m. OK Python 3 TESTS 65 109 0 1500
44226715 clupasq B Oct. 12, 2018, 7:58 p.m. OK Ruby TESTS 65 93 204800 1500
44284572 Dx18 B Oct. 14, 2018, 6:49 a.m. OK Rust TESTS 65 46 0 1500

remove filters

Back to search problems