Codeforces Round 627 (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
1324 Codeforces Round 627 (Div. 3) FINISHED False 7200 147804899 March 12, 2020, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13721 ) E Sleeping Schedule PROGRAMMING dp

B'Vova had a pretty weird sleeping schedule. There are h hours in a day. Vova will sleep exactly n times. The i -th time he will sleep exactly after a_i hours from the time he woke up. You can assume that Vova woke up exactly at the beginning of this story (the initial time is 0 ). Each time Vova sleeps exactly one day (in other words, h hours). Vova thinks that the i -th sleeping time is good if he starts to sleep between hours l and r inclusive. Vova can control himself and before the i -th time can choose between two options: go to sleep after a_i hours or after a_i - 1 hours. Your task is to say the maximum number of good sleeping times Vova can obtain if he acts optimally. The first line of the input contains four integers n, h, l and r ( 1 <= n <= 2000, 3 <= h <= 2000, 0 <= l <= r < h ) -- the number of times Vova goes to sleep, the number of hours in a day and the segment of the good sleeping time. The second line of the input contains n integers a_1, a_2, ... , a_n ( 1 <= a_i < h ), where a_i is the number of hours after which Vova goes to sleep the i -th time. Print one integer -- the maximum number of good sleeping times Vova can obtain if he acts optimally. The maximum number of good times in the example is 3 . The story starts from t=0 . Then Vova goes to sleep after a_1 - 1 hours, now the time is 15 . This time is not good. Then Vova goes to sleep after a_2 - 1 hours, now the time is 15 + 16 = 7 . This time is also not good. Then Vova goes to sleep after a_3 hours, now the time is 7 + 14 = 21 . This time is good. Then Vova goes to sleep after a_4 - 1 hours, now the time is 21 + 19 = 16 . This time is not good. Then Vova goes to sleep after a_5 hours, now the time is 16 + 20 = 12 . This time is not good. Then Vova goes to sleep after a_6 hours, now the time '...

Tutorials

Codeforces Round #627 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
73540036 proletario E March 18, 2020, 5:24 a.m. OK Clang++17 Diagnostics TESTS 74 889 23040000
73655905 YarinIsYarin E March 19, 2020, 1:19 p.m. OK Clang++17 Diagnostics TESTS 74 1372 29491200
73290356 TheHedgehog E March 14, 2020, 9:53 p.m. OK Delphi TESTS 74 78 19148800
73102670 LaSWeeG E March 12, 2020, 8:09 p.m. OK FPC TESTS 74 109 16384000
73081013 Tremail E March 12, 2020, 3:11 p.m. OK GNU C++11 TESTS 74 31 0
73184578 gary828 E March 14, 2020, 4:19 a.m. OK GNU C++11 TESTS 74 31 15872000
73123519 hunxuewangzi E March 13, 2020, 6:33 a.m. OK GNU C++11 TESTS 74 31 15974400
73298812 zengpeichen E March 15, 2020, 3:06 a.m. OK GNU C++11 TESTS 74 31 16076800
73520316 lyhehehe E March 17, 2020, 7:34 p.m. OK GNU C++11 TESTS 74 46 0
73377466 tanxi E March 16, 2020, 3:05 a.m. OK GNU C++11 TESTS 74 46 0
73339646 Drumer E March 15, 2020, 1:46 p.m. OK GNU C++11 TESTS 74 46 0
73295646 rqbqbqb E March 15, 2020, 1:18 a.m. OK GNU C++11 TESTS 74 46 0
73292286 jonathan.shifman E March 14, 2020, 10:54 p.m. OK GNU C++11 TESTS 74 46 0
73191384 thanhtien92to123 E March 14, 2020, 6:39 a.m. OK GNU C++11 TESTS 74 46 0
73400338 18ucs134 E March 16, 2020, 10:53 a.m. OK GNU C++14 TESTS 74 31 16076800
73463951 nitvjudge1 E March 17, 2020, 8 a.m. OK GNU C++14 TESTS 74 31 16179200
73205238 kkqq E March 14, 2020, 10:23 a.m. OK GNU C++14 TESTS 74 31 16179200
73183870 1525227502 E March 14, 2020, 3:58 a.m. OK GNU C++14 TESTS 74 31 16384000
73556653 Raveesh E March 18, 2020, 9:42 a.m. OK GNU C++14 TESTS 74 46 0
73467399 lyc12345 E March 17, 2020, 8:53 a.m. OK GNU C++14 TESTS 74 46 0
73466013 lakshaysood E March 17, 2020, 8:32 a.m. OK GNU C++14 TESTS 74 46 0
73454923 Ramprosad E March 17, 2020, 5:26 a.m. OK GNU C++14 TESTS 74 46 0
73378832 wisdompeak E March 16, 2020, 3:55 a.m. OK GNU C++14 TESTS 74 46 0
73304055 shubham107 E March 15, 2020, 5:19 a.m. OK GNU C++14 TESTS 74 46 0
73174654 raararaara E March 13, 2020, 9:25 p.m. OK GNU C++17 TESTS 74 31 16076800
73535173 kobortor E March 18, 2020, 3:15 a.m. OK GNU C++17 TESTS 74 46 0
73451238 KerakTelor E March 17, 2020, 3:36 a.m. OK GNU C++17 TESTS 74 46 0
73420363 krasav4ik E March 16, 2020, 3:43 p.m. OK GNU C++17 TESTS 74 46 0
73404990 algzjh E March 16, 2020, 12:01 p.m. OK GNU C++17 TESTS 74 46 0
73399331 Kostya E March 16, 2020, 10:36 a.m. OK GNU C++17 TESTS 74 46 0
73384540 apikdech E March 16, 2020, 6:22 a.m. OK GNU C++17 TESTS 74 46 0
73369197 tyler E March 15, 2020, 9:20 p.m. OK GNU C++17 TESTS 74 46 0
73332975 graveyard111 E March 15, 2020, 12:20 p.m. OK GNU C++17 TESTS 74 46 0
73304019 CODE4H4 E March 15, 2020, 5:19 a.m. OK GNU C++17 TESTS 74 46 0
73625786 baihuahua E March 19, 2020, 5:57 a.m. OK Go TESTS 74 78 5324800
73446264 jaynils E March 17, 2020, 12:15 a.m. OK Java 11 TESTS 74 218 18022400
73535840 tusharjape007 E March 18, 2020, 3:35 a.m. OK Java 11 TESTS 74 218 18329600
73448569 sakt_coder E March 17, 2020, 1:55 a.m. OK Java 11 TESTS 74 233 18329600
73123942 Azakarka E March 13, 2020, 6:41 a.m. OK Java 11 TESTS 74 234 18329600
73793236 Ziax E March 20, 2020, 12:49 p.m. OK Java 11 TESTS 74 249 18022400
73472826 Piccadilly E March 17, 2020, 10:18 a.m. OK Java 11 TESTS 74 249 18022400
73465961 sajith E March 17, 2020, 8:31 a.m. OK Java 11 TESTS 74 249 18432000
73487269 mr_jt E March 17, 2020, 1:01 p.m. OK Java 11 TESTS 74 264 20172800
73090448 cribabby E March 12, 2020, 4:55 p.m. OK Java 11 TESTS 74 264 22425600
73153388 Anonymous E March 13, 2020, 4:16 p.m. OK Java 11 TESTS 74 280 18124800
73619684 liuhanguang E March 19, 2020, 3:21 a.m. OK Java 8 TESTS 74 140 17203200
73332170 ykt836 E March 15, 2020, 12:10 p.m. OK Java 8 TESTS 74 155 0
73205940 In_The_Name_Of_Love E March 14, 2020, 10:35 a.m. OK Java 8 TESTS 74 155 16896000
73165010 MagentaCobra E March 13, 2020, 6:37 p.m. OK Java 8 TESTS 74 155 17305600
73494721 conquerorArpit E March 17, 2020, 2:28 p.m. OK Java 8 TESTS 74 156 16793600
73355118 golions E March 15, 2020, 5:08 p.m. OK Java 8 TESTS 74 156 17305600
73596178 FreymanLozanoq E March 18, 2020, 5:46 p.m. OK Java 8 TESTS 74 170 16896000
73106885 lzhang E March 12, 2020, 9:53 p.m. OK Java 8 TESTS 74 170 17305600
73593072 manishjha221 E March 18, 2020, 5:09 p.m. OK Java 8 TESTS 74 171 16793600
73372612 MahmoudJobeel E March 15, 2020, 11:14 p.m. OK Java 8 TESTS 74 171 16793600
73307019 jhonber E March 15, 2020, 6:08 a.m. OK JavaScript TESTS 74 1232 38092800
73115334 Spheniscine E March 13, 2020, 3:18 a.m. OK Kotlin TESTS 74 171 512000
73346116 bohuss E March 15, 2020, 3:10 p.m. OK Kotlin TESTS 74 390 77824000
73419884 YESMAths E March 16, 2020, 3:36 p.m. OK Kotlin TESTS 74 702 140697600
73098615 SlavaG E March 12, 2020, 6:55 p.m. OK Kotlin TESTS 74 982 132096000
73745604 Fire E March 19, 2020, 10:10 p.m. OK Mono C# TESTS 74 124 102400
73106752 capsule E March 12, 2020, 9:49 p.m. OK Mono C# TESTS 74 140 6860800
73543435 acrux E March 18, 2020, 6:26 a.m. OK MS C++ TESTS 74 46 0
73550674 vjudge5 E March 18, 2020, 8:15 a.m. OK MS C++ TESTS 74 46 16179200
73186193 Paranoid19 E March 14, 2020, 5:03 a.m. OK MS C++ TESTS 74 46 16588800
73111474 vjudge3 E March 13, 2020, 1 a.m. OK MS C++ TESTS 74 61 16179200
73794683 vjudge4 E March 20, 2020, 1:06 p.m. OK MS C++ TESTS 74 61 16179200
73801323 vjudge2 E March 20, 2020, 2:24 p.m. OK MS C++ TESTS 74 61 17715200
73470303 battleheart E March 17, 2020, 9:39 a.m. OK MS C++ TESTS 74 62 0
73222175 vjudge3 E March 14, 2020, 2:34 p.m. OK MS C++ TESTS 74 62 16076800
73795243 vjudge1 E March 20, 2020, 1:13 p.m. OK MS C++ TESTS 74 62 16076800
73798215 vjudge5 E March 20, 2020, 1:47 p.m. OK MS C++ TESTS 74 62 16179200
73359962 danilgrig E March 15, 2020, 6:20 p.m. OK MS C++ 2017 TESTS 74 46 307200
73399719 omerb.zeybek E March 16, 2020, 10:43 a.m. OK MS C++ 2017 TESTS 74 46 307200
73155004 systemcalled E March 13, 2020, 4:38 p.m. OK MS C++ 2017 TESTS 74 46 16076800
73146051 LeeLdler E March 13, 2020, 2:44 p.m. OK MS C++ 2017 TESTS 74 46 16179200
73798127 vjudge2 E March 20, 2020, 1:46 p.m. OK MS C++ 2017 TESTS 74 46 16384000
73151086 openingsound E March 13, 2020, 3:46 p.m. OK MS C++ 2017 TESTS 74 46 16384000
73798708 vjudge5 E March 20, 2020, 1:52 p.m. OK MS C++ 2017 TESTS 74 46 16384000
73629050 Hatzker E March 19, 2020, 6:52 a.m. OK MS C++ 2017 TESTS 74 46 16998400
73131660 rhksdn6227 E March 13, 2020, 9:15 a.m. OK MS C++ 2017 TESTS 74 61 16076800
73254343 jadeQ E March 14, 2020, 3:35 p.m. OK MS C++ 2017 TESTS 74 62 16179200
73209914 shivam1420 E March 14, 2020, 11:37 a.m. OK Node.js TESTS 74 312 49254400
73292893 fel2fram E March 14, 2020, 11:19 p.m. OK PyPy 2 TESTS 74 217 1126400
73370273 fel2fram E March 15, 2020, 9:50 p.m. OK PyPy 2 TESTS 74 249 1331200
73424531 shehebe E March 16, 2020, 4:39 p.m. OK PyPy 2 TESTS 74 249 4710400
73090334 parasmehan123 E March 12, 2020, 4:53 p.m. OK PyPy 2 TESTS 74 296 18841600
73161543 beethoven97 E March 13, 2020, 5:53 p.m. OK PyPy 2 TESTS 74 296 20377600
73190660 anshuman16423 E March 14, 2020, 6:28 a.m. OK PyPy 2 TESTS 74 327 20172800
73213496 yumtam E March 14, 2020, 12:32 p.m. OK PyPy 2 TESTS 74 483 8089600
73417357 YESMAths E March 16, 2020, 3:02 p.m. OK PyPy 2 TESTS 74 1731 201318400
73644906 golfbaby E March 19, 2020, 10:43 a.m. OK PyPy 3 TESTS 74 217 2764800
73146058 takakin E March 13, 2020, 2:44 p.m. OK PyPy 3 TESTS 74 217 19865600
73417944 Notebook E March 16, 2020, 3:10 p.m. OK PyPy 3 TESTS 74 218 3891200
73125341 Ueki E March 13, 2020, 7:07 a.m. OK PyPy 3 TESTS 74 218 19865600
73166019 shade1010 E March 13, 2020, 6:51 p.m. OK PyPy 3 TESTS 74 234 5939200
73122174 tyawanmusi E March 13, 2020, 6:08 a.m. OK PyPy 3 TESTS 74 234 19865600
73201945 aman06016 E March 14, 2020, 9:32 a.m. OK PyPy 3 TESTS 74 249 36864000
73088427 thekushalghosh E March 12, 2020, 4:26 p.m. OK PyPy 3 TESTS 74 264 4505600
73081900 ryo_n E March 12, 2020, 3:17 p.m. OK PyPy 3 TESTS 74 265 19251200
73753327 brthyyjp E March 20, 2020, 2:24 a.m. OK PyPy 3 TESTS 74 265 19865600
73370019 fel2fram E March 15, 2020, 9:43 p.m. OK Python 2 TESTS 74 1153 204800
73169610 TheMisfits E March 13, 2020, 7:45 p.m. OK Python 3 TESTS 74 1918 48025600
73166286 shade1010 E March 13, 2020, 6:55 p.m. OK Python 3 TESTS 74 1996 716800
73111250 manta1130 E March 13, 2020, 12:51 a.m. OK Rust TESTS 74 77 16998400

remove filters

Back to search problems