Codeforces Round 899 (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
1882 Codeforces Round 899 (Div. 2) FINISHED False 7200 36170699 Sept. 25, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12518 ) C Card Game PROGRAMMING dp greedy

B'There are n cards stacked in a deck. Initially, a_{i} is written on the i -th card from the top. The value written on a card does not change. You will play a game. Initially your score is 0 . In each turn, you can do one of the following operations: What is the maximum score you can get when the game ends? ^{ dagger} An integer i is odd, if there exists an integer k such that i = 2k + 1 . ^{ ddagger} An integer i is even, if there exists an integer k such that i = 2k . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^{4} ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^{5} ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( -10^{9} <= a_i <= 10^{9} ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^{5} . For each test case, print a single integer -- the maximum score you can get when the game ends. In the first test case, one can get the score of 5 as follows: In the second test case, one can get the score of 4 as follows: In the third test case, one can get the score of 2 as follows: '...

Tutorials

Codeforces Round 899 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
225148203 hoakg2000 C Sept. 25, 2023, 4:19 p.m. OK C# 10 TESTS 26 93 27443200
225203053 mban259 C Sept. 26, 2023, 3:42 a.m. OK C# 10 TESTS 26 171 29388800
225149227 ruban C Sept. 25, 2023, 4:22 p.m. OK FPC TESTS 26 92 56012800
225184510 THK_is_dead C Sept. 25, 2023, 9:37 p.m. OK GNU C11 TESTS 26 62 1638400
225184636 THK_is_dead C Sept. 25, 2023, 9:39 p.m. OK GNU C11 TESTS 26 62 1638400
225154255 jhmm1905 C Sept. 25, 2023, 4:34 p.m. OK GNU C11 TESTS 26 78 1638400
225144283 kibergrad C Sept. 25, 2023, 4:09 p.m. OK GNU C11 TESTS 26 904 3174400
225210438 a999999 C Sept. 26, 2023, 5:34 a.m. OK GNU C++14 TESTS 26 31 2867200
225196787 lyxtyl C Sept. 26, 2023, 2:05 a.m. OK GNU C++14 TESTS 26 62 819200
225194353 Andy23 C Sept. 26, 2023, 1:19 a.m. OK GNU C++14 TESTS 26 62 819200
225191739 OvO_Zuo C Sept. 26, 2023, 12:27 a.m. OK GNU C++14 TESTS 26 62 819200
225197481 iterater C Sept. 26, 2023, 2:17 a.m. OK GNU C++14 TESTS 26 62 819200
225198143 huanghongye C Sept. 26, 2023, 2:28 a.m. OK GNU C++14 TESTS 26 62 921600
225174694 mycfhandle C Sept. 25, 2023, 7:24 p.m. OK GNU C++14 TESTS 26 62 1638400
225164362 Anonymous369 C Sept. 25, 2023, 5:52 p.m. OK GNU C++14 TESTS 26 62 2048000
225197627 CyberDog C Sept. 26, 2023, 2:20 a.m. OK GNU C++14 TESTS 26 77 819200
225210219 M.Abdalkreem C Sept. 26, 2023, 5:32 a.m. OK GNU C++14 TESTS 26 77 819200
225178186 expertaq C Sept. 25, 2023, 8:03 p.m. OK GNU C++17 TESTS 26 61 819200
225199663 jiangnaihui C Sept. 26, 2023, 2:51 a.m. OK GNU C++17 TESTS 26 62 819200
225151753 neweight-gs21107 C Sept. 25, 2023, 4:28 p.m. OK GNU C++17 TESTS 26 62 1536000
225212322 cz816 C Sept. 26, 2023, 5:58 a.m. OK GNU C++17 TESTS 26 62 2048000
225206838 Touhid47 C Sept. 26, 2023, 4:44 a.m. OK GNU C++17 TESTS 26 62 2457600
225148261 akshat.singh C Sept. 25, 2023, 4:19 p.m. OK GNU C++17 TESTS 26 62 5120000
225151940 Tyue C Sept. 25, 2023, 4:29 p.m. OK GNU C++17 TESTS 26 77 0
225206901 2020MT10845 C Sept. 26, 2023, 4:45 a.m. OK GNU C++17 TESTS 26 77 0
225207588 Touhid47 C Sept. 26, 2023, 4:56 a.m. OK GNU C++17 TESTS 26 77 819200
225212426 RGLxAkuma C Sept. 26, 2023, 5:59 a.m. OK GNU C++17 TESTS 26 77 819200
225160632 TreaBoy C Sept. 25, 2023, 5:25 p.m. OK GNU C++17 (64) TESTS 26 46 819200
225205065 Abs_ C Sept. 26, 2023, 4:15 a.m. OK GNU C++17 (64) TESTS 26 46 819200
225198854 yyyyyd C Sept. 26, 2023, 2:39 a.m. OK GNU C++17 (64) TESTS 26 46 819200
225184199 enslaved C Sept. 25, 2023, 9:32 p.m. OK GNU C++17 (64) TESTS 26 46 819200
225177147 camc C Sept. 25, 2023, 7:50 p.m. OK GNU C++17 (64) TESTS 26 46 819200
225164838 Kasraa C Sept. 25, 2023, 5:56 p.m. OK GNU C++17 (64) TESTS 26 46 819200
225152121 aidwer C Sept. 25, 2023, 4:29 p.m. OK GNU C++17 (64) TESTS 26 46 819200
225203084 Sempr C Sept. 26, 2023, 3:42 a.m. OK GNU C++17 (64) TESTS 26 46 921600
225201100 dlwocks31 C Sept. 26, 2023, 3:13 a.m. OK GNU C++17 (64) TESTS 26 46 1638400
225207176 SakiBee C Sept. 26, 2023, 4:49 a.m. OK GNU C++17 (64) TESTS 26 46 1638400
225144527 palsatyam877 C Sept. 25, 2023, 4:09 p.m. OK GNU C++20 (64) TESTS 26 31 1638400
225186779 MostafaY C Sept. 25, 2023, 10:17 p.m. OK GNU C++20 (64) TESTS 26 31 1638400
225147478 yazan_pro2 C Sept. 25, 2023, 4:17 p.m. OK GNU C++20 (64) TESTS 26 31 2457600
225168814 Eeezoe C Sept. 25, 2023, 6:28 p.m. OK GNU C++20 (64) TESTS 26 31 9216000
225144611 wlh666 C Sept. 25, 2023, 4:09 p.m. OK GNU C++20 (64) TESTS 26 31 9625600
225193108 bhdtr C Sept. 26, 2023, 12:55 a.m. OK GNU C++20 (64) TESTS 26 31 9625600
225203963 aryaraj C Sept. 26, 2023, 3:56 a.m. OK GNU C++20 (64) TESTS 26 46 0
225201960 AL70SSAIN C Sept. 26, 2023, 3:25 a.m. OK GNU C++20 (64) TESTS 26 46 0
225199842 AVAVA C Sept. 26, 2023, 2:54 a.m. OK GNU C++20 (64) TESTS 26 46 0
225178843 Abs_Shagor99 C Sept. 25, 2023, 8:11 p.m. OK GNU C++20 (64) TESTS 26 46 0
225188060 theSSS C Sept. 25, 2023, 10:47 p.m. OK Java 11 TESTS 26 217 3072000
225173391 TCchen C Sept. 25, 2023, 7:11 p.m. OK Java 11 TESTS 26 249 3174400
225195861 wdjuruo C Sept. 26, 2023, 1:48 a.m. OK Java 11 TESTS 26 452 0
225205674 zopchur C Sept. 26, 2023, 4:25 a.m. OK Java 11 TESTS 26 467 0
225171798 sb233 C Sept. 25, 2023, 6:56 p.m. OK Java 11 TESTS 26 468 0
225153702 Leenelmir C Sept. 25, 2023, 4:33 p.m. OK Java 11 TESTS 26 514 0
225149717 PlayDate C Sept. 25, 2023, 4:23 p.m. OK Java 11 TESTS 26 514 0
225149390 naitik.ntn2001 C Sept. 25, 2023, 4:22 p.m. OK Java 11 TESTS 26 530 0
225168746 TheLastDanceCoder C Sept. 25, 2023, 6:27 p.m. OK Java 17 TESTS 26 264 4403200
225196229 Harwinvanak C Sept. 26, 2023, 1:55 a.m. OK Java 17 TESTS 26 265 2969600
225189503 Harwinvanak C Sept. 25, 2023, 11:26 p.m. OK Java 17 TESTS 26 280 5017600
225153574 shashankp10 C Sept. 25, 2023, 4:33 p.m. OK Java 17 TESTS 26 280 6963200
225162222 ikun111 C Sept. 25, 2023, 5:37 p.m. OK Java 17 TESTS 26 280 23244800
225196463 Harwinvanak C Sept. 26, 2023, 1:59 a.m. OK Java 17 TESTS 26 296 3584000
225186446 1isGreaterThan0 C Sept. 25, 2023, 10:10 p.m. OK Java 17 TESTS 26 296 4403200
225194107 LeetCodeforces_Null C Sept. 26, 2023, 1:15 a.m. OK Java 17 TESTS 26 296 5529600
225188414 dzhi C Sept. 25, 2023, 10:56 p.m. OK Java 17 TESTS 26 296 8294400
225209655 AKhacks C Sept. 26, 2023, 5:24 a.m. OK Java 17 TESTS 26 311 4096000
225158692 Ligh0x74 C Sept. 25, 2023, 5:13 p.m. OK Java 21 TESTS 26 265 3686400
225145144 coding_octopus C Sept. 25, 2023, 4:11 p.m. OK Java 21 TESTS 26 592 0
225202227 Zhanzhe_Lee C Sept. 26, 2023, 3:29 a.m. OK Java 8 TESTS 26 140 11161600
225208328 Nanthakumar06 C Sept. 26, 2023, 5:07 a.m. OK Java 8 TESTS 26 155 11161600
225156895 tiwariabhishek C Sept. 25, 2023, 5:04 p.m. OK Java 8 TESTS 26 155 11161600
225148373 Mohamed_Ahmed C Sept. 25, 2023, 4:20 p.m. OK Java 8 TESTS 26 156 11161600
225161304 laksj113 C Sept. 25, 2023, 5:30 p.m. OK Java 8 TESTS 26 170 9113600
225147268 arutsudar C Sept. 25, 2023, 4:17 p.m. OK Java 8 TESTS 26 171 9113600
225162920 NerfThis C Sept. 25, 2023, 5:42 p.m. OK Java 8 TESTS 26 171 11059200
225179431 imstark007 C Sept. 25, 2023, 8:18 p.m. OK Java 8 TESTS 26 171 11264000
225151012 EliudGarcia2004 C Sept. 25, 2023, 4:26 p.m. OK Java 8 TESTS 26 171 14540800
225173276 Sumitsingh7 C Sept. 25, 2023, 7:10 p.m. OK Java 8 TESTS 26 186 7475200
225207994 YMSeah C Sept. 26, 2023, 5:02 a.m. OK JavaScript TESTS 26 124 20377600
225209671 YMSeah C Sept. 26, 2023, 5:24 a.m. OK JavaScript TESTS 26 577 40652800
225182532 Alexit C Sept. 25, 2023, 9:03 p.m. OK MS C++ 2017 TESTS 26 218 1638400
225153000 PurpleThomas C Sept. 25, 2023, 4:32 p.m. OK MS C++ 2017 TESTS 26 218 3891200
225146149 Gaurav1 C Sept. 25, 2023, 4:14 p.m. OK PyPy 2 TESTS 26 280 19353600
225158212 sksshivam007 C Sept. 25, 2023, 5:11 p.m. OK PyPy 2 TESTS 26 374 32563200
225167740 Keval_78 C Sept. 25, 2023, 6:19 p.m. OK PyPy 3 TESTS 26 311 84275200
225145967 DRDIV C Sept. 25, 2023, 4:13 p.m. OK PyPy 3 TESTS 26 374 24985600
225154169 bkdn23.thuonguyenvan C Sept. 25, 2023, 4:34 p.m. OK PyPy 3 TESTS 26 389 22220800
225174598 vainlab C Sept. 25, 2023, 7:23 p.m. OK PyPy 3 TESTS 26 452 19046400
225157390 re-wa-tl-ok C Sept. 25, 2023, 5:07 p.m. OK PyPy 3 TESTS 26 483 22528000
225171070 Shadow___Monarch C Sept. 25, 2023, 6:49 p.m. OK PyPy 3 TESTS 26 592 19046400
225176375 l0stempl3 C Sept. 25, 2023, 7:42 p.m. OK PyPy 3-64 TESTS 26 109 30617600
225208195 dodobow C Sept. 26, 2023, 5:05 a.m. OK PyPy 3-64 TESTS 26 139 31539200
225208836 grente C Sept. 26, 2023, 5:13 a.m. OK PyPy 3-64 TESTS 26 140 22118400
225168338 DarkTemplarDrop C Sept. 25, 2023, 6:24 p.m. OK PyPy 3-64 TESTS 26 140 23142400
225209133 yefe162 C Sept. 26, 2023, 5:17 a.m. OK PyPy 3-64 TESTS 26 140 27136000
225156560 mikeac C Sept. 25, 2023, 5:03 p.m. OK PyPy 3-64 TESTS 26 140 27136000
225149317 broshen C Sept. 25, 2023, 4:22 p.m. OK PyPy 3-64 TESTS 26 140 28467200
225176809 Mars_FN C Sept. 25, 2023, 7:47 p.m. OK PyPy 3-64 TESTS 26 140 28672000
225181101 AyuAnchor C Sept. 25, 2023, 8:40 p.m. OK PyPy 3-64 TESTS 26 140 29184000
225181080 2025 C Sept. 25, 2023, 8:39 p.m. OK PyPy 3-64 TESTS 26 140 29184000
225181748 VioletVal C Sept. 25, 2023, 8:50 p.m. OK Python 3 TESTS 26 124 28672000
225179221 Amro_Sous C Sept. 25, 2023, 8:15 p.m. OK Python 3 TESTS 26 124 28672000
225175032 alexpods C Sept. 25, 2023, 7:27 p.m. OK Python 3 TESTS 26 124 28672000
225182369 tanishq2507 C Sept. 25, 2023, 9 p.m. OK Python 3 TESTS 26 139 26521600
225146449 Volodya_Dudchak C Sept. 25, 2023, 4:14 p.m. OK Python 3 TESTS 26 139 29184000
225151707 Akshar_7 C Sept. 25, 2023, 4:28 p.m. OK Python 3 TESTS 26 140 26828800
225152518 bayibo C Sept. 25, 2023, 4:30 p.m. OK Python 3 TESTS 26 140 28672000
225160242 FannyMagnet C Sept. 25, 2023, 5:23 p.m. OK Python 3 TESTS 26 155 27136000
225194993 GodSerena C Sept. 26, 2023, 1:31 a.m. OK Python 3 TESTS 26 155 28672000
225149962 mh__mh C Sept. 25, 2023, 4:24 p.m. OK Python 3 TESTS 26 156 26828800
225203134 immccn123 C Sept. 26, 2023, 3:43 a.m. OK Rust 2021 TESTS 26 46 9523200
225152961 Rajveer_100 C Sept. 25, 2023, 4:31 p.m. OK Rust 2021 TESTS 26 46 18534400
225162839 mihael1peklar C Sept. 25, 2023, 5:41 p.m. OK Rust 2021 TESTS 26 77 6963200
225163214 0npata C Sept. 25, 2023, 5:44 p.m. OK Rust 2021 TESTS 26 77 7372800

remove filters

Back to search problems