Codeforces Round 1070 (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
2176 Codeforces Round 1070 (Div. 2) FINISHED False 7200 10941923 Dec. 11, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 15581 ) C Odd Process PROGRAMMING greedy math sortings

You have (n) coins with denominations (a_1, a_2, \ldots, a_n) and a natural number (k). You also have a bag, which is initially empty, where you can place coins. You need to perform exactly (k) actions. In each action, you take one coin from those you have left and put it in your bag. After that, you can no longer take that coin. At the same time, you have a cat that loves even numbers, so every time the sum of the denominations of the coins in your bag becomes even, your cat empties the bag, meaning it takes all the coins to a place known only to it, and the bag is empty again. Note that the bag is emptied every time the sum becomes even during the process of adding coins, not just at the very last moment. Let your score be the sum of the denominations of the coins in the bag. Your task is to perform (k) actions such that your final score is maximized. Find the answer for all (1 \le k \le n). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \le n \le 2 \cdot 10^5)) — the number of coins you have. The second line of each test case contains (n) natural numbers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)) — the denominations of the coins. It is guaranteed that the sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output (n) numbers — the maximum possible score that can be achieved by performing exactly (k) actions for all (k) from (1) to (n). In the first set of input data, you have coins with denominations (1,1,1). (k=1): in this case, the sum of the denominations in the bag is (1), regardless of the chosen coin. The final score is also (1). (k=2): in this case, the sum of the denominations in the bag is initially (1), regardless of the choice

Tutorials

Codeforces Round 1070 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
353091683 shahadat26 C Dec. 11, 2025, 4:32 p.m. OK C# 10 TESTS 20 265 39424000
353124298 AverageAmogusEnjoyer C Dec. 11, 2025, 10:10 p.m. OK C++17 (GCC 7-32) TESTS 20 125 102400
353140822 TheDude50 C Dec. 12, 2025, 4:51 a.m. OK C++17 (GCC 7-32) TESTS 20 125 921600
353137970 _BILIEVE_ C Dec. 12, 2025, 4:13 a.m. OK C++17 (GCC 7-32) TESTS 20 125 1433600
353121862 Dh456 C Dec. 11, 2025, 9:21 p.m. OK C++17 (GCC 7-32) TESTS 20 125 1740800
353089828 Athul_K C Dec. 11, 2025, 4:28 p.m. OK C++17 (GCC 7-32) TESTS 20 125 2764800
353145709 arshjeet C Dec. 12, 2025, 5:37 a.m. OK C++17 (GCC 7-32) TESTS 20 125 2969600
353137188 CQA329 C Dec. 12, 2025, 4:02 a.m. OK C++17 (GCC 7-32) TESTS 20 140 0
353115542 Ujwal_Khada C Dec. 11, 2025, 7:52 p.m. OK C++17 (GCC 7-32) TESTS 20 140 0
353104971 hYdr0xY-Zeng C Dec. 11, 2025, 6:17 p.m. OK C++17 (GCC 7-32) TESTS 20 140 0
353098948 The_Parzival C Dec. 11, 2025, 5:40 p.m. OK C++17 (GCC 7-32) TESTS 20 140 0
353146222 krishisop C Dec. 12, 2025, 5:42 a.m. OK C++20 (GCC 13-64) TESTS 20 78 102400
353117403 jabiryimam1 C Dec. 11, 2025, 8:14 p.m. OK C++20 (GCC 13-64) TESTS 20 78 102400
353133106 Ylsbdkj C Dec. 12, 2025, 2:43 a.m. OK C++20 (GCC 13-64) TESTS 20 78 1843200
353117387 NSR_55 C Dec. 11, 2025, 8:14 p.m. OK C++20 (GCC 13-64) TESTS 20 78 1843200
353116849 divyanshrajput91565 C Dec. 11, 2025, 8:07 p.m. OK C++20 (GCC 13-64) TESTS 20 78 1945600
353135293 mauryanand C Dec. 12, 2025, 3:27 a.m. OK C++20 (GCC 13-64) TESTS 20 78 3993600
353138303 L_lawliet13 C Dec. 12, 2025, 4:18 a.m. OK C++20 (GCC 13-64) TESTS 20 93 0
353119652 EatSleepCode_Repeat C Dec. 11, 2025, 8:45 p.m. OK C++20 (GCC 13-64) TESTS 20 93 0
353099123 -rynk2200 C Dec. 11, 2025, 5:41 p.m. OK C++20 (GCC 13-64) TESTS 20 93 0
353091899 faRIZZ_27 C Dec. 11, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 20 93 0
353147304 tianyu_awa C Dec. 12, 2025, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 62 5017600
353106723 adarsh_afk C Dec. 11, 2025, 6:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 78 409600
353117731 pijacka C Dec. 11, 2025, 8:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 78 716800
353132357 Relentless_Forward C Dec. 12, 2025, 2:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 78 1024000
353129301 xubaichuan C Dec. 12, 2025, 12:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 78 3276800
353116698 Robier C Dec. 11, 2025, 8:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 0
353091944 yeyixi C Dec. 11, 2025, 4:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 0
353120912 shamima_ananna C Dec. 11, 2025, 9:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 0
353148237 vs358 C Dec. 12, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 102400
353143364 xty001 C Dec. 12, 2025, 5:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 93 102400
353093044 SacredDragon C Dec. 11, 2025, 4:34 p.m. OK GNU C11 TESTS 20 984 4812800
353145644 Zongb C Dec. 12, 2025, 5:36 a.m. OK GNU C11 TESTS 20 984 6451200
353086219 Amisha_JIndal C Dec. 11, 2025, 4:20 p.m. OK GNU C11 TESTS 20 1000 4915200
353085182 bughunter_newb C Dec. 11, 2025, 4:18 p.m. OK GNU C11 TESTS 20 1046 3174400
353083341 lym3188312338 C Dec. 11, 2025, 4:14 p.m. OK GNU C11 TESTS 20 1078 4812800
353093283 zhanzhijiea C Dec. 11, 2025, 4:34 p.m. OK GNU C11 TESTS 20 1109 6553600
353090024 anshul.01 C Dec. 11, 2025, 4:29 p.m. OK GNU C11 TESTS 20 1734 4710400
353087323 chethan_coding C Dec. 11, 2025, 4:23 p.m. OK Go TESTS 20 171 9420800
353088076 sin0 C Dec. 11, 2025, 4:24 p.m. OK Go TESTS 20 203 12595200
353098408 treasuryonly C Dec. 11, 2025, 5:37 p.m. OK Haskell TESTS 20 781 47206400
353092604 Smit_Soni C Dec. 11, 2025, 4:34 p.m. OK Java 21 TESTS 20 343 6246400
353091881 theparthgreat53 C Dec. 11, 2025, 4:32 p.m. OK Java 21 TESTS 20 343 7065600
353109644 sarachoudhary C Dec. 11, 2025, 6:53 p.m. OK Java 21 TESTS 20 359 5632000
353084686 Rishi160 C Dec. 11, 2025, 4:17 p.m. OK Java 21 TESTS 20 359 11776000
353138447 minibin C Dec. 12, 2025, 4:20 a.m. OK Java 21 TESTS 20 390 3072000
353112215 fatal-98 C Dec. 11, 2025, 7:17 p.m. OK Java 21 TESTS 20 406 4710400
353112774 fatal-98 C Dec. 11, 2025, 7:22 p.m. OK Java 21 TESTS 20 406 5017600
353098709 Azad_Singh C Dec. 11, 2025, 5:38 p.m. OK Java 21 TESTS 20 406 7372800
353109784 Yousef_Badr C Dec. 11, 2025, 6:54 p.m. OK Java 21 TESTS 20 406 9011200
353082977 Spencer1s C Dec. 11, 2025, 4:13 p.m. OK Java 21 TESTS 20 421 12902400
353083555 aditya_0013 C Dec. 11, 2025, 4:14 p.m. OK Java 8 TESTS 20 234 13824000
353088496 hitdepani C Dec. 11, 2025, 4:25 p.m. OK Java 8 TESTS 20 265 23654400
353088089 dinesh3000 C Dec. 11, 2025, 4:24 p.m. OK Java 8 TESTS 20 281 15667200
353085644 Ado90 C Dec. 11, 2025, 4:19 p.m. OK Java 8 TESTS 20 328 26112000
353085297 abhayrajnegi0416 C Dec. 11, 2025, 4:18 p.m. OK Java 8 TESTS 20 406 15155200
353119000 MAGNUS_KALICHARAN C Dec. 11, 2025, 8:36 p.m. OK Java 8 TESTS 20 500 0
353087160 PrathmeshCodess C Dec. 11, 2025, 4:23 p.m. OK Java 8 TESTS 20 625 21401600
353085039 Vishalll_ C Dec. 11, 2025, 4:18 p.m. OK Java 8 TESTS 20 671 20684800
353084573 srishtiagarwal892 C Dec. 11, 2025, 4:17 p.m. OK Java 8 TESTS 20 687 19558400
353115931 TriptiChaurasia C Dec. 11, 2025, 7:56 p.m. OK Java 8 TESTS 20 703 512000
353093034 jagbarrameda C Dec. 11, 2025, 4:34 p.m. OK Kotlin 2.2 TESTS 20 437 21811200
353084113 loukasabasaguettant C Dec. 11, 2025, 4:15 p.m. OK OCaml TESTS 20 421 8908800
353122185 jsaddict044 C Dec. 11, 2025, 9:26 p.m. OK PyPy 3 TESTS 20 640 45772800
353088763 SalicylicAcid C Dec. 11, 2025, 4:26 p.m. OK PyPy 3 TESTS 20 656 48435200
353107678 gopikrishna9968 C Dec. 11, 2025, 6:36 p.m. OK PyPy 3 TESTS 20 671 23961600
353090312 javoh1964 C Dec. 11, 2025, 4:29 p.m. OK PyPy 3 TESTS 20 703 40038400
353083849 Maverick07_ C Dec. 11, 2025, 4:15 p.m. OK PyPy 3 TESTS 20 750 56627200
353109197 opgod_07 C Dec. 11, 2025, 6:49 p.m. OK PyPy 3 TESTS 20 765 24166400
353135285 pyl_youngboy C Dec. 12, 2025, 3:27 a.m. OK PyPy 3 TESTS 20 781 37068800
353105506 cp_commando C Dec. 11, 2025, 6:21 p.m. OK PyPy 3 TESTS 20 859 28160000
353086931 Rhinedottir C Dec. 11, 2025, 4:22 p.m. OK PyPy 3 TESTS 20 921 38502400
353145019 ps2006 C Dec. 12, 2025, 5:29 a.m. OK PyPy 3 TESTS 20 937 46489600
353086885 Praneethrcls C Dec. 11, 2025, 4:22 p.m. OK PyPy 3-64 TESTS 20 187 29900800
353088942 mikiasgoitom7 C Dec. 11, 2025, 4:26 p.m. OK PyPy 3-64 TESTS 20 187 35225600
353099547 Jiangjiapei C Dec. 11, 2025, 5:43 p.m. OK PyPy 3-64 TESTS 20 203 27955200
353086467 CarViz C Dec. 11, 2025, 4:21 p.m. OK PyPy 3-64 TESTS 20 203 29388800
353139078 SirMrGuy C Dec. 12, 2025, 4:29 a.m. OK PyPy 3-64 TESTS 20 203 30310400
353085886 Shutcapybara C Dec. 11, 2025, 4:20 p.m. OK PyPy 3-64 TESTS 20 203 32051200
353107405 Sxwshi_ C Dec. 11, 2025, 6:34 p.m. OK PyPy 3-64 TESTS 20 203 34201600
353125941 amirhassanpour C Dec. 11, 2025, 10:58 p.m. OK PyPy 3-64 TESTS 20 203 34918400
353083700 keerthick1612 C Dec. 11, 2025, 4:15 p.m. OK PyPy 3-64 TESTS 20 203 36044800
353130216 baltasar C Dec. 12, 2025, 1:28 a.m. OK PyPy 3-64 TESTS 20 218 27648000
353111503 vedjaw C Dec. 11, 2025, 7:10 p.m. OK Python 2 TESTS 20 437 35635200
353083037 kumarshrid06 C Dec. 11, 2025, 4:13 p.m. OK Python 3 TESTS 20 218 32972800
353085639 yashnema52 C Dec. 11, 2025, 4:19 p.m. OK Python 3 TESTS 20 296 45260800
353099743 aashu.patidar9876 C Dec. 11, 2025, 5:44 p.m. OK Python 3 TESTS 20 296 57753600
353084631 watermine C Dec. 11, 2025, 4:17 p.m. OK Python 3 TESTS 20 312 53043200
353123184 Tetralix C Dec. 11, 2025, 9:45 p.m. OK Python 3 TESTS 20 359 26828800
353091102 anup06 C Dec. 11, 2025, 4:31 p.m. OK Python 3 TESTS 20 359 31232000
353142227 Ruiming_0822 C Dec. 12, 2025, 5:09 a.m. OK Python 3 TESTS 20 359 53145600
353138250 Sin_R0str0 C Dec. 12, 2025, 4:17 a.m. OK Python 3 TESTS 20 390 29081600
353087713 safiimran205 C Dec. 11, 2025, 4:24 p.m. OK Python 3 TESTS 20 406 45260800
353084596 Aakash-11 C Dec. 11, 2025, 4:17 p.m. OK Python 3 TESTS 20 421 35840000
353083372 Xeramian C Dec. 11, 2025, 4:14 p.m. OK Rust 2024 TESTS 20 93 3379200

remove filters

Back to search problems