Codeforces Round 802 (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
1700 Codeforces Round 802 (Div. 2) FINISHED False 7200 81550463 June 19, 2022, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6222 ) D River Locks PROGRAMMING binary search dp greedy math 1900

B'Recently in Divanovo, a huge river locks system was built. There are now n locks, the i -th of them has the volume of v_i liters, so that it can contain any amount of water between 0 and v_i liters. Each lock has a pipe attached to it. When the pipe is open, 1 liter of water enters the lock every second. The locks system is built in a way to immediately transfer all water exceeding the volume of the lock i to the lock i + 1 . If the lock i + 1 is also full, water will be transferred further. Water exceeding the volume of the last lock pours out to the river. Note that the volume of the i -th lock may be greater than the volume of the i + 1 -th lock. To make all locks work, you need to completely fill each one of them. The mayor of Divanovo is interested in q independent queries. For each query, suppose that initially all locks are empty and all pipes are closed. Then, some pipes are opened simultaneously. For the j -th query the mayor asks you to calculate the minimum number of pipes to open so that all locks are filled no later than after t_j seconds. Please help the mayor to solve this tricky problem and answer his queries. The first lines contains one integer n ( 1 <= n <= 200 ,000 ) -- the number of locks. The second lines contains n integers v_1, v_2, ... , v_n ( 1 <= v_i <= 10^9 )) -- volumes of the locks. The third line contains one integer q ( 1 <= q <= 200 ,000 ) -- the number of queries. Each of the next q lines contains one integer t_j ( 1 <= t_j <= 10^9 ) -- the number of seconds you have to fill all the locks in the query j . Print q integers. The j -th of them should be equal to the minimum number of pipes to turn on so that after t_j seconds all of the locks are filled. If it is impossible to fill all of the locks in given time, print -1 . There are 6 queri'...

Tutorials

103978

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
161210380 LeonidR D June 19, 2022, 10:48 a.m. OK C# 10 TESTS 60 1263 31334400 1900
161227116 Andrei_Kuz D June 19, 2022, 12:59 p.m. OK Clang++17 Diagnostics TESTS 60 233 0 1900
161235946 ruban D June 19, 2022, 2:50 p.m. OK Delphi TESTS 60 249 36454400 1900
161235906 ruban D June 19, 2022, 2:50 p.m. OK FPC TESTS 60 686 36454400 1900
161211955 abhishek_890 D June 19, 2022, 10:54 a.m. OK FPC TESTS 60 748 32153600 1900
161213299 a_vantik_a D June 19, 2022, 10:58 a.m. OK FPC TESTS 60 811 32153600 1900
161213499 adityasoni_19 D June 19, 2022, 10:59 a.m. OK FPC TESTS 60 811 32153600 1900
161211913 ihmydbjno D June 19, 2022, 10:54 a.m. OK FPC TESTS 60 811 32153600 1900
161210067 Katkota D June 19, 2022, 10:47 a.m. OK FPC TESTS 60 811 32153600 1900
161214590 Just_started_0123 D June 19, 2022, 11:02 a.m. OK FPC TESTS 60 811 32153600 1900
161223317 adiboy7 D June 19, 2022, 12:17 p.m. OK FPC TESTS 60 920 32153600 1900
161227085 Andrei_Kuz D June 19, 2022, 12:59 p.m. OK GNU C11 TESTS 60 873 0 1900
161226567 Andrei_Kuz D June 19, 2022, 12:53 p.m. OK GNU C11 TESTS 60 873 0 1900
161226215 Andrei_Kuz D June 19, 2022, 12:49 p.m. OK GNU C11 TESTS 60 904 0 1900
161222638 Illusory_dimes D June 19, 2022, 12:09 p.m. OK GNU C++14 TESTS 60 46 307200 1900
161222657 Scaramouche D June 19, 2022, 12:09 p.m. OK GNU C++14 TESTS 60 62 36249600 1900
161231215 __wfx D June 19, 2022, 1:48 p.m. OK GNU C++14 TESTS 60 140 0 1900
161213961 uniqueharry D June 19, 2022, 11 a.m. OK GNU C++14 TESTS 60 140 2457600 1900
161233400 dengziyue D June 19, 2022, 2:17 p.m. OK GNU C++14 TESTS 60 140 3174400 1900
161265756 abs_xyz D June 20, 2022, 2:29 a.m. OK GNU C++14 TESTS 60 155 819200 1900
161229108 wangzeyu0922 D June 19, 2022, 1:22 p.m. OK GNU C++14 TESTS 60 155 4812800 1900
161224005 Commonrain D June 19, 2022, 12:24 p.m. OK GNU C++14 TESTS 60 155 6451200 1900
161224528 whitesirwang D June 19, 2022, 12:30 p.m. OK GNU C++14 TESTS 60 155 12083200 1900
161233535 my_sortAKNOI2022 D June 19, 2022, 2:19 p.m. OK GNU C++14 TESTS 60 156 1638400 1900
161210156 CLT D June 19, 2022, 10:47 a.m. OK GNU C++17 TESTS 60 46 2867200 1900
161228217 Bobocan D June 19, 2022, 1:12 p.m. OK GNU C++17 TESTS 60 62 819200 1900
161211284 Answer42 D June 19, 2022, 10:51 a.m. OK GNU C++17 TESTS 60 124 1536000 1900
161267596 s39202972 D June 20, 2022, 3:15 a.m. OK GNU C++17 TESTS 60 140 2457600 1900
161217507 notyour-Z D June 19, 2022, 11:27 a.m. OK GNU C++17 TESTS 60 140 3993600 1900
161220290 Awcotn_tct D June 19, 2022, 11:47 a.m. OK GNU C++17 TESTS 60 140 4812800 1900
161210140 majiamajia77 D June 19, 2022, 10:47 a.m. OK GNU C++17 TESTS 60 140 7987200 1900
161223364 sigma-yyf D June 19, 2022, 12:17 p.m. OK GNU C++17 TESTS 60 155 1638400 1900
161239023 _LeMur_ D June 19, 2022, 3:43 p.m. OK GNU C++17 TESTS 60 155 3174400 1900
161209336 skyboard D June 19, 2022, 10:44 a.m. OK GNU C++17 TESTS 60 155 3993600 1900
161263542 YLWang D June 20, 2022, 1:17 a.m. OK GNU C++17 (64) TESTS 60 78 3379200 1900
161228420 Afterglow. D June 19, 2022, 1:14 p.m. OK GNU C++17 (64) TESTS 60 78 4505600 1900
161256625 Havoc_01 D June 19, 2022, 8:30 p.m. OK GNU C++17 (64) TESTS 60 93 819200 1900
161258820 kal013 D June 19, 2022, 9:31 p.m. OK GNU C++17 (64) TESTS 60 93 2457600 1900
161256674 Havoc_01 D June 19, 2022, 8:31 p.m. OK GNU C++17 (64) TESTS 60 108 0 1900
161258236 Beevo D June 19, 2022, 9:13 p.m. OK GNU C++17 (64) TESTS 60 108 819200 1900
161210457 srinjoy_ray D June 19, 2022, 10:48 a.m. OK GNU C++17 (64) TESTS 60 108 1638400 1900
161242367 nil_12 D June 19, 2022, 4:27 p.m. OK GNU C++17 (64) TESTS 60 108 1638400 1900
161261997 Jeevansingh.126 D June 20, 2022, 12:06 a.m. OK GNU C++17 (64) TESTS 60 108 1638400 1900
161273543 zycac D June 20, 2022, 5:38 a.m. OK GNU C++17 (64) TESTS 60 108 1638400 1900
161222170 Rinors D June 19, 2022, 12:04 p.m. OK GNU C++20 (64) TESTS 60 77 819200 1900
161250905 Ganter D June 19, 2022, 6:31 p.m. OK GNU C++20 (64) TESTS 60 77 1638400 1900
161210587 jonathanps D June 19, 2022, 10:49 a.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161263368 notyour_young D June 20, 2022, 1:11 a.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161259808 abotaha23 D June 19, 2022, 10:07 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161250815 Grapeee D June 19, 2022, 6:30 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161232533 aggressor_ D June 19, 2022, 2:05 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161230904 ramakp34 D June 19, 2022, 1:44 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161222442 SlavicG D June 19, 2022, 12:07 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161222138 SlavicG D June 19, 2022, 12:04 p.m. OK GNU C++20 (64) TESTS 60 78 0 1900
161213104 S-A-I-T-A-M-A D June 19, 2022, 10:58 a.m. OK Java 11 TESTS 60 264 0 1900
161260898 Longgggggggg D June 19, 2022, 11:02 p.m. OK Java 11 TESTS 60 280 0 1900
161216607 freehandle D June 19, 2022, 11:23 a.m. OK Java 11 TESTS 60 296 0 1900
161210295 N_LogN D June 19, 2022, 10:48 a.m. OK Java 11 TESTS 60 296 0 1900
161249036 g0dzilla D June 19, 2022, 6:03 p.m. OK Java 11 TESTS 60 312 0 1900
161257929 salanger D June 19, 2022, 9:03 p.m. OK Java 11 TESTS 60 327 0 1900
161269928 naman5811 D June 20, 2022, 4:18 a.m. OK Java 11 TESTS 60 358 2252800 1900
161254818 danbanica D June 19, 2022, 7:47 p.m. OK Java 11 TESTS 60 1591 0 1900
161226337 sidmal45 D June 19, 2022, 12:50 p.m. OK Java 8 TESTS 60 218 4403200 1900
161215039 dogranmol D June 19, 2022, 11:03 a.m. OK Java 8 TESTS 60 234 3993600 1900
161209739 Termii D June 19, 2022, 10:46 a.m. OK Java 8 TESTS 60 249 3072000 1900
161208856 joker_willson D June 19, 2022, 10:43 a.m. OK Java 8 TESTS 60 748 0 1900
161225577 harshsingla06 D June 19, 2022, 12:42 p.m. OK Java 8 TESTS 60 1481 6246400 1900
161222728 mircea85 D June 19, 2022, 12:10 p.m. OK Mono C# TESTS 60 234 31846400 1900
161222688 mircea85 D June 19, 2022, 12:10 p.m. OK Mono C# TESTS 60 264 32358400 1900
161214090 Alexey D June 19, 2022, 11:01 a.m. OK MS C++ 2017 TESTS 60 1091 7270400 1900
161208884 ItamarNir D June 19, 2022, 10:43 a.m. OK MS C++ 2017 TESTS 60 1138 1638400 1900
161240799 XYShaoKang D June 19, 2022, 4:06 p.m. OK Node.js TESTS 60 374 47206400 1900
161223664 Usurper__ D June 19, 2022, 12:21 p.m. OK PyPy 3 TESTS 60 405 32358400 1900
161218314 9.86960440109 D June 19, 2022, 11:32 a.m. OK PyPy 3 TESTS 60 545 36352000 1900
161210306 dhyang24 D June 19, 2022, 10:48 a.m. OK PyPy 3 TESTS 60 655 19865600 1900
161258000 voicon D June 19, 2022, 9:05 p.m. OK PyPy 3 TESTS 60 686 17612800 1900
161233441 Martin53 D June 19, 2022, 2:18 p.m. OK PyPy 3 TESTS 60 686 19558400 1900
161210253 raideva D June 19, 2022, 10:48 a.m. OK PyPy 3 TESTS 60 702 29798400 1900
161212456 Issin D June 19, 2022, 10:55 a.m. OK PyPy 3 TESTS 60 717 40857600 1900
161219121 sushmanth.dampur8780 D June 19, 2022, 11:38 a.m. OK PyPy 3 TESTS 60 748 18739200 1900
161217059 abhijeet.panihar.cse20 D June 19, 2022, 11:24 a.m. OK PyPy 3 TESTS 60 764 19968000 1900
161215090 first_vil D June 19, 2022, 11:03 a.m. OK PyPy 3 TESTS 60 842 33587200 1900
161268654 nicku123 D June 20, 2022, 3:43 a.m. OK PyPy 3-64 TESTS 60 202 34816000 1900
161219831 Adroit_001 D June 19, 2022, 11:43 a.m. OK PyPy 3-64 TESTS 60 233 34099200 1900
161215538 Adroit_001 D June 19, 2022, 11:04 a.m. OK PyPy 3-64 TESTS 60 233 34099200 1900
161263957 hkwu6013 D June 20, 2022, 1:33 a.m. OK PyPy 3-64 TESTS 60 249 44134400 1900
161251718 Aksnov D June 19, 2022, 6:44 p.m. OK PyPy 3-64 TESTS 60 264 36966400 1900
161263715 notyour_young D June 20, 2022, 1:25 a.m. OK PyPy 3-64 TESTS 60 311 35430400 1900
161263507 iska_terminator D June 20, 2022, 1:16 a.m. OK PyPy 3-64 TESTS 60 311 35430400 1900
161263621 mathdude42 D June 20, 2022, 1:21 a.m. OK PyPy 3-64 TESTS 60 311 36864000 1900
161266934 Apoorv_Rathore D June 20, 2022, 2:56 a.m. OK PyPy 3-64 TESTS 60 358 35635200 1900
161247094 oadey89 D June 19, 2022, 5:35 p.m. OK PyPy 3-64 TESTS 60 389 30924800 1900
161263498 iska_terminator D June 20, 2022, 1:16 a.m. OK Python 3 TESTS 60 608 16691200 1900
161236632 DaRk_hEaRt_ D June 19, 2022, 3 p.m. OK Python 3 TESTS 60 1372 16793600 1900
161246969 akshitha_1234 D June 19, 2022, 5:34 p.m. OK Python 3 TESTS 60 1840 16179200 1900
161218706 Dhruv_Viradiya D June 19, 2022, 11:35 a.m. OK Python 3 TESTS 60 1840 16179200 1900
161261710 dean.menezes D June 19, 2022, 11:48 p.m. OK Python 3 TESTS 60 1887 16179200 1900
161255046 mihir111p D June 19, 2022, 7:52 p.m. OK Python 3 TESTS 60 1902 16179200 1900
161228140 yashnagda17 D June 19, 2022, 1:11 p.m. OK Python 3 TESTS 60 1996 16179200 1900
161247391 Thallium54 D June 19, 2022, 5:40 p.m. OK Rust 2021 TESTS 60 46 8499200 1900
161218774 magnus.hegdahl D June 19, 2022, 11:36 a.m. OK Rust 2021 TESTS 60 62 13209600 1900

remove filters

Back to search problems