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 81636863 June 19, 2022, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11152 ) C Helping the Nature PROGRAMMING constructive algorithms greedy 1700

B"Little Leon lives in the forest. He has recently noticed that some trees near his favourite path are withering, while the other ones are overhydrated so he decided to learn how to control the level of the soil moisture to save the trees. There are n trees growing near the path, the current levels of moisture of each tree are denoted by the array a_1, a_2, ... , a_n . Leon has learned three abilities which will help him to dry and water the soil. Leon wants to know the minimum number of actions he needs to perform to make the moisture of each tree equal to 0 . The first line contains a single integer t ( 1 <= t <= 2 cdot 10^4 ) -- the number of test cases. The description of t test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 200 ,000 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( -10^9 <= q a_i <= q 10^9 ) -- the initial levels of trees moisture. It is guaranteed that the sum of n over all test cases doesn't exceed 200 ,000 . For each test case output a single integer -- the minimum number of actions. It can be shown that the answer exists. In the first test case it's enough to apply the operation of adding 1 to the whole array 2 times. In the second test case you can apply the operation of decreasing 4 times on the prefix of length 3 and get an array 6, 0, 3 . After that apply the operation of decreasing 6 times on the prefix of length 1 and 3 times on the suffix of length 1 . In total, the number of actions will be 4 + 6 + 3 = 13 . It can be shown that it's impossible to perform less actions to get the required array, so the answer is 13 . "...

Tutorials

103978

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
161214952 abhishek_890 C June 19, 2022, 11:03 a.m. OK FPC TESTS 27 77 1638400 1700
161209917 bored_kid C June 19, 2022, 10:47 a.m. OK FPC TESTS 27 77 1638400 1700
161209076 Asv1411 C June 19, 2022, 10:43 a.m. OK FPC TESTS 27 77 1638400 1700
161215138 Noob_coder_042003 C June 19, 2022, 11:03 a.m. OK FPC TESTS 27 78 1638400 1700
161213261 adityasoni_19 C June 19, 2022, 10:58 a.m. OK FPC TESTS 27 109 1638400 1700
161211443 Katkota C June 19, 2022, 10:52 a.m. OK FPC TESTS 27 109 1638400 1700
161209955 mayukhbis C June 19, 2022, 10:47 a.m. OK FPC TESTS 27 109 1638400 1700
161225348 Alenygam C June 19, 2022, 12:40 p.m. OK GNU C11 TESTS 27 93 819200 1700
161232956 1435730 C June 19, 2022, 2:11 p.m. OK GNU C11 TESTS 27 93 1638400 1700
161210930 Withers_ C June 19, 2022, 10:50 a.m. OK GNU C++14 TESTS 27 30 5427200 1700
161260437 blackcoffee C June 19, 2022, 10:36 p.m. OK GNU C++14 TESTS 27 31 819200 1700
161219614 Illusory_dimes C June 19, 2022, 11:42 a.m. OK GNU C++14 TESTS 27 31 3481600 1700
161221037 Scaramouche C June 19, 2022, 11:53 a.m. OK GNU C++14 TESTS 27 31 28262400 1700
161230880 whitesirwang C June 19, 2022, 1:44 p.m. OK GNU C++14 TESTS 27 46 1228800 1700
161230789 whitesirwang C June 19, 2022, 1:42 p.m. OK GNU C++14 TESTS 27 61 1228800 1700
161214577 kingvarun C June 19, 2022, 11:02 a.m. OK GNU C++14 TESTS 27 61 1638400 1700
161223230 shivam_751 C June 19, 2022, 12:16 p.m. OK GNU C++14 TESTS 27 61 1638400 1700
161219344 Akshay1323 C June 19, 2022, 11:40 a.m. OK GNU C++14 TESTS 27 61 2355200 1700
161261374 MahmoudSerag C June 19, 2022, 11:30 p.m. OK GNU C++14 TESTS 27 62 819200 1700
161237969 Bobocan C June 19, 2022, 3:25 p.m. OK GNU C++17 TESTS 27 15 819200 1700
161236394 Bobocan C June 19, 2022, 2:56 p.m. OK GNU C++17 TESTS 27 15 2355200 1700
161238115 Liberty_gsm C June 19, 2022, 3:28 p.m. OK GNU C++17 TESTS 27 46 819200 1700
161226143 ash_98 C June 19, 2022, 12:48 p.m. OK GNU C++17 TESTS 27 46 1024000 1700
161229299 Hush C June 19, 2022, 1:25 p.m. OK GNU C++17 TESTS 27 46 1536000 1700
161240400 rohit9300gupta C June 19, 2022, 4:01 p.m. OK GNU C++17 TESTS 27 46 1638400 1700
161266676 s39202972 C June 20, 2022, 2:49 a.m. OK GNU C++17 TESTS 27 46 2457600 1700
161273083 lniiwuw_y C June 20, 2022, 5:30 a.m. OK GNU C++17 TESTS 27 61 819200 1700
161260382 Marckess C June 19, 2022, 10:34 p.m. OK GNU C++17 TESTS 27 61 819200 1700
161234580 Madhunter C June 19, 2022, 2:33 p.m. OK GNU C++17 TESTS 27 61 819200 1700
161219197 zycac C June 19, 2022, 11:39 a.m. OK GNU C++17 (64) TESTS 27 31 819200 1700
161272541 sanchay_ C June 20, 2022, 5:19 a.m. OK GNU C++17 (64) TESTS 27 31 1638400 1700
161252606 introvert_hu_bhai C June 19, 2022, 7:01 p.m. OK GNU C++17 (64) TESTS 27 31 1638400 1700
161250932 OnMyZenith C June 19, 2022, 6:31 p.m. OK GNU C++17 (64) TESTS 27 31 1638400 1700
161216838 Amank2854 C June 19, 2022, 11:23 a.m. OK GNU C++17 (64) TESTS 27 31 1638400 1700
161231595 IkshitG C June 19, 2022, 1:53 p.m. OK GNU C++17 (64) TESTS 27 31 3174400 1700
161227794 clinging C June 19, 2022, 1:07 p.m. OK GNU C++17 (64) TESTS 27 31 3174400 1700
161266130 Steins__Gate C June 20, 2022, 2:41 a.m. OK GNU C++17 (64) TESTS 27 31 3174400 1700
161258654 kal013 C June 19, 2022, 9:25 p.m. OK GNU C++17 (64) TESTS 27 31 4812800 1700
161264124 Gggggle C June 20, 2022, 1:38 a.m. OK GNU C++17 (64) TESTS 27 46 819200 1700
161210920 A_king C June 19, 2022, 10:50 a.m. OK GNU C++20 (64) TESTS 27 30 3174400 1700
161234546 ramakp34 C June 19, 2022, 2:32 p.m. OK GNU C++20 (64) TESTS 27 31 0 1700
161247262 molney C June 19, 2022, 5:38 p.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161271996 Thomas_Top C June 20, 2022, 5:08 a.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161269148 meiron03 C June 20, 2022, 3:56 a.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161262876 ginwAa C June 20, 2022, 12:49 a.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161231949 Bakry C June 19, 2022, 1:57 p.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161229823 HONG-LOU C June 19, 2022, 1:30 p.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161228855 Bananana. C June 19, 2022, 1:19 p.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161221421 decoder_aniket C June 19, 2022, 11:57 a.m. OK GNU C++20 (64) TESTS 27 31 819200 1700
161248679 koqo C June 19, 2022, 5:57 p.m. OK Go TESTS 27 156 4300800 1700
161259305 Longgggggggg C June 19, 2022, 9:47 p.m. OK Java 11 TESTS 27 171 0 1700
161215704 S-A-I-T-A-M-A C June 19, 2022, 11:04 a.m. OK Java 11 TESTS 27 187 0 1700
161267897 thisusernamehasbeentaken C June 20, 2022, 3:23 a.m. OK Java 11 TESTS 27 202 0 1700
161225579 yuruiyin C June 19, 2022, 12:42 p.m. OK Java 11 TESTS 27 202 204800 1700
161240287 soumit915 C June 19, 2022, 3:59 p.m. OK Java 11 TESTS 27 217 0 1700
161225517 yuruiyin C June 19, 2022, 12:41 p.m. OK Java 11 TESTS 27 217 307200 1700
161256753 salanger C June 19, 2022, 8:33 p.m. OK Java 11 TESTS 27 218 0 1700
161231794 _ryan18_ C June 19, 2022, 1:56 p.m. OK Java 11 TESTS 27 218 0 1700
161225659 yuruiyin C June 19, 2022, 12:43 p.m. OK Java 11 TESTS 27 218 307200 1700
161247215 OhLee C June 19, 2022, 5:37 p.m. OK Java 11 TESTS 27 233 0 1700
161211646 adi_7861 C June 19, 2022, 10:53 a.m. OK Java 8 TESTS 27 140 2457600 1700
161251237 vaibhav_1710 C June 19, 2022, 6:36 p.m. OK Java 8 TESTS 27 140 2969600 1700
161262299 AhmadEyad C June 20, 2022, 12:22 a.m. OK Java 8 TESTS 27 140 3072000 1700
161253120 leonlian C June 19, 2022, 7:13 p.m. OK Java 8 TESTS 27 155 2662400 1700
161260654 ahmedtawfik C June 19, 2022, 10:48 p.m. OK Java 8 TESTS 27 171 4300800 1700
161216483 csdn-zhigeng C June 19, 2022, 11:22 a.m. OK Java 8 TESTS 27 187 18227200 1700
161220316 Admin07 C June 19, 2022, 11:47 a.m. OK Java 8 TESTS 27 202 18432000 1700
161231501 faild-in-2021 C June 19, 2022, 1:52 p.m. OK Java 8 TESTS 27 217 0 1700
161222055 Dhananjay22 C June 19, 2022, 12:03 p.m. OK Java 8 TESTS 27 217 2969600 1700
161218168 ikillmyself C June 19, 2022, 11:31 a.m. OK Java 8 TESTS 27 233 0 1700
161219141 nicnic4102 C June 19, 2022, 11:38 a.m. OK Kotlin 1.5 TESTS 27 374 17203200 1700
161241364 Nizomidin C June 19, 2022, 4:13 p.m. OK Kotlin 1.6 TESTS 27 343 17100800 1700
161216814 return_myself C June 19, 2022, 11:23 a.m. OK MS C++ 2017 TESTS 27 187 16076800 1700
161269258 MoonWithoutTheStars C June 20, 2022, 3:59 a.m. OK MS C++ 2017 TESTS 27 202 1638400 1700
161239037 XYShaoKang C June 19, 2022, 3:43 p.m. OK Node.js TESTS 27 623 50278400 1700
161212247 anuragr135 C June 19, 2022, 10:55 a.m. OK PascalABC.NET TESTS 27 717 1843200 1700
161225046 yoralbayev C June 19, 2022, 12:36 p.m. OK PHP TESTS 27 1091 18329600 1700
161216810 Usurper__ C June 19, 2022, 11:23 a.m. OK PyPy 3 TESTS 27 202 20787200 1700
161217705 ambs_ C June 19, 2022, 11:28 a.m. OK PyPy 3 TESTS 27 295 19456000 1700
161256380 voicon C June 19, 2022, 8:24 p.m. OK PyPy 3 TESTS 27 296 17510400 1700
161216987 abhijeet.panihar.cse20 C June 19, 2022, 11:24 a.m. OK PyPy 3 TESTS 27 326 32256000 1700
161212734 dhyang24 C June 19, 2022, 10:56 a.m. OK PyPy 3 TESTS 27 389 21606400 1700
161250909 raideva C June 19, 2022, 6:31 p.m. OK PyPy 3 TESTS 27 436 21299200 1700
161270143 Ayushman_123 C June 20, 2022, 4:23 a.m. OK PyPy 3 TESTS 27 452 28262400 1700
161214332 techie_s C June 19, 2022, 11:01 a.m. OK PyPy 3 TESTS 27 576 19251200 1700
161210570 C_M_D_O_ C June 19, 2022, 10:49 a.m. OK PyPy 3 TESTS 27 592 17510400 1700
161271498 Mohammad_Miraz C June 20, 2022, 4:56 a.m. OK PyPy 3 TESTS 27 592 19251200 1700
161261988 hkwu6013 C June 20, 2022, 12:06 a.m. OK PyPy 3-64 TESTS 27 124 26828800 1700
161267981 nicku123 C June 20, 2022, 3:26 a.m. OK PyPy 3-64 TESTS 27 139 28672000 1700
161212120 Adroit_001 C June 19, 2022, 10:54 a.m. OK PyPy 3-64 TESTS 27 140 29388800 1700
161246600 iska_terminator C June 19, 2022, 5:28 p.m. OK PyPy 3-64 TESTS 27 155 31641600 1700
161262346 mathdude42 C June 20, 2022, 12:25 a.m. OK PyPy 3-64 TESTS 27 156 27648000 1700
161235327 Aksnov C June 19, 2022, 2:43 p.m. OK PyPy 3-64 TESTS 27 186 29798400 1700
161213274 oadey89 C June 19, 2022, 10:58 a.m. OK PyPy 3-64 TESTS 27 202 30412800 1700
161216944 SophieHatter C June 19, 2022, 11:24 a.m. OK PyPy 3-64 TESTS 27 217 34611200 1700
161258380 PMiguelez C June 19, 2022, 9:17 p.m. OK PyPy 3-64 TESTS 27 233 22323200 1700
161242651 aayush_chhabra C June 19, 2022, 4:31 p.m. OK PyPy 3-64 TESTS 27 233 22323200 1700
161213417 DaRk_hEaRt_ C June 19, 2022, 10:59 a.m. OK Python 3 TESTS 27 187 16896000 1700
161215462 Cyborg9303 C June 19, 2022, 11:04 a.m. OK Python 3 TESTS 27 202 16793600 1700
161238160 lullabies777 C June 19, 2022, 3:29 p.m. OK Python 3 TESTS 27 249 16179200 1700
161217219 udayJan C June 19, 2022, 11:25 a.m. OK Python 3 TESTS 27 249 16179200 1700
161273487 Dinesh_devanaboina C June 20, 2022, 5:37 a.m. OK Python 3 TESTS 27 280 16179200 1700
161271506 Mohammad_Miraz C June 20, 2022, 4:56 a.m. OK Python 3 TESTS 27 280 16179200 1700
161221875 fhhuo C June 19, 2022, 12:01 p.m. OK Python 3 TESTS 27 280 16179200 1700
161211831 tanishqagarwal987 C June 19, 2022, 10:53 a.m. OK Python 3 TESTS 27 280 16179200 1700
161210599 AzazKamaz C June 19, 2022, 10:49 a.m. OK Python 3 TESTS 27 280 16179200 1700
161272633 Muhammad.Junaid.Faheem C June 20, 2022, 5:21 a.m. OK Python 3 TESTS 27 295 16179200 1700
161249114 Thallium54 C June 19, 2022, 6:04 p.m. OK Rust 2021 TESTS 27 31 4710400 1700
161217533 0npata C June 19, 2022, 11:27 a.m. OK Rust 2021 TESTS 27 31 7884800 1700
161272485 mflimf C June 20, 2022, 5:18 a.m. OK Rust 2021 TESTS 27 186 4710400 1700

remove filters

Back to search problems