Codeforces Round 849 (Div. 4)

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
1791 Codeforces Round 849 (Div. 4) FINISHED False 8700 56388299 Feb. 3, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 29071 ) E Negatives and Positives PROGRAMMING greedy sortings

B'Given an array a consisting of n elements, find the maximum possible sum the array can have after performing the following operation any number of times: The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The descriptions of the test cases follow. The first line of each test case contains an integer n ( 2 <= q n <= q 2 cdot10^5 ) -- the length of the array. The following line contains n space-separated integers a_1,a_2, ... ,a_n ( -10^9 <= q a_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot10^5 . For each test case, output the maximum possible sum the array can have after performing the described operation any number of times. For the first test case, by performing the operation on the first two elements, we can change the array from [-1, -1, -1] to [1, 1, -1] , and it can be proven this array obtains the maximum possible sum which is 1 + 1 + (-1) = 1 . For the second test case, by performing the operation on -5 and 0 , we change the array from [1, 5, -5, 0, 2] to [1, 5, -(-5), -0, 2] = [1, 5, 5, 0, 2] , which has the maximum sum since all elements are non-negative. So, the answer is 1 + 5 + 5 + 0 + 2 = 13 . For the third test case, the array already contains only positive numbers, so performing operations is unnecessary. The answer is just the sum of the whole array, which is 1 + 2 + 3 = 6 . '...

Tutorials

112282

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
192057297 joaoandreotti E Feb. 3, 2023, 6:41 p.m. OK C# 10 TESTS 9 78 24985600
192083456 Smallorange E Feb. 4, 2023, 12:50 a.m. OK GNU C11 TESTS 9 46 4403200
192094698 MooNaz E Feb. 4, 2023, 4:12 a.m. OK GNU C11 TESTS 9 61 5324800
192064993 C223056_farhad E Feb. 3, 2023, 7:46 p.m. OK GNU C11 TESTS 9 62 4403200
192102504 O.M.69 E Feb. 4, 2023, 5:41 a.m. OK GNU C11 TESTS 9 62 5324800
192093427 HeapUser.He E Feb. 4, 2023, 3:52 a.m. OK GNU C11 TESTS 9 93 4505600
192082796 UnderTides E Feb. 4, 2023, 12:33 a.m. OK GNU C++14 TESTS 9 61 1024000
192098000 Tanishq_21 E Feb. 4, 2023, 4:56 a.m. OK GNU C++14 TESTS 9 61 1843200
192071188 Bojji_Kage E Feb. 3, 2023, 8:53 p.m. OK GNU C++14 TESTS 9 61 5222400
192085845 LJB00126 E Feb. 4, 2023, 1:44 a.m. OK GNU C++14 TESTS 9 62 1024000
192083407 rozan_nich E Feb. 4, 2023, 12:49 a.m. OK GNU C++14 TESTS 9 62 1024000
192064241 vipul_singh E Feb. 3, 2023, 7:39 p.m. OK GNU C++14 TESTS 9 62 1228800
192051037 Rock_king E Feb. 3, 2023, 5:59 p.m. OK GNU C++14 TESTS 9 62 1740800
192063927 kyu_12 E Feb. 3, 2023, 7:36 p.m. OK GNU C++14 TESTS 9 62 1740800
192077339 Rawan_Almashad E Feb. 3, 2023, 10:24 p.m. OK GNU C++14 TESTS 9 62 1740800
192102139 aandrike E Feb. 4, 2023, 5:38 a.m. OK GNU C++14 TESTS 9 62 1843200
192058836 nimaiparsa E Feb. 3, 2023, 6:52 p.m. OK GNU C++17 TESTS 9 46 1536000
192054053 Clover_plus E Feb. 3, 2023, 6:18 p.m. OK GNU C++17 TESTS 9 46 1843200
192056494 AndrewEzzat E Feb. 3, 2023, 6:35 p.m. OK GNU C++17 TESTS 9 46 4403200
192055138 Omar_Hamdon E Feb. 3, 2023, 6:25 p.m. OK GNU C++17 TESTS 9 46 9113600
192061548 odyssey1 E Feb. 3, 2023, 7:15 p.m. OK GNU C++17 TESTS 9 61 1024000
192099889 y_combinator E Feb. 4, 2023, 5:17 a.m. OK GNU C++17 TESTS 9 61 1843200
192063334 AshrafMaged22 E Feb. 3, 2023, 7:31 p.m. OK GNU C++17 TESTS 9 61 1843200
192058243 LazyBong104 E Feb. 3, 2023, 6:48 p.m. OK GNU C++17 TESTS 9 61 1843200
192078631 Mikey_03 E Feb. 3, 2023, 10:48 p.m. OK GNU C++17 TESTS 9 61 2764800
192059931 Arvind_Goku E Feb. 3, 2023, 7:01 p.m. OK GNU C++17 TESTS 9 61 14745600
192068003 habibaazab E Feb. 3, 2023, 8:16 p.m. OK GNU C++17 (64) TESTS 9 31 2867200
192077324 oneninetyfive E Feb. 3, 2023, 10:23 p.m. OK GNU C++17 (64) TESTS 9 31 15155200
192049101 Talk_Sick E Feb. 3, 2023, 5:47 p.m. OK GNU C++17 (64) TESTS 9 46 1228800
192090276 Nikhitha_ReddyMale E Feb. 4, 2023, 2:58 a.m. OK GNU C++17 (64) TESTS 9 46 1228800
192080019 jdurie E Feb. 3, 2023, 11:18 p.m. OK GNU C++17 (64) TESTS 9 46 1228800
192100531 yiyiyize E Feb. 4, 2023, 5:23 a.m. OK GNU C++17 (64) TESTS 9 46 1228800
192104364 fa_555 E Feb. 4, 2023, 5:58 a.m. OK GNU C++17 (64) TESTS 9 46 1228800
192090847 xiaoYun_succ E Feb. 4, 2023, 3:08 a.m. OK GNU C++17 (64) TESTS 9 46 1228800
192057358 MUHAMMAD_AHMED E Feb. 3, 2023, 6:41 p.m. OK GNU C++17 (64) TESTS 9 46 1740800
192051308 alexok2006 E Feb. 3, 2023, 6 p.m. OK GNU C++17 (64) TESTS 9 46 1945600
192066487 Youssef_Else7y E Feb. 3, 2023, 8:01 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192065320 Kornelius E Feb. 3, 2023, 7:49 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192061402 _OmarAbdo E Feb. 3, 2023, 7:14 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192059373 A_xor_A E Feb. 3, 2023, 6:57 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192049595 Zadymiarz1234 E Feb. 3, 2023, 5:50 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192073053 ma7ameee7o0o E Feb. 3, 2023, 9:17 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192081272 zzz27 E Feb. 3, 2023, 11:53 p.m. OK GNU C++20 (64) TESTS 9 31 1228800
192089849 thisislike E Feb. 4, 2023, 2:52 a.m. OK GNU C++20 (64) TESTS 9 31 1228800
192103107 phanquangminh070707 E Feb. 4, 2023, 5:47 a.m. OK GNU C++20 (64) TESTS 9 31 1228800
192104727 zqyzqyzqy E Feb. 4, 2023, 6:01 a.m. OK GNU C++20 (64) TESTS 9 31 1228800
192089516 july_tang E Feb. 4, 2023, 2:47 a.m. OK Go TESTS 9 62 23142400
192087350 peng-zhang E Feb. 4, 2023, 2:13 a.m. OK Go TESTS 9 140 23142400
192079561 meinego E Feb. 3, 2023, 11:09 p.m. OK Go TESTS 9 140 23142400
192055711 dimaglushkov E Feb. 3, 2023, 6:29 p.m. OK Go TESTS 9 140 23244800
192096089 Prime369 E Feb. 4, 2023, 4:32 a.m. OK Java 11 TESTS 9 218 25190400
192097750 vikasmanohar.1995 E Feb. 4, 2023, 4:53 a.m. OK Java 11 TESTS 9 233 25497600
192053748 KhadijaBadrawy E Feb. 3, 2023, 6:16 p.m. OK Java 11 TESTS 9 249 34713600
192088326 aamir_1102 E Feb. 4, 2023, 2:28 a.m. OK Java 11 TESTS 9 264 25497600
192071756 adarsh_code_01 E Feb. 3, 2023, 9 p.m. OK Java 11 TESTS 9 280 25702400
192071479 adarsh_code_01 E Feb. 3, 2023, 8:57 p.m. OK Java 11 TESTS 9 280 28467200
192052978 Hawater E Feb. 3, 2023, 6:11 p.m. OK Java 11 TESTS 9 280 31027200
192070759 vijaypanwar_12 E Feb. 3, 2023, 8:48 p.m. OK Java 11 TESTS 9 452 25292800
192085674 ramm2413 E Feb. 4, 2023, 1:41 a.m. OK Java 11 TESTS 9 452 25395200
192092547 Aseque E Feb. 4, 2023, 3:37 a.m. OK Java 11 TESTS 9 467 25395200
192085039 Changersh E Feb. 4, 2023, 1:27 a.m. OK Java 17 TESTS 9 233 40448000
192092664 sauravmandal E Feb. 4, 2023, 3:39 a.m. OK Java 17 TESTS 9 234 40345600
192075745 TheRedBacon E Feb. 3, 2023, 9:56 p.m. OK Java 17 TESTS 9 248 57446400
192098678 anikethend1234 E Feb. 4, 2023, 5:04 a.m. OK Java 17 TESTS 9 264 40448000
192088689 burning_summer E Feb. 4, 2023, 2:34 a.m. OK Java 17 TESTS 9 264 40550400
192068602 HashBob E Feb. 3, 2023, 8:23 p.m. OK Java 17 TESTS 9 265 41164800
192065630 Mamimi E Feb. 3, 2023, 7:52 p.m. OK Java 17 TESTS 9 265 49561600
192071800 Yousef_Badr E Feb. 3, 2023, 9:01 p.m. OK Java 17 TESTS 9 280 40448000
192100492 Mustela_Erminea E Feb. 4, 2023, 5:23 a.m. OK Java 17 TESTS 9 280 40960000
192090452 Jatinydv17 E Feb. 4, 2023, 3:02 a.m. OK Java 17 TESTS 9 280 41267200
192099891 999ms_Clutch E Feb. 4, 2023, 5:17 a.m. OK Java 8 TESTS 9 139 19353600
192050091 raj_shahh E Feb. 3, 2023, 5:53 p.m. OK Java 8 TESTS 9 140 19251200
192061292 UniversalAdmin E Feb. 3, 2023, 7:13 p.m. OK Java 8 TESTS 9 155 23449600
192090478 Jtnydv E Feb. 4, 2023, 3:02 a.m. OK Java 8 TESTS 9 187 24473600
192099775 -crazy_coder- E Feb. 4, 2023, 5:16 a.m. OK Java 8 TESTS 9 218 40243200
192060853 Dake04 E Feb. 3, 2023, 7:09 p.m. OK Java 8 TESTS 9 389 19660800
192088279 PrElude1201 E Feb. 4, 2023, 2:28 a.m. OK Java 8 TESTS 9 390 19660800
192076339 sam02202001 E Feb. 3, 2023, 10:05 p.m. OK Java 8 TESTS 9 405 19660800
192086045 Prasad.Naidu_9 E Feb. 4, 2023, 1:47 a.m. OK Java 8 TESTS 9 405 19763200
192064784 codehunter_ E Feb. 3, 2023, 7:44 p.m. OK Java 8 TESTS 9 420 19660800
192074701 Dimer15 E Feb. 3, 2023, 9:40 p.m. OK Kotlin 1.6 TESTS 9 296 38604800
192088038 linxiaotian E Feb. 4, 2023, 2:24 a.m. OK Kotlin 1.6 TESTS 9 358 39219200
192101983 eneskayiklik E Feb. 4, 2023, 5:36 a.m. OK Kotlin 1.7 TESTS 9 280 96972800
192059764 Dr_CodeX E Feb. 3, 2023, 7 p.m. OK MS C++ 2017 TESTS 9 202 2764800
192058691 1_shivam E Feb. 3, 2023, 6:51 p.m. OK MS C++ 2017 TESTS 9 218 1945600
192050081 SnakeInGryffindor E Feb. 3, 2023, 5:53 p.m. OK MS C++ 2017 TESTS 9 218 3379200
192096553 Yash_Nandwana E Feb. 4, 2023, 4:38 a.m. OK PyPy 3 TESTS 9 186 36454400
192104942 bvf E Feb. 4, 2023, 6:02 a.m. OK PyPy 3 TESTS 9 202 35737600
192070704 Mansurbek E Feb. 3, 2023, 8:47 p.m. OK PyPy 3 TESTS 9 343 27955200
192061095 zx4r E Feb. 3, 2023, 7:11 p.m. OK PyPy 3 TESTS 9 358 35225600
192059623 Mohamed_Hamed E Feb. 3, 2023, 6:59 p.m. OK PyPy 3 TESTS 9 373 26931200
192101712 YouMust E Feb. 4, 2023, 5:34 a.m. OK PyPy 3 TESTS 9 373 35123200
192098621 JUBHAI E Feb. 4, 2023, 5:04 a.m. OK PyPy 3 TESTS 9 374 35225600
192061368 mega_bot E Feb. 3, 2023, 7:14 p.m. OK PyPy 3 TESTS 9 390 37683200
192074236 WalrusRamen21 E Feb. 3, 2023, 9:33 p.m. OK PyPy 3 TESTS 9 421 37273600
192085886 InariInDream E Feb. 4, 2023, 1:45 a.m. OK PyPy 3-64 TESTS 9 109 54169600
192079724 iinaamasum E Feb. 3, 2023, 11:12 p.m. OK PyPy 3-64 TESTS 9 109 57241600
192085844 udayan8 E Feb. 4, 2023, 1:44 a.m. OK PyPy 3-64 TESTS 9 109 57856000
192075132 jan_sam_jan E Feb. 3, 2023, 9:46 p.m. OK PyPy 3-64 TESTS 9 124 54476800
192089072 zjcccc E Feb. 4, 2023, 2:40 a.m. OK PyPy 3-64 TESTS 9 124 54886400
192100040 anshumannandan E Feb. 4, 2023, 5:19 a.m. OK PyPy 3-64 TESTS 9 124 55398400
192090824 liuaaa E Feb. 4, 2023, 3:08 a.m. OK PyPy 3-64 TESTS 9 124 55603200
192085618 hvbird E Feb. 4, 2023, 1:40 a.m. OK PyPy 3-64 TESTS 9 124 55910400
192074559 slickk E Feb. 3, 2023, 9:38 p.m. OK PyPy 3-64 TESTS 9 140 61644800
192071784 shawongazi742 E Feb. 3, 2023, 9 p.m. OK PyPy 3-64 TESTS 9 156 44646400
192059061 eugalt E Feb. 3, 2023, 6:54 p.m. OK Python 3 TESTS 9 124 22220800
192066240 hudai222 E Feb. 3, 2023, 7:58 p.m. OK Python 3 TESTS 9 140 15769600
192055559 vyingvictor98 E Feb. 3, 2023, 6:28 p.m. OK Python 3 TESTS 9 140 19353600
192071973 shawongazi742 E Feb. 3, 2023, 9:03 p.m. OK Python 3 TESTS 9 155 16281600
192054444 gaaddii_at_code_force E Feb. 3, 2023, 6:21 p.m. OK Python 3 TESTS 9 155 21401600
192071095 Typhoons E Feb. 3, 2023, 8:52 p.m. OK Python 3 TESTS 9 156 19251200
192051586 Mohamed_Yousef_2024 E Feb. 3, 2023, 6:02 p.m. OK Python 3 TESTS 9 156 20172800
192101437 tariq05 E Feb. 4, 2023, 5:32 a.m. OK Python 3 TESTS 9 156 20377600
192052962 Komal69 E Feb. 3, 2023, 6:11 p.m. OK Python 3 TESTS 9 171 19763200
192071208 DonC E Feb. 3, 2023, 8:53 p.m. OK Python 3 TESTS 9 171 20172800
192067367 franv E Feb. 3, 2023, 8:10 p.m. OK Rust 2021 TESTS 9 15 9011200
192066819 Bore_lis E Feb. 3, 2023, 8:04 p.m. OK Rust 2021 TESTS 9 30 7987200
192066846 uvarovrs40 E Feb. 3, 2023, 8:04 p.m. OK Rust 2021 TESTS 9 31 7475200
192081896 vjudge4 E Feb. 4, 2023, 12:09 a.m. OK Rust 2021 TESTS 9 31 16896000
192082222 vjudge2 E Feb. 4, 2023, 12:18 a.m. OK Rust 2021 TESTS 9 46 17920000

remove filters

Back to search problems