Codeforces Round 832 (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
1747 Codeforces Round 832 (Div. 2) FINISHED False 7200 69693863 Nov. 4, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 25237 ) A Two Groups PROGRAMMING constructive algorithms greedy

B'You are given an array a consisting of n integers. You want to distribute these n integers into two groups s_1 and s_2 (groups can be empty) so that the following conditions are satisfied: Here sum(s_1) denotes the sum of the numbers in the group s_1 , and sum(s_2) denotes the sum of the numbers in the group s_2 . Determine the maximum possible value of |sum(s_1)| - |sum(s_2)| . The input consists of multiple test cases. The first line contains a single integer t (1 <= q t <= q 2 cdot 10^4) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n (1 <= q n <= q 10^5) -- the length of the array a . 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) -- elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the maximum possible value of |sum(s_1)| - |sum(s_2)| . In the first testcase, we can distribute as s_1 = {10 } , s_2 = {-10 } . Then the value will be |10| - |-10| = 0 . In the second testcase, we can distribute as s_1 = {0, 11, -1 } , s_2 = {-2 } . Then the value will be |0 + 11 - 1| - |-2| = 10 - 2 = 8 . In the third testcase, we can distribute as s_1 = {2, 3, 2 } , s_2 = { } . Then the value will be |2 + 3 + 2| - |0| = 7 . In the fourth testcase, we can distribute as s_1 = {-9, -4, 0 } , s_2 = {2, 0 } . Then the value will be |-9 - 4 + 0| - |2 + 0| = 13 - 2 = 11 . '...

Tutorials

Codeforces Round #832 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
179368252 absa1am A Nov. 5, 2022, 5:42 a.m. OK C# 10 TESTS 9 155 17715200
179339586 chrisfcoder A Nov. 5, 2022, 2:28 a.m. OK C# 10 TESTS 9 155 19353600
179344824 bluemegane A Nov. 5, 2022, 3:54 a.m. OK C# 8 TESTS 9 202 20172800
179345775 bluemegane A Nov. 5, 2022, 4:08 a.m. OK C# 8 TESTS 9 249 20070400
179342578 55open A Nov. 5, 2022, 3:18 a.m. OK Clang++17 Diagnostics TESTS 9 93 0
179341545 FlyingFeather A Nov. 5, 2022, 3 a.m. OK Clang++20 Diagnostics TESTS 9 93 0
179293662 alexander99 A Nov. 4, 2022, 5:36 p.m. OK Delphi TESTS 8 62 1228800
179316623 khalid9029 A Nov. 4, 2022, 7:40 p.m. OK GNU C11 TESTS 8 93 0
179284555 abhisheknimmala A Nov. 4, 2022, 4:34 p.m. OK GNU C11 TESTS 8 93 0
179307696 aragorn_arc A Nov. 4, 2022, 6:51 p.m. OK GNU C11 TESTS 8 93 0
179292757 Jahidul_CSE A Nov. 4, 2022, 5:32 p.m. OK GNU C11 TESTS 8 93 819200
179303200 Hantur A Nov. 4, 2022, 6:26 p.m. OK GNU C11 TESTS 8 109 0
179322314 SAFIN07 A Nov. 4, 2022, 8:24 p.m. OK GNU C11 TESTS 8 109 0
179283523 Amaris_L A Nov. 4, 2022, 4:32 p.m. OK GNU C11 TESTS 8 109 0
179292092 Jahidul_CSE A Nov. 4, 2022, 5:29 p.m. OK GNU C11 TESTS 8 109 819200
179289730 Lastxuan_ A Nov. 4, 2022, 5:19 p.m. OK GNU C11 TESTS 8 109 819200
179370500 shuva_dev A Nov. 5, 2022, 5:48 a.m. OK GNU C11 TESTS 9 124 0
179279810 joker-x A Nov. 4, 2022, 4:24 p.m. OK GNU C++14 TESTS 8 46 819200
179341350 Summer_Water A Nov. 5, 2022, 2:57 a.m. OK GNU C++14 TESTS 9 61 0
179292968 koushik_ A Nov. 4, 2022, 5:32 p.m. OK GNU C++14 TESTS 8 61 819200
179301930 Theredemptionv3 A Nov. 4, 2022, 6:19 p.m. OK GNU C++14 TESTS 8 61 1228800
179343273 fhhuo A Nov. 5, 2022, 3:29 a.m. OK GNU C++14 TESTS 9 62 0
179340004 meimingzi1 A Nov. 5, 2022, 2:35 a.m. OK GNU C++14 TESTS 9 62 0
179341916 yinjue A Nov. 5, 2022, 3:06 a.m. OK GNU C++14 TESTS 9 62 0
179349042 another_fake_account A Nov. 5, 2022, 4:55 a.m. OK GNU C++14 TESTS 9 62 0
179348005 980798778 A Nov. 5, 2022, 4:41 a.m. OK GNU C++14 TESTS 9 62 0
179345314 william4s A Nov. 5, 2022, 4:02 a.m. OK GNU C++14 TESTS 9 62 0
179294262 Sempr A Nov. 4, 2022, 5:39 p.m. OK GNU C++17 TESTS 8 15 512000
179296699 RABEYA_AKTER_LIMA A Nov. 4, 2022, 5:51 p.m. OK GNU C++17 TESTS 8 15 2867200
179294190 Sempr A Nov. 4, 2022, 5:38 p.m. OK GNU C++17 TESTS 8 31 46796800
179290088 Najanajah A Nov. 4, 2022, 5:20 p.m. OK GNU C++17 TESTS 8 46 0
179284407 NahinM A Nov. 4, 2022, 4:34 p.m. OK GNU C++17 TESTS 8 46 409600
179335635 Panther339 A Nov. 5, 2022, 1:04 a.m. OK GNU C++17 TESTS 8 46 512000
179335197 ZiFeii A Nov. 5, 2022, 12:51 a.m. OK GNU C++17 TESTS 8 46 8089600
179350702 sandeep333 A Nov. 5, 2022, 5:16 a.m. OK GNU C++17 TESTS 9 61 0
179283347 rohansaraswat33 A Nov. 4, 2022, 4:32 p.m. OK GNU C++17 TESTS 8 61 0
179322816 overgeared A Nov. 4, 2022, 8:30 p.m. OK GNU C++17 TESTS 8 61 819200
179291760 TsotneSC A Nov. 4, 2022, 5:27 p.m. OK GNU C++17 (64) TESTS 8 31 0
179300303 Awesome3.14 A Nov. 4, 2022, 6:10 p.m. OK GNU C++17 (64) TESTS 8 46 0
179345080 Utsav-Ladani A Nov. 5, 2022, 3:58 a.m. OK GNU C++17 (64) TESTS 9 46 0
179335396 PCC A Nov. 5, 2022, 12:56 a.m. OK GNU C++17 (64) TESTS 8 46 0
179334523 xhgua A Nov. 5, 2022, 12:32 a.m. OK GNU C++17 (64) TESTS 8 46 0
179330189 PurpleCrayon A Nov. 4, 2022, 10:23 p.m. OK GNU C++17 (64) TESTS 8 46 0
179329015 Ayalla A Nov. 4, 2022, 9:58 p.m. OK GNU C++17 (64) TESTS 8 46 0
179302391 16raghunandangupta A Nov. 4, 2022, 6:22 p.m. OK GNU C++17 (64) TESTS 8 46 0
179298580 MoNir_ A Nov. 4, 2022, 6:02 p.m. OK GNU C++17 (64) TESTS 8 46 0
179295036 ithinkimloosingmymind A Nov. 4, 2022, 5:43 p.m. OK GNU C++17 (64) TESTS 8 46 0
179334397 ParangVo A Nov. 5, 2022, 12:27 a.m. OK GNU C++20 (64) TESTS 8 31 0
179334413 2021sgy A Nov. 5, 2022, 12:28 a.m. OK GNU C++20 (64) TESTS 8 31 0
179335546 Mahmoud_Gamal_ A Nov. 5, 2022, 1:01 a.m. OK GNU C++20 (64) TESTS 8 31 0
179336070 _minhduccp A Nov. 5, 2022, 1:15 a.m. OK GNU C++20 (64) TESTS 8 31 0
179336711 rijinjjjj A Nov. 5, 2022, 1:32 a.m. OK GNU C++20 (64) TESTS 8 31 0
179339988 Gats A Nov. 5, 2022, 2:35 a.m. OK GNU C++20 (64) TESTS 9 31 0
179341958 Aoisrot A Nov. 5, 2022, 3:07 a.m. OK GNU C++20 (64) TESTS 9 31 0
179346816 akshaynigam90 A Nov. 5, 2022, 4:24 a.m. OK GNU C++20 (64) TESTS 9 31 0
179350329 TJ_Andeviking A Nov. 5, 2022, 5:12 a.m. OK GNU C++20 (64) TESTS 9 31 0
179370621 vedant_1 A Nov. 5, 2022, 5:49 a.m. OK GNU C++20 (64) TESTS 9 31 0
179333408 z-ghost A Nov. 4, 2022, 11:52 p.m. OK Go TESTS 8 93 3174400
179305658 _shrish_ A Nov. 4, 2022, 6:39 p.m. OK Go TESTS 8 124 4300800
179343586 rajneesh.osho A Nov. 5, 2022, 3:33 a.m. OK Java 11 TESTS 9 186 0
179291903 Spidey2182 A Nov. 4, 2022, 5:28 p.m. OK Java 11 TESTS 8 186 0
179348405 sf14t A Nov. 5, 2022, 4:47 a.m. OK Java 11 TESTS 9 202 0
179323450 henrychenOutlook A Nov. 4, 2022, 8:38 p.m. OK Java 11 TESTS 8 202 0
179307858 saiharish A Nov. 4, 2022, 6:52 p.m. OK Java 11 TESTS 8 218 0
179344672 __Serendipity A Nov. 5, 2022, 3:52 a.m. OK Java 11 TESTS 9 233 0
179330142 ac9117033 A Nov. 4, 2022, 10:22 p.m. OK Java 11 TESTS 8 234 5017600
179315044 yadavdipesh A Nov. 4, 2022, 7:29 p.m. OK Java 11 TESTS 8 295 409600
179290266 FirstException A Nov. 4, 2022, 5:21 p.m. OK Java 11 TESTS 8 295 43622400
179324838 ETHANHUNTMI5 A Nov. 4, 2022, 8:53 p.m. OK Java 11 TESTS 8 327 0
179307559 Ibrahim027 A Nov. 4, 2022, 6:50 p.m. OK Java 17 TESTS 8 296 409600
179307761 Kay0 A Nov. 4, 2022, 6:51 p.m. OK Java 17 TESTS 8 499 819200
179311139 Suraj1607 A Nov. 4, 2022, 7:05 p.m. OK Java 17 TESTS 8 514 204800
179310898 vamsam61 A Nov. 4, 2022, 7:03 p.m. OK Java 17 TESTS 8 514 409600
179281834 Pranjul_Maheshwari A Nov. 4, 2022, 4:29 p.m. OK Java 17 TESTS 8 514 716800
179305356 malaydewangan310 A Nov. 4, 2022, 6:37 p.m. OK Java 17 TESTS 8 514 819200
179289089 coderev_12 A Nov. 4, 2022, 5:17 p.m. OK Java 17 TESTS 8 514 921600
179306452 Kay0 A Nov. 4, 2022, 6:44 p.m. OK Java 17 TESTS 8 529 819200
179299147 Sanskar0407 A Nov. 4, 2022, 6:04 p.m. OK Java 17 TESTS 8 530 1024000
179319598 Vas1l1y A Nov. 4, 2022, 8:01 p.m. OK Java 17 TESTS 8 530 1126400
179294412 Abdallah_Ragab00 A Nov. 4, 2022, 5:40 p.m. OK Java 8 TESTS 8 139 0
179317029 rish1896 A Nov. 4, 2022, 7:43 p.m. OK Java 8 TESTS 8 155 0
179314884 amtematem A Nov. 4, 2022, 7:28 p.m. OK Java 8 TESTS 8 155 0
179292402 youtsuha A Nov. 4, 2022, 5:30 p.m. OK Java 8 TESTS 8 155 0
179301002 Prime_Geek A Nov. 4, 2022, 6:14 p.m. OK Java 8 TESTS 8 156 2969600
179291831 Parimal A Nov. 4, 2022, 5:28 p.m. OK Java 8 TESTS 8 217 2867200
179337241 iamJatinYadav A Nov. 5, 2022, 1:44 a.m. OK Java 8 TESTS 8 218 0
179294621 sersufer A Nov. 4, 2022, 5:41 p.m. OK Java 8 TESTS 8 233 6963200
179296841 tonysta A Nov. 4, 2022, 5:52 p.m. OK Java 8 TESTS 8 249 2969600
179315282 6thSense A Nov. 4, 2022, 7:31 p.m. OK Java 8 TESTS 8 358 7065600
179325444 artsemy A Nov. 4, 2022, 9 p.m. OK JavaScript TESTS 8 202 22835200
179336598 arvindf232 A Nov. 5, 2022, 1:29 a.m. OK Kotlin 1.6 TESTS 8 186 0
179310645 Faber A Nov. 4, 2022, 7:02 p.m. OK Kotlin 1.6 TESTS 8 389 5836800
179310364 Faber A Nov. 4, 2022, 7 p.m. OK Kotlin 1.6 TESTS 8 436 6144000
179304667 dimasikks A Nov. 4, 2022, 6:34 p.m. OK MS C++ 2017 TESTS 8 77 0
179304769 dimasikks A Nov. 4, 2022, 6:34 p.m. OK MS C++ 2017 TESTS 8 78 0
179323225 so.am.fosh A Nov. 4, 2022, 8:35 p.m. OK MS C++ 2017 TESTS 8 186 0
179292917 Rubayet_Tahsin_Ikra A Nov. 4, 2022, 5:32 p.m. OK MS C++ 2017 TESTS 8 217 409600
179344972 Anuvrat_Verma A Nov. 5, 2022, 3:56 a.m. OK MS C++ 2017 TESTS 9 233 0
179351729 manyaya A Nov. 5, 2022, 5:28 a.m. OK MS C++ 2017 TESTS 9 264 0
179279309 k_bhayan A Nov. 4, 2022, 4:23 p.m. OK MS C++ 2017 TESTS 8 264 2662400
179281814 Mosey A Nov. 4, 2022, 4:29 p.m. OK MS C++ 2017 TESTS 8 265 819200
179355564 sarvesh5703 A Nov. 5, 2022, 5:39 a.m. OK MS C++ 2017 TESTS 9 280 1433600
179326579 rsFalse A Nov. 4, 2022, 9:16 p.m. OK Perl TESTS 8 296 7168000
179340203 Asmat.S_SundarSTEM A Nov. 5, 2022, 2:38 a.m. OK Perl TESTS 9 358 7168000
179340155 Shuja_SundarSTEM A Nov. 5, 2022, 2:37 a.m. OK Perl TESTS 9 358 7168000
179343624 hkwu6013 A Nov. 5, 2022, 3:34 a.m. OK PyPy 3 TESTS 9 187 14745600
179289314 ZzaZi A Nov. 4, 2022, 5:18 p.m. OK PyPy 3 TESTS 8 343 15360000
179290355 golo A Nov. 4, 2022, 5:21 p.m. OK PyPy 3 TESTS 8 405 15667200
179350941 vegan_hannibal A Nov. 5, 2022, 5:19 a.m. OK PyPy 3 TESTS 9 560 13619200
179316373 Nikita_Yashin A Nov. 4, 2022, 7:39 p.m. OK PyPy 3 TESTS 8 623 13824000
179319525 abc_noob_backup A Nov. 4, 2022, 8 p.m. OK PyPy 3 TESTS 8 624 14336000
179288376 akashbhoi A Nov. 4, 2022, 5:15 p.m. OK PyPy 3 TESTS 8 639 12595200
179281559 blithersoup A Nov. 4, 2022, 4:28 p.m. OK PyPy 3 TESTS 8 670 13721600
179294045 sohilkhanduja A Nov. 4, 2022, 5:38 p.m. OK PyPy 3 TESTS 8 685 13926400
179309328 gotcoding124 A Nov. 4, 2022, 6:54 p.m. OK PyPy 3 TESTS 8 701 14848000
179294117 Nabeel_Ismaeel A Nov. 4, 2022, 5:38 p.m. OK PyPy 3-64 TESTS 8 124 17203200
179298712 phoenix2811 A Nov. 4, 2022, 6:02 p.m. OK PyPy 3-64 TESTS 8 124 17612800
179294632 crapcode A Nov. 4, 2022, 5:41 p.m. OK PyPy 3-64 TESTS 8 124 18022400
179299269 phoenix2811 A Nov. 4, 2022, 6:05 p.m. OK PyPy 3-64 TESTS 8 124 25600000
179318056 merium A Nov. 4, 2022, 7:50 p.m. OK PyPy 3-64 TESTS 8 139 19660800
179301892 neuronz A Nov. 4, 2022, 6:19 p.m. OK PyPy 3-64 TESTS 8 139 22835200
179300762 neuronz A Nov. 4, 2022, 6:13 p.m. OK PyPy 3-64 TESTS 8 139 23040000
179304800 neuronz A Nov. 4, 2022, 6:34 p.m. OK PyPy 3-64 TESTS 8 139 152371200
179349538 uttharapally.chandra A Nov. 5, 2022, 5:02 a.m. OK PyPy 3-64 TESTS 9 140 16998400
179295280 biglunchdude A Nov. 4, 2022, 5:44 p.m. OK PyPy 3-64 TESTS 8 140 17100800
179293841 Madhab_C_K A Nov. 4, 2022, 5:37 p.m. OK Python 3 TESTS 8 108 8499200
179340101 Asmat.S_SundarSTEM A Nov. 5, 2022, 2:36 a.m. OK Python 3 TESTS 9 140 8499200
179308880 neuronz A Nov. 4, 2022, 6:52 p.m. OK Python 3 TESTS 8 140 10956800
179343395 pastoris A Nov. 5, 2022, 3:30 a.m. OK Python 3 TESTS 9 156 10547200
179295824 craniruddh07 A Nov. 4, 2022, 5:47 p.m. OK Python 3 TESTS 8 186 9318400
179283735 Alt43 A Nov. 4, 2022, 4:33 p.m. OK Python 3 TESTS 8 202 10547200
179337905 Sami.S_SundarSTEM A Nov. 5, 2022, 1:57 a.m. OK Python 3 TESTS 8 217 7168000
179290944 NaveenRampuram A Nov. 4, 2022, 5:24 p.m. OK Python 3 TESTS 8 218 10444800
179289168 AKSLEGION781126 A Nov. 4, 2022, 5:17 p.m. OK Python 3 TESTS 8 233 7270400
179325690 prathamnagaria A Nov. 4, 2022, 9:03 p.m. OK Python 3 TESTS 8 233 10444800
179337479 tongtongac A Nov. 5, 2022, 1:49 a.m. OK Rust 2021 TESTS 8 170 8704000

remove filters

Back to search problems