Codeforces Round 618 (Div. 1)

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
1299 Codeforces Round 618 (Div. 1) FINISHED False 7200 156095711 Feb. 9, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3998 ) C Water Balance PROGRAMMING data structures geometry greedy 2100

B"There are n water tanks in a row, i -th of them contains a_i liters of water. The tanks are numbered from 1 to n from left to right. You can perform the following operation: choose some subsegment [l, r] ( 1 <= l <= r <= n ), and redistribute water in tanks l, l+1, ... , r evenly. In other words, replace each of a_l, a_{l+1}, ... , a_r by frac{a_l + a_{l+1} + ... + a_r}{r-l+1} . For example, if for volumes [1, 3, 6, 7] you choose l = 2, r = 3 , new volumes of water will be [1, 4.5, 4.5, 7] . You can perform this operation any number of times. What is the lexicographically smallest sequence of volumes of water that you can achieve? As a reminder: A sequence a is lexicographically smaller than a sequence b of the same length if and only if the following holds: in the first (leftmost) position where a and b differ, the sequence a has a smaller element than the corresponding element in b . The first line contains an integer n ( 1 <= n <= 10^6 ) -- the number of water tanks. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ) -- initial volumes of water in the water tanks, in liters. Because of large input, reading input as doubles is not recommended. Print the lexicographically smallest sequence you can get. In the i -th line print the final volume of water in the i -th tank. Your answer is considered correct if the absolute or relative error of each a_i does not exceed 10^{-9} . Formally, let your answer be a_1, a_2, ... , a_n , and the jury's answer be b_1, b_2, ... , b_n . Your answer is accepted if and only if frac{|a_i - b_i|}{ max{(1, |b_i|)}} <= 10^{-9} for each i . In the first sample, you can get the sequence by applying the operation for subsegment [1, 3] . In the second sample, you can't get any lexicographically smaller sequenc"...

Tutorials

Codeforces Round #618 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
70637057 hos.lyric C Feb. 9, 2020, 2:18 p.m. OK D TESTS 42 936 62566400 2100
70653195 Gassa C Feb. 9, 2020, 2:48 p.m. OK D TESTS 42 1029 61030400 2100
70661195 iica C Feb. 9, 2020, 3:09 p.m. OK D TESTS 42 1045 89907200 2100
70710225 _twilight C Feb. 10, 2020, 6:41 a.m. OK GNU C++11 TESTS 47 218 29388800 2100
70698761 Kewth C Feb. 10, 2020, 1:15 a.m. OK GNU C++11 TESTS 47 623 23859200 2100
71047458 OIer_whx C Feb. 14, 2020, 8:52 a.m. OK GNU C++11 TESTS 48 701 16076800 2100
70664387 shuashuawan C Feb. 9, 2020, 3:18 p.m. OK GNU C++11 TESTS 42 701 24064000 2100
70703153 CaoRui2019 C Feb. 10, 2020, 3:51 a.m. OK GNU C++11 TESTS 47 701 72192000 2100
70699121 function_of_zero C Feb. 10, 2020, 1:30 a.m. OK GNU C++11 TESTS 47 702 19865600 2100
70842217 Fuyuki C Feb. 12, 2020, 12:22 p.m. OK GNU C++11 TESTS 48 716 28160000 2100
70703170 CaoRui2019 C Feb. 10, 2020, 3:51 a.m. OK GNU C++11 TESTS 47 716 72192000 2100
70840676 Mychael C Feb. 12, 2020, 11:52 a.m. OK GNU C++11 TESTS 48 717 16076800 2100
70674691 zbsnb C Feb. 9, 2020, 3:52 p.m. OK GNU C++11 TESTS 42 717 16076800 2100
70760408 KisekiPurin2019 C Feb. 11, 2020, 12:52 a.m. OK GNU C++14 TESTS 48 873 11980800 2100
70651033 natsugiri C Feb. 9, 2020, 2:43 p.m. OK GNU C++14 TESTS 42 904 37273600 2100
70772347 SuperFF C Feb. 11, 2020, 7:32 a.m. OK GNU C++14 TESTS 48 1013 24268800 2100
70641268 yhx-12243 C Feb. 9, 2020, 2:24 p.m. OK GNU C++14 TESTS 42 1138 16076800 2100
70760286 brunomont C Feb. 11, 2020, 12:44 a.m. OK GNU C++14 TESTS 48 1138 29286400 2100
70949314 nagitaosu C Feb. 13, 2020, 10:45 a.m. OK GNU C++14 TESTS 48 1185 25292800 2100
70683638 Amirnasr C Feb. 9, 2020, 5:32 p.m. OK GNU C++14 TESTS 45 1185 29286400 2100
70711083 fanqeixi C Feb. 10, 2020, 6:58 a.m. OK GNU C++14 TESTS 47 1200 36044800 2100
70736699 shdut0901 C Feb. 10, 2020, 2:52 p.m. OK GNU C++14 TESTS 48 1201 16076800 2100
70663715 willingox C Feb. 9, 2020, 3:16 p.m. OK GNU C++14 TESTS 42 1201 20070400 2100
70935265 neal C Feb. 13, 2020, 6:33 a.m. OK GNU C++17 TESTS 48 187 25292800 2100
70935368 neal C Feb. 13, 2020, 6:35 a.m. OK GNU C++17 TESTS 48 202 25292800 2100
70934848 neal C Feb. 13, 2020, 6:22 a.m. OK GNU C++17 TESTS 48 202 25292800 2100
70934831 neal C Feb. 13, 2020, 6:22 a.m. OK GNU C++17 TESTS 48 249 25292800 2100
70688591 neal C Feb. 9, 2020, 6:56 p.m. OK GNU C++17 TESTS 47 249 25292800 2100
70688238 neal C Feb. 9, 2020, 6:50 p.m. OK GNU C++17 TESTS 47 264 25292800 2100
70688433 neal C Feb. 9, 2020, 6:53 p.m. OK GNU C++17 TESTS 47 265 25292800 2100
70772242 dmkozyrev C Feb. 11, 2020, 7:30 a.m. OK GNU C++17 TESTS 48 280 25395200 2100
70719932 dmkozyrev C Feb. 10, 2020, 9:50 a.m. OK GNU C++17 TESTS 48 296 25395200 2100
70658629 neal C Feb. 9, 2020, 3:01 p.m. OK GNU C++17 TESTS 42 311 28160000 2100
70704927 synapse C Feb. 10, 2020, 4:46 a.m. OK Go TESTS 47 951 27648000 2100
70704997 synapse C Feb. 10, 2020, 4:48 a.m. OK Go TESTS 47 951 27750400 2100
70825735 mikit C Feb. 12, 2020, 6:18 a.m. OK Java 11 TESTS 48 1310 57036800 2100
70723988 mikit C Feb. 10, 2020, 11:18 a.m. OK Java 11 TESTS 48 1434 57139200 2100
70654091 ilyakor C Feb. 9, 2020, 2:50 p.m. OK Java 11 TESTS 42 1637 9113600 2100
70662413 Suzukaze C Feb. 9, 2020, 3:12 p.m. OK Java 11 TESTS 42 1949 30822400 2100
70647956 Lewin C Feb. 9, 2020, 2:36 p.m. OK Java 11 TESTS 42 2901 55296000 2100
70803996 ZeyadKhattab C Feb. 11, 2020, 5:48 p.m. OK Java 11 TESTS 48 2932 70144000 2100
70677770 uwi C Feb. 9, 2020, 4:01 p.m. OK Java 8 TESTS 42 716 48537600 2100
70659582 about C Feb. 9, 2020, 3:04 p.m. OK Java 8 TESTS 42 1778 56627200 2100
70662738 SecondThread C Feb. 9, 2020, 3:13 p.m. OK Java 8 TESTS 42 1824 60620800 2100
70696125 AnandOza C Feb. 9, 2020, 10:46 p.m. OK Java 8 TESTS 47 1840 51200000 2100
70683941 AnandOza C Feb. 9, 2020, 5:37 p.m. OK Java 8 TESTS 45 1856 51200000 2100
70663252 SaveVMK C Feb. 9, 2020, 3:15 p.m. OK Java 8 TESTS 42 1856 249753600 2100
70678129 barakraganosungam C Feb. 9, 2020, 4:02 p.m. OK Java 8 TESTS 42 1902 43520000 2100
70686105 ijxjdjd C Feb. 9, 2020, 6:11 p.m. OK Java 8 TESTS 46 2074 89702400 2100
70928937 sugarboy C Feb. 13, 2020, 4:09 a.m. OK Java 8 TESTS 48 2417 160358400 2100
70696472 fetetriste C Feb. 9, 2020, 11:05 p.m. OK Java 8 TESTS 47 2573 45772800 2100
70797397 walborn C Feb. 11, 2020, 3:54 p.m. OK JavaScript TESTS 48 1216 127692800 2100
70651172 Tlatoani C Feb. 9, 2020, 2:43 p.m. OK Kotlin TESTS 42 1216 178278400 2100
70665673 riantkb C Feb. 9, 2020, 3:22 p.m. OK Mono C# TESTS 42 826 116121600 2100
70677432 keymoon C Feb. 9, 2020, 4 p.m. OK Mono C# TESTS 42 1076 137216000 2100
70650689 lxhgww C Feb. 9, 2020, 2:42 p.m. OK MS C++ TESTS 42 1606 12083200 2100
70656797 math957963 C Feb. 9, 2020, 2:57 p.m. OK MS C++ TESTS 42 1747 38912000 2100
70713694 vjudge4 C Feb. 10, 2020, 7:49 a.m. OK MS C++ TESTS 47 2901 24064000 2100
70683544 CrashMaster C Feb. 9, 2020, 5:31 p.m. OK MS C++ 2017 TESTS 45 1106 32358400 2100
70664837 youx C Feb. 9, 2020, 3:19 p.m. OK MS C++ 2017 TESTS 42 1138 44339200 2100
70646724 pichulia C Feb. 9, 2020, 2:34 p.m. OK MS C++ 2017 TESTS 42 1169 24064000 2100
70764325 Parsa84 C Feb. 11, 2020, 3:46 a.m. OK MS C++ 2017 TESTS 48 1559 32870400 2100
70674649 AlexanderL C Feb. 9, 2020, 3:51 p.m. OK MS C++ 2017 TESTS 42 2105 16076800 2100
70659605 gnomina007 C Feb. 9, 2020, 3:04 p.m. OK MS C++ 2017 TESTS 42 2245 61747200 2100
70664215 alanM C Feb. 9, 2020, 3:17 p.m. OK MS C++ 2017 TESTS 42 2386 52736000 2100
70653333 bcollet C Feb. 9, 2020, 2:48 p.m. OK PyPy 2 TESTS 42 1045 109158400 2100
70666728 pajenegod C Feb. 9, 2020, 3:25 p.m. OK PyPy 2 TESTS 42 1825 136396800 2100
70694525 pajenegod C Feb. 9, 2020, 9:33 p.m. OK PyPy 2 TESTS 47 1964 126668800 2100
70694475 pajenegod C Feb. 9, 2020, 9:32 p.m. OK PyPy 2 TESTS 47 2059 154112000 2100
70718242 pajenegod C Feb. 10, 2020, 9:16 a.m. OK PyPy 3 TESTS 48 1965 122572800 2100
70708979 Waiting C Feb. 10, 2020, 6:18 a.m. OK PyPy 3 TESTS 47 2090 104243200 2100
70804487 walborn C Feb. 11, 2020, 5:57 p.m. OK PyPy 3 TESTS 48 2121 113971200 2100
70662811 asvasil C Feb. 9, 2020, 3:13 p.m. OK PyPy 3 TESTS 42 2168 104140800 2100
70819607 nenitb C Feb. 12, 2020, 2:52 a.m. OK PyPy 3 TESTS 48 2199 125030400 2100
70654397 conqueror_of_tourist C Feb. 9, 2020, 2:51 p.m. OK PyPy 3 TESTS 42 2214 161996800 2100
70682998 titia C Feb. 9, 2020, 5:24 p.m. OK PyPy 3 TESTS 45 2215 104755200 2100
70683145 titia C Feb. 9, 2020, 5:26 p.m. OK PyPy 3 TESTS 45 2246 136192000 2100
70719001 pineriver C Feb. 10, 2020, 9:32 a.m. OK PyPy 3 TESTS 48 2807 143872000 2100
70710473 Ormlis C Feb. 10, 2020, 6:46 a.m. OK PyPy 3 TESTS 47 2823 122675200 2100
70673657 sansen C Feb. 9, 2020, 3:48 p.m. OK Rust TESTS 42 451 37683200 2100

remove filters

Back to search problems