Codeforces Round 919 (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
1920 Codeforces Round 919 (Div. 2) FINISHED False 7200 32023463 Jan. 13, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21402 ) B Summation Game PROGRAMMING dp games greedy sortings

B'Alice and Bob are playing a game. They have an array a_1, a_2, ldots,a_n . The game consists of two steps: Alice wants to maximize the sum of elements of the array while Bob wants to minimize it. Find the sum of elements of the array after the game if both players play optimally. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains three integers n , k , and x ( 1 <= q n <= q 2 cdot 10^5 , 1 <= q x,k <= q n ) -- the number of elements in the array, the limit on the number of elements of the array that Alice can remove, and the limit on the number of elements of the array that Bob can multiply -1 to. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 1000 ) -- the elements of the array. 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 sum of elements of the array after the game if both players play optimally. In the first test case, it is optimal for Alice to remove the only element of the array. Then, the sum of elements of the array is 0 after the game is over. In the second test case, it is optimal for Alice to not remove any elements. Bob will then multiply 4 by -1 . So the final sum of elements of the array is 3+1+2-4=2 . In the fifth test case, it is optimal for Alice to remove 9, 9 . Bob will then multiply 5, 5, 3 by -1 . So the final sum of elements of the array is -5-5-3+3+3+2=-5 . '...

Tutorials

Editorial for Codeforces Round #919 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
241510584 kokora B Jan. 13, 2024, 9:08 p.m. OK C# 10 TESTS 12 124 16588800
241519367 bluemegane B Jan. 14, 2024, 2:08 a.m. OK C# 8 TESTS 12 186 16179200
241525966 Tigerwood B Jan. 14, 2024, 4:33 a.m. OK Clang++17 Diagnostics TESTS 12 873 23142400
241521445 vchnsjd B Jan. 14, 2024, 2:57 a.m. OK Clang++20 Diagnostics TESTS 12 717 3788800
241509905 sasta_coderr B Jan. 13, 2024, 8:55 p.m. OK Clang++20 Diagnostics TESTS 12 764 19968000
241509874 sasta_coderr B Jan. 13, 2024, 8:54 p.m. OK Clang++20 Diagnostics TESTS 12 795 19968000
241482049 KingHenryXIV B Jan. 13, 2024, 4:27 p.m. OK GNU C11 TESTS 12 62 1843200
241498590 lakshminarasimha.y22 B Jan. 13, 2024, 6:23 p.m. OK GNU C11 TESTS 12 77 1638400
241490434 sujal22514 B Jan. 13, 2024, 5:23 p.m. OK GNU C11 TESTS 12 78 1843200
241518977 Mars_Dingdang B Jan. 14, 2024, 1:57 a.m. OK GNU C++14 TESTS 12 31 3686400
241518720 ice.run B Jan. 14, 2024, 1:50 a.m. OK GNU C++14 TESTS 12 46 819200
241508280 _Rawan_ B Jan. 13, 2024, 8:27 p.m. OK GNU C++14 TESTS 12 46 819200
241525416 jinal_gajera B Jan. 14, 2024, 4:22 a.m. OK GNU C++14 TESTS 12 46 819200
241519945 __tomato__ B Jan. 14, 2024, 2:22 a.m. OK GNU C++14 TESTS 12 46 819200
241519759 wdywfm B Jan. 14, 2024, 2:18 a.m. OK GNU C++14 TESTS 12 46 819200
241518056 zxr123 B Jan. 14, 2024, 1:31 a.m. OK GNU C++14 TESTS 12 46 1638400
241520464 johnsmith0xcf B Jan. 14, 2024, 2:35 a.m. OK GNU C++14 TESTS 12 46 2457600
241503436 Ds110 B Jan. 13, 2024, 7:17 p.m. OK GNU C++14 TESTS 12 61 819200
241515119 puskar_singh_16 B Jan. 13, 2024, 11:29 p.m. OK GNU C++14 TESTS 12 61 819200
241488621 ImMadScientest B Jan. 13, 2024, 5:16 p.m. OK GNU C++17 TESTS 12 46 819200
241488601 siddiq0611 B Jan. 13, 2024, 5:16 p.m. OK GNU C++17 TESTS 12 46 819200
241523902 CatBiscuit B Jan. 14, 2024, 3:51 a.m. OK GNU C++17 TESTS 12 46 819200
241508893 Ibrahim-samir987 B Jan. 13, 2024, 8:37 p.m. OK GNU C++17 TESTS 12 46 819200
241489518 Uno_Master B Jan. 13, 2024, 5:19 p.m. OK GNU C++17 TESTS 12 46 819200
241480522 Tamim009 B Jan. 13, 2024, 4:23 p.m. OK GNU C++17 TESTS 12 46 1638400
241480419 realtheshy_ B Jan. 13, 2024, 4:23 p.m. OK GNU C++17 TESTS 12 46 1638400
241506577 repugnant B Jan. 13, 2024, 8 p.m. OK GNU C++17 TESTS 12 46 1638400
241493774 dev83 B Jan. 13, 2024, 5:43 p.m. OK GNU C++17 TESTS 12 46 1638400
241482328 bryceShakeair B Jan. 13, 2024, 4:27 p.m. OK GNU C++17 TESTS 12 46 1638400
241529597 fzyz2020 B Jan. 14, 2024, 5:30 a.m. OK GNU C++17 (64) TESTS 12 31 819200
241520954 JustKitkat B Jan. 14, 2024, 2:47 a.m. OK GNU C++17 (64) TESTS 12 31 819200
241518043 dev-shajid B Jan. 14, 2024, 1:30 a.m. OK GNU C++17 (64) TESTS 12 31 819200
241521706 Detached_ B Jan. 14, 2024, 3:03 a.m. OK GNU C++17 (64) TESTS 12 31 3174400
241510532 sandoval95 B Jan. 13, 2024, 9:07 p.m. OK GNU C++17 (64) TESTS 12 46 819200
241529111 chronobox B Jan. 14, 2024, 5:23 a.m. OK GNU C++17 (64) TESTS 12 46 819200
241526104 iamthetop B Jan. 14, 2024, 4:35 a.m. OK GNU C++17 (64) TESTS 12 46 819200
241522446 Souture B Jan. 14, 2024, 3:19 a.m. OK GNU C++17 (64) TESTS 12 46 819200
241516433 ZhuzRi B Jan. 14, 2024, 12:28 a.m. OK GNU C++17 (64) TESTS 12 46 819200
241515697 manasic B Jan. 13, 2024, 11:53 p.m. OK GNU C++17 (64) TESTS 12 46 819200
241515248 wakab83905 B Jan. 13, 2024, 11:34 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241513561 Khaled_Al_Awad B Jan. 13, 2024, 10:30 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241510794 3.1415926535897932384 B Jan. 13, 2024, 9:12 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241509544 cup_of_coffee B Jan. 13, 2024, 8:49 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241509384 Abdelshakour B Jan. 13, 2024, 8:46 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241499357 nebula B Jan. 13, 2024, 6:30 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241492862 haters B Jan. 13, 2024, 5:37 p.m. OK GNU C++20 (64) TESTS 12 31 819200
241528474 mdfaisalsheikh B Jan. 14, 2024, 5:14 a.m. OK GNU C++20 (64) TESTS 12 31 819200
241529170 Taurus388 B Jan. 14, 2024, 5:24 a.m. OK GNU C++20 (64) TESTS 12 31 819200
241531828 truong_dm B Jan. 14, 2024, 5:56 a.m. OK GNU C++20 (64) TESTS 12 31 819200
241501304 Nick B Jan. 13, 2024, 6:50 p.m. OK Java 11 TESTS 12 202 0
241483936 dwoolley3 B Jan. 13, 2024, 4:31 p.m. OK Java 11 TESTS 12 234 0
241482363 kaushikhardik35 B Jan. 13, 2024, 4:27 p.m. OK Java 11 TESTS 12 249 0
241491258 shojin_pro B Jan. 13, 2024, 5:28 p.m. OK Java 11 TESTS 12 264 921600
241521816 QW666 B Jan. 14, 2024, 3:05 a.m. OK Java 11 TESTS 12 390 0
241526790 Amiya-05 B Jan. 14, 2024, 4:47 a.m. OK Java 11 TESTS 12 405 0
241504750 arnav_gupta B Jan. 13, 2024, 7:34 p.m. OK Java 11 TESTS 12 405 0
241488958 generak1ng0 B Jan. 13, 2024, 5:17 p.m. OK Java 11 TESTS 12 405 0
241488584 aypatrl04 B Jan. 13, 2024, 5:16 p.m. OK Java 11 TESTS 12 436 0
241481687 V1GYAT B Jan. 13, 2024, 4:26 p.m. OK Java 11 TESTS 12 436 0
241514496 FierteDeCeylan B Jan. 13, 2024, 11:03 p.m. OK Java 17 TESTS 12 233 819200
241483623 BurnerAce07 B Jan. 13, 2024, 4:30 p.m. OK Java 17 TESTS 12 249 102400
241498997 samuelX159 B Jan. 13, 2024, 6:27 p.m. OK Java 17 TESTS 12 249 614400
241510585 54k B Jan. 13, 2024, 9:08 p.m. OK Java 17 TESTS 12 265 0
241490317 Nagendravarma B Jan. 13, 2024, 5:23 p.m. OK Java 17 TESTS 12 280 1126400
241515480 snowyrsb B Jan. 13, 2024, 11:44 p.m. OK Java 17 TESTS 12 280 3788800
241529536 P_p_s B Jan. 14, 2024, 5:29 a.m. OK Java 17 TESTS 12 295 819200
241488468 ducky101 B Jan. 13, 2024, 5:16 p.m. OK Java 17 TESTS 12 295 12288000
241530168 Jagnath_Reddy B Jan. 14, 2024, 5:36 a.m. OK Java 17 TESTS 12 296 512000
241494398 rajasomeshwar_bitla B Jan. 13, 2024, 5:48 p.m. OK Java 17 TESTS 12 327 13619200
241526483 RkRohitKumar B Jan. 14, 2024, 4:42 a.m. OK Java 21 TESTS 12 342 13414400
241527376 gearsoft B Jan. 14, 2024, 4:58 a.m. OK Java 21 TESTS 12 343 2457600
241488817 rated21 B Jan. 13, 2024, 5:16 p.m. OK Java 21 TESTS 12 451 6963200
241497620 pranay_1012 B Jan. 13, 2024, 6:14 p.m. OK Java 21 TESTS 12 530 716800
241484359 Kev1nYu B Jan. 13, 2024, 4:31 p.m. OK Java 21 TESTS 12 545 921600
241519308 HuParry B Jan. 14, 2024, 2:06 a.m. OK Java 21 TESTS 12 561 512000
241492638 Aaryan_T B Jan. 13, 2024, 5:36 p.m. OK Java 21 TESTS 12 561 614400
241481112 NirajKumarSingh B Jan. 13, 2024, 4:25 p.m. OK Java 21 TESTS 12 592 614400
241492929 srvkr B Jan. 13, 2024, 5:38 p.m. OK Java 21 TESTS 12 607 716800
241499600 srvkr B Jan. 13, 2024, 6:33 p.m. OK Java 21 TESTS 12 639 16896000
241508762 SecondThread B Jan. 13, 2024, 8:35 p.m. OK Java 8 TESTS 12 155 0
241507774 __SSB__ B Jan. 13, 2024, 8:19 p.m. OK Java 8 TESTS 12 155 0
241501150 gdax B Jan. 13, 2024, 6:48 p.m. OK Java 8 TESTS 12 155 0
241501712 Sumitsingh7 B Jan. 13, 2024, 6:55 p.m. OK Java 8 TESTS 12 171 17817600
241495452 vijay_panwar12 B Jan. 13, 2024, 5:55 p.m. OK Java 8 TESTS 12 186 2150400
241480291 gdax B Jan. 13, 2024, 4:23 p.m. OK Java 8 TESTS 12 187 0
241513283 Yousef_Badr B Jan. 13, 2024, 10:21 p.m. OK Java 8 TESTS 12 202 0
241488656 iamdimonis B Jan. 13, 2024, 5:16 p.m. OK Java 8 TESTS 12 202 2355200
241496531 vinay_panwar B Jan. 13, 2024, 6:04 p.m. OK Java 8 TESTS 12 202 4096000
241489921 formidablechief27 B Jan. 13, 2024, 5:21 p.m. OK Java 8 TESTS 12 217 4915200
241526425 rscprof B Jan. 14, 2024, 4:41 a.m. OK Kotlin 1.9 TESTS 12 888 96665600
241481210 mircea85 B Jan. 13, 2024, 4:25 p.m. OK Mono C# TESTS 12 109 11980800
241481856 Elsa3dy__74__ B Jan. 13, 2024, 4:26 p.m. OK MS C++ 2017 TESTS 12 140 819200
241483774 Kuzialakomkin228 B Jan. 13, 2024, 4:30 p.m. OK MS C++ 2017 TESTS 12 140 1638400
241491333 shuangya B Jan. 13, 2024, 5:28 p.m. OK MS C++ 2017 TESTS 12 156 819200
241502957 agdecoder03 B Jan. 13, 2024, 7:10 p.m. OK MS C++ 2017 TESTS 12 156 1638400
241482196 menon_710 B Jan. 13, 2024, 4:27 p.m. OK MS C++ 2017 TESTS 12 156 1638400
241531993 Pandit_Jwalit B Jan. 14, 2024, 5:58 a.m. OK MS C++ 2017 TESTS 12 156 1638400
241503316 ShadowDrunk B Jan. 13, 2024, 7:15 p.m. OK MS C++ 2017 TESTS 12 156 3993600
241526885 RICESHOWER_421 B Jan. 14, 2024, 4:48 a.m. OK MS C++ 2017 TESTS 12 171 819200
241491085 AvanSingh B Jan. 13, 2024, 5:27 p.m. OK MS C++ 2017 TESTS 12 171 1433600
241504630 RODIZO B Jan. 13, 2024, 7:32 p.m. OK MS C++ 2017 TESTS 12 171 3174400
241523159 swapnil_diganta B Jan. 14, 2024, 3:34 a.m. OK Node.js TESTS 12 264 32358400
241523727 swapnil_diganta B Jan. 14, 2024, 3:48 a.m. OK Node.js TESTS 12 280 47206400
241483504 rsFalse B Jan. 13, 2024, 4:30 p.m. OK Perl TESTS 12 373 39526400
241516849 crapcode B Jan. 14, 2024, 12:48 a.m. OK PHP TESTS 12 124 27340800
241494781 aki79 B Jan. 13, 2024, 5:51 p.m. OK PHP TESTS 12 124 33587200
241480209 brunocalza B Jan. 13, 2024, 4:23 p.m. OK PyPy 2 TESTS 12 248 10444800
241488476 aymane.moataz3 B Jan. 13, 2024, 5:16 p.m. OK PyPy 3 TESTS 12 202 16076800
241499880 Justin_Foley B Jan. 13, 2024, 6:35 p.m. OK PyPy 3 TESTS 12 218 16793600
241502189 Ayushman_123 B Jan. 13, 2024, 7:01 p.m. OK PyPy 3 TESTS 12 326 19353600
241510884 monji B Jan. 13, 2024, 9:14 p.m. OK PyPy 3 TESTS 12 389 15052800
241505222 udaypnayar B Jan. 13, 2024, 7:41 p.m. OK PyPy 3 TESTS 12 390 15052800
241482478 BlitherBoom812 B Jan. 13, 2024, 4:27 p.m. OK PyPy 3 TESTS 12 483 14950400
241480320 seeforty4040 B Jan. 13, 2024, 4:23 p.m. OK PyPy 3 TESTS 12 483 18432000
241481493 Ayusshhh B Jan. 13, 2024, 4:25 p.m. OK PyPy 3 TESTS 12 514 18534400
241485226 me6 B Jan. 13, 2024, 4:33 p.m. OK PyPy 3 TESTS 12 514 20582400
241505037 Tinky1224 B Jan. 13, 2024, 7:38 p.m. OK PyPy 3-64 TESTS 12 124 22528000
241496101 gardengnome B Jan. 13, 2024, 6:01 p.m. OK PyPy 3-64 TESTS 12 124 22835200
241505794 AndreiZherder B Jan. 13, 2024, 7:49 p.m. OK PyPy 3-64 TESTS 12 124 24883200
241510487 Deecey01 B Jan. 13, 2024, 9:06 p.m. OK PyPy 3-64 TESTS 12 140 26521600
241516195 nealzane B Jan. 14, 2024, 12:16 a.m. OK PyPy 3-64 TESTS 12 140 27750400
241505311 VitalyKo B Jan. 13, 2024, 7:42 p.m. OK PyPy 3-64 TESTS 12 140 29900800
241499714 jvatsal0709 B Jan. 13, 2024, 6:34 p.m. OK PyPy 3-64 TESTS 12 140 30310400
241495850 gardengnome B Jan. 13, 2024, 5:59 p.m. OK PyPy 3-64 TESTS 12 155 22835200
241480029 catwine B Jan. 13, 2024, 4:22 p.m. OK PyPy 3-64 TESTS 12 155 23347200
241480239 DeathbringerY B Jan. 13, 2024, 4:23 p.m. OK PyPy 3-64 TESTS 12 155 27136000
241490601 OLOGY B Jan. 13, 2024, 5:24 p.m. OK Python 2 TESTS 12 234 11980800
241490572 OLOGY B Jan. 13, 2024, 5:24 p.m. OK Python 2 TESTS 12 280 11980800
241527266 Kaushal655 B Jan. 14, 2024, 4:56 a.m. OK Python 3 TESTS 12 186 26828800
241480812 duyle39 B Jan. 13, 2024, 4:24 p.m. OK Python 3 TESTS 12 202 25292800
241494932 logankeede B Jan. 13, 2024, 5:52 p.m. OK Python 3 TESTS 12 202 26726400
241526641 pennymagic156 B Jan. 14, 2024, 4:44 a.m. OK Python 3 TESTS 12 202 26828800
241508085 Ratery B Jan. 13, 2024, 8:24 p.m. OK Python 3 TESTS 12 217 26726400
241509005 ScoutX B Jan. 13, 2024, 8:39 p.m. OK Python 3 TESTS 12 218 26726400
241508040 hayley17 B Jan. 13, 2024, 8:23 p.m. OK Python 3 TESTS 12 218 26726400
241498108 DrCoder9146 B Jan. 13, 2024, 6:18 p.m. OK Python 3 TESTS 12 218 26726400
241490769 samyaksrivastava9 B Jan. 13, 2024, 5:25 p.m. OK Python 3 TESTS 12 218 26726400
241482181 ayush_jhajharia B Jan. 13, 2024, 4:27 p.m. OK Python 3 TESTS 12 218 26726400
241489584 emanuele-em B Jan. 13, 2024, 5:19 p.m. OK Rust 2021 TESTS 12 31 1638400
241488794 DreadedHippy B Jan. 13, 2024, 5:16 p.m. OK Rust 2021 TESTS 12 61 6348800
241492763 DreadedHippy B Jan. 13, 2024, 5:37 p.m. OK Rust 2021 TESTS 12 62 5222400
241525646 dragonwarrior B Jan. 14, 2024, 4:27 a.m. OK Rust 2021 TESTS 12 62 13107200
241481673 NotSpaceBoy B Jan. 13, 2024, 4:26 p.m. OK Rust 2021 TESTS 12 93 9420800

remove filters

Back to search problems