Hello 2024

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
1919 Hello 2024 FINISHED False 9000 71940284 Jan. 6, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1084 ) F2 Wine Factory (Hard Version) PROGRAMMING data structures flows 2800

This is the hard version of the problem. The only difference between the two versions is the constraint on (c_i) and (z). You can make hacks only if both versions of the problem are solved. There are three arrays (a), (b) and (c). (a) and (b) have length (n) and (c) has length (n-1). Let (W(a,b,c)) denote the liters of wine created from the following process. Create (n) water towers. The (i)-th water tower initially has (a_i) liters of water and has a wizard with power (b_i) in front of it. Furthermore, for each (1 \le i \le n - 1), there is a valve connecting water tower (i) to (i + 1) with capacity (c_i). For each (i) from (1) to (n) in this order, the following happens: The wizard in front of water tower (i) removes at most (b_i) liters of water from the tower and turns the removed water into wine. If (i \neq n), at most (c_i) liters of the remaining water left in water tower (i) flows through the valve into water tower (i + 1). There are (q) updates. In each update, you will be given integers (p), (x), (y) and (z) and you will update (a_p := x), (b_p := y) and (c_p := z). After each update, find the value of (W(a,b,c)). Note that previous updates to arrays (a), (b) and (c) persist throughout future updates. The first line contains two integers (n) and (q) ((2 \le n \le 5\cdot 10^5), (1 \le q \le 5\cdot 10^5)) — the number of water towers and the number of updates. The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((0 \le a_i \le 10^9)) — the number of liters of water in water tower (i). The third line contains (n) integers (b_1, b_2, \ldots, b_n) ((0 \le b_i \le 10^9)) — the power of the wizard in front of water tower (i). The fourth line contains (n - 1) integers (c_1, c_2, \ldots, c_{n - 1}) ($$$0 \le c_i \color{red}{\le} 10^{

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
240619491 rainboy F2 Jan. 6, 2024, 9:18 p.m. OK GNU C11 TESTS 46 4897 50278400 2800
240628283 wukaichen888 F2 Jan. 7, 2024, 1:39 a.m. OK GNU C++14 TESTS 46 1856 152268800 2800
240628593 11d10xy F2 Jan. 7, 2024, 1:47 a.m. OK GNU C++14 TESTS 46 1903 76185600 2800
240601437 qwef_ F2 Jan. 6, 2024, 5:53 p.m. OK GNU C++14 TESTS 45 2433 124313600 2800
240596143 AC-Automation F2 Jan. 6, 2024, 5 p.m. OK GNU C++14 TESTS 45 2776 76185600 2800
240628444 xuanxuan001 F2 Jan. 7, 2024, 1:43 a.m. OK GNU C++14 TESTS 46 3322 45670400 2800
240591029 wangyian2022 F2 Jan. 6, 2024, 4:46 p.m. OK GNU C++14 TESTS 45 3743 126361600 2800
240631499 Flamire F2 Jan. 7, 2024, 2:55 a.m. OK GNU C++14 TESTS 46 4960 237056000 2800
240615120 Ahmed_Nassar F2 Jan. 6, 2024, 8:08 p.m. OK GNU C++17 TESTS 46 1840 40038400 2800
240615084 ignifi F2 Jan. 6, 2024, 8:08 p.m. OK GNU C++17 TESTS 46 1918 40038400 2800
240593233 Faruzan F2 Jan. 6, 2024, 4:53 p.m. OK GNU C++17 TESTS 45 1918 61644800 2800
240592581 ppavic F2 Jan. 6, 2024, 4:51 p.m. OK GNU C++17 TESTS 45 1934 54067200 2800
240602713 ne4eHbKa F2 Jan. 6, 2024, 5:59 p.m. OK GNU C++17 TESTS 46 1980 64409600 2800
240602999 lotusblume F2 Jan. 6, 2024, 6:01 p.m. OK GNU C++17 TESTS 46 2074 45977600 2800
240600680 Ant_Man F2 Jan. 6, 2024, 5:51 p.m. OK GNU C++17 TESTS 45 2386 76185600 2800
240623366 ShirayukiNoa F2 Jan. 6, 2024, 10:57 p.m. OK GNU C++17 TESTS 46 4055 45670400 2800
240595515 MonkeyKing F2 Jan. 6, 2024, 4:59 p.m. OK GNU C++17 TESTS 45 4289 79257600 2800
240618545 glebustim F2 Jan. 6, 2024, 9:01 p.m. OK GNU C++17 (64) TESTS 46 1045 45670400 2800
240607967 yoav_s F2 Jan. 6, 2024, 6:42 p.m. OK GNU C++17 (64) TESTS 46 1076 45670400 2800
240605601 hitonanode F2 Jan. 6, 2024, 6:19 p.m. OK GNU C++17 (64) TESTS 46 1107 78131200 2800
240592542 drdilyor F2 Jan. 6, 2024, 4:51 p.m. OK GNU C++17 (64) TESTS 45 1154 45670400 2800
240600714 nicksms F2 Jan. 6, 2024, 5:51 p.m. OK GNU C++17 (64) TESTS 45 1185 54067200 2800
240595632 chinerist F2 Jan. 6, 2024, 4:59 p.m. OK GNU C++17 (64) TESTS 45 1200 74137600 2800
240630589 chappy1 F2 Jan. 7, 2024, 2:34 a.m. OK GNU C++17 (64) TESTS 46 1216 41676800 2800
240604762 Karuna F2 Jan. 6, 2024, 6:13 p.m. OK GNU C++17 (64) TESTS 46 1232 93081600 2800
240594887 KKT_89 F2 Jan. 6, 2024, 4:57 p.m. OK GNU C++17 (64) TESTS 45 1247 44134400 2800
240620481 KaguyaH F2 Jan. 6, 2024, 9:38 p.m. OK GNU C++17 (64) TESTS 46 1248 45670400 2800
240615738 the_hyp0cr1t3 F2 Jan. 6, 2024, 8:17 p.m. OK GNU C++20 (64) TESTS 46 795 52121600 2800
240600658 ghoul932 F2 Jan. 6, 2024, 5:51 p.m. OK GNU C++20 (64) TESTS 45 841 45670400 2800
240591563 orz F2 Jan. 6, 2024, 4:48 p.m. OK GNU C++20 (64) TESTS 45 841 74956800 2800
240614749 MattTheNub F2 Jan. 6, 2024, 8:04 p.m. OK GNU C++20 (64) TESTS 46 842 44134400 2800
240600653 EJIC_B_KEDAX F2 Jan. 6, 2024, 5:51 p.m. OK GNU C++20 (64) TESTS 45 842 49664000 2800
240606800 neal F2 Jan. 6, 2024, 6:30 p.m. OK GNU C++20 (64) TESTS 46 857 65740800 2800
240607611 Sparkle_Twilight F2 Jan. 6, 2024, 6:38 p.m. OK GNU C++20 (64) TESTS 46 858 65740800 2800
240617349 physics0523 F2 Jan. 6, 2024, 8:40 p.m. OK GNU C++20 (64) TESTS 46 872 61747200 2800
240625105 arknave F2 Jan. 6, 2024, 11:52 p.m. OK GNU C++20 (64) TESTS 46 873 44134400 2800
240592164 tute7627 F2 Jan. 6, 2024, 4:50 p.m. OK GNU C++20 (64) TESTS 45 888 45670400 2800
240610964 DarLam F2 Jan. 6, 2024, 7:14 p.m. OK Java 11 TESTS 46 2386 137932800 2800
240591711 knightL F2 Jan. 6, 2024, 4:48 p.m. OK Java 17 TESTS 45 1638 86732800 2800
240600814 Spheniscine F2 Jan. 6, 2024, 5:51 p.m. OK Rust 2021 TESTS 45 1450 58265600 2800

remove filters

Back to search problems