Codeforces Round 1081 (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
2192 Codeforces Round 1081 (Div. 2) FINISHED False 7200 4721123 Feb. 21, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 10752 ) C All-in-one Gun PROGRAMMING binary search greedy math

You are developing a new shooter game, but since there are a lot of shooter games out there, you decide to have something unique in your game. You have an all-in-one gun that shoots bullets in a fixed order. There are (n) bullets in the magazine, the (i)-th of which deals (a_i) damage. The enemy starts with (h) health and dies when its health becomes (\le 0). The gun shoots one bullet per second. After firing all (n) bullets, it must reload, which takes (k) seconds. Reloading always restores the same sequence of bullets (a_1, a_2, \ldots, a_n). You cannot reload early; you must empty the magazine first. At the start, the magazine is already full. Before the fight begins, you may perform at most one swap: pick any indices (1 \le i \lt j \le n) and exchange (a_i) with (a_j). Your task is to find the minimum number of seconds needed to kill the enemy, taking into account this optional single swap. 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 testcase contains three integer (n), (h) and (k) ((2 \le n \le 2\cdot 10^5), (1 \le h, k \le 10^9)) — the size of magazine, health of your enemy and time required to reload the magazine. The second line of each testcase contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)). It is guaranteed that the sum of (n) does not exceed (2 \cdot 10^5) over all test cases. For each testcase, output a single integer denoting the minimum time required to kill the enemy. In the first test case, you swap the bullets present at index (2) and (5). This makes array (a) as (4, 3, 3, 5, 2). After (3) seconds, the health of your enemy will be (10 - 4 - 3 - 3 = 0), hence the enemy dies in (3) seconds. It can be shown that achieving time to kill less than (3) is not possib

Tutorials

Codeforces Round 1081 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
363921639 samirpsalim C Feb. 21, 2026, 7:20 p.m. OK C# 13 TESTS 15 109 32665600
363921060 samirpsalim C Feb. 21, 2026, 7:14 p.m. OK C# 13 TESTS 15 125 31027200
363895304 samirpsalim C Feb. 21, 2026, 4:14 p.m. OK C# 13 TESTS 15 140 36044800
363948130 tav.tuananh C Feb. 22, 2026, 3:25 a.m. OK C++17 (GCC 7-32) TESTS 15 62 0
363906843 Esnat_Jahan C Feb. 21, 2026, 5:20 p.m. OK C++17 (GCC 7-32) TESTS 15 62 0
363897718 sachinonly C Feb. 21, 2026, 4:20 p.m. OK C++17 (GCC 7-32) TESTS 15 62 0
363917589 emplist C Feb. 21, 2026, 6:41 p.m. OK C++17 (GCC 7-32) TESTS 15 62 102400
363910095 _amn17 C Feb. 21, 2026, 5:43 p.m. OK C++17 (GCC 7-32) TESTS 15 62 921600
363903105 savyshyn C Feb. 21, 2026, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 15 62 3276800
363953111 Adarsh_Jupudi C Feb. 22, 2026, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 15 78 0
363935731 baraa_el_baba C Feb. 21, 2026, 10:15 p.m. OK C++17 (GCC 7-32) TESTS 15 78 0
363915513 koushiksonu012 C Feb. 21, 2026, 6:23 p.m. OK C++17 (GCC 7-32) TESTS 15 78 0
363910629 Filipciakojan C Feb. 21, 2026, 5:47 p.m. OK C++17 (GCC 7-32) TESTS 15 78 0
363945318 Yassoor C Feb. 22, 2026, 2:15 a.m. OK C++20 (GCC 13-64) TESTS 15 46 102400
363932547 blueskie C Feb. 21, 2026, 9:22 p.m. OK C++20 (GCC 13-64) TESTS 15 46 921600
363907136 ShyamLDTC C Feb. 21, 2026, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 15 46 921600
363953618 Aranna C Feb. 22, 2026, 5:11 a.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363930385 Raze07 C Feb. 21, 2026, 8:52 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363915529 WhatsDerivative C Feb. 21, 2026, 6:24 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363909049 mita C Feb. 21, 2026, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363899245 gabriel2kk C Feb. 21, 2026, 4:24 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363898745 abhkjoshi13 C Feb. 21, 2026, 4:23 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363898564 __mpan-o-mer__ C Feb. 21, 2026, 4:22 p.m. OK C++20 (GCC 13-64) TESTS 15 62 0
363897458 Enfios C Feb. 21, 2026, 4:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 31 2662400
363907450 Prashant9759 C Feb. 21, 2026, 5:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 46 0
363953709 Navdeep2024 C Feb. 22, 2026, 5:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363938247 A_ashishk2006 C Feb. 21, 2026, 11:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363933530 Pos_E1 C Feb. 21, 2026, 9:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363931336 NothingHard C Feb. 21, 2026, 9:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363927466 nonamedd C Feb. 21, 2026, 8:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363927438 Karim__2 C Feb. 21, 2026, 8:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363925401 bandit07 C Feb. 21, 2026, 7:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363924034 varunsahu_07 C Feb. 21, 2026, 7:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 0
363937072 NenadDapic C Feb. 21, 2026, 10:42 p.m. OK FPC TESTS 15 62 4198400
363918729 1435730 C Feb. 21, 2026, 6:52 p.m. OK GNU C11 TESTS 15 78 2457600
363898573 K-Squared C Feb. 21, 2026, 4:22 p.m. OK GNU C11 TESTS 15 78 3174400
363950935 RoshanRam C Feb. 22, 2026, 4:24 a.m. OK GNU C11 TESTS 15 78 6451200
363906859 actualtsg C Feb. 21, 2026, 5:20 p.m. OK GNU C11 TESTS 15 78 7065600
363934280 abdallahyac06 C Feb. 21, 2026, 9:47 p.m. OK GNU C11 TESTS 15 93 3174400
363897122 argusvan C Feb. 21, 2026, 4:19 p.m. OK GNU C11 TESTS 15 93 3174400
363932457 abdallahyac06 C Feb. 21, 2026, 9:20 p.m. OK GNU C11 TESTS 15 109 1638400
363915531 Blaze_19 C Feb. 21, 2026, 6:24 p.m. OK GNU C11 TESTS 15 109 3788800
363896287 dhiraj_pgcat C Feb. 21, 2026, 4:17 p.m. OK GNU C11 TESTS 15 109 6451200
363901030 va.pogoreloff C Feb. 21, 2026, 4:28 p.m. OK Go TESTS 15 125 9011200
363952596 aniketHacker C Feb. 22, 2026, 4:53 a.m. OK Java 21 TESTS 15 234 512000
363919073 Abhishek_Gole C Feb. 21, 2026, 6:56 p.m. OK Java 21 TESTS 15 250 512000
363933576 shyamPrajapat C Feb. 21, 2026, 9:36 p.m. OK Java 21 TESTS 15 250 716800
363895477 vin_contra C Feb. 21, 2026, 4:14 p.m. OK Java 21 TESTS 15 250 4710400
363917696 Extradict C Feb. 21, 2026, 6:42 p.m. OK Java 21 TESTS 15 250 18022400
363895810 supashC C Feb. 21, 2026, 4:15 p.m. OK Java 21 TESTS 15 265 1433600
363903824 RuAyu C Feb. 21, 2026, 4:34 p.m. OK Java 21 TESTS 15 265 1740800
363900250 barbarian C Feb. 21, 2026, 4:26 p.m. OK Java 21 TESTS 15 265 2560000
363895045 akasmik C Feb. 21, 2026, 4:13 p.m. OK Java 21 TESTS 15 265 3174400
363903574 Pratyush070105 C Feb. 21, 2026, 4:34 p.m. OK Java 21 TESTS 15 265 3276800
363900846 from_zero_cp C Feb. 21, 2026, 4:28 p.m. OK Java 8 TESTS 15 140 5734400
363948036 ZhangQingze C Feb. 22, 2026, 3:24 a.m. OK Java 8 TESTS 15 156 3379200
363912729 aditya2347 C Feb. 21, 2026, 6:02 p.m. OK Java 8 TESTS 15 156 6860800
363912637 random2347 C Feb. 21, 2026, 6:01 p.m. OK Java 8 TESTS 15 156 6860800
363896372 saptarshi.dev.20 C Feb. 21, 2026, 4:17 p.m. OK Java 8 TESTS 15 171 5427200
363919238 TheJavaGuy C Feb. 21, 2026, 6:57 p.m. OK Java 8 TESTS 15 171 6860800
363944014 AchalVishnoi C Feb. 22, 2026, 1:48 a.m. OK Java 8 TESTS 15 187 3481600
363898249 yashu_rai C Feb. 21, 2026, 4:21 p.m. OK Java 8 TESTS 15 203 7270400
363900867 TheJavaGuy C Feb. 21, 2026, 4:28 p.m. OK Java 8 TESTS 15 265 7577600
363894256 pmustaq831 C Feb. 21, 2026, 4:11 p.m. OK Java 8 TESTS 15 421 0
363902041 pravin82 C Feb. 21, 2026, 4:30 p.m. OK Kotlin 1.9 TESTS 15 296 16691200
363893992 jagbarrameda C Feb. 21, 2026, 4:11 p.m. OK Kotlin 2.2 TESTS 15 265 25292800
363912264 06tron C Feb. 21, 2026, 5:58 p.m. OK Node.js TESTS 15 171 27340800
363911882 gabiluciu C Feb. 21, 2026, 5:55 p.m. OK Node.js TESTS 15 546 56934400
363941092 shdwnvrmr C Feb. 22, 2026, 12:27 a.m. OK PyPy 3 TESTS 15 421 24268800
363956716 shrigs03 C Feb. 22, 2026, 5:57 a.m. OK PyPy 3 TESTS 15 531 18124800
363897706 sahildhillon247 C Feb. 21, 2026, 4:20 p.m. OK PyPy 3 TESTS 15 578 24371200
363896304 sahildhillon90 C Feb. 21, 2026, 4:17 p.m. OK PyPy 3 TESTS 15 578 24576000
363906975 PrathamB_math C Feb. 21, 2026, 5:20 p.m. OK PyPy 3 TESTS 15 578 25395200
363897344 Hallowno4 C Feb. 21, 2026, 4:19 p.m. OK PyPy 3 TESTS 15 687 24268800
363902963 nithish1030 C Feb. 21, 2026, 4:32 p.m. OK PyPy 3-64 TESTS 15 125 28569600
363902463 san1ternma C Feb. 21, 2026, 4:31 p.m. OK PyPy 3-64 TESTS 15 140 26214400
363899739 walbertho.mc C Feb. 21, 2026, 4:25 p.m. OK PyPy 3-64 TESTS 15 140 26931200
363910002 opankit C Feb. 21, 2026, 5:42 p.m. OK PyPy 3-64 TESTS 15 156 29388800
363894772 Only365 C Feb. 21, 2026, 4:13 p.m. OK PyPy 3-64 TESTS 15 171 20684800
363904247 harshinikakunuri8 C Feb. 21, 2026, 4:34 p.m. OK PyPy 3-64 TESTS 15 171 26214400
363912860 kitchau_hcmus C Feb. 21, 2026, 6:03 p.m. OK PyPy 3-64 TESTS 15 171 26521600
363904251 zxyaditya C Feb. 21, 2026, 4:34 p.m. OK PyPy 3-64 TESTS 15 171 26521600
363944210 Ravinder-codes C Feb. 22, 2026, 1:54 a.m. OK PyPy 3-64 TESTS 15 171 26624000
363948762 michael3437 C Feb. 22, 2026, 3:38 a.m. OK PyPy 3-64 TESTS 15 171 28467200
363896320 QuantIM C Feb. 21, 2026, 4:17 p.m. OK Python 3 TESTS 15 125 25395200
363901149 JashCodes C Feb. 21, 2026, 4:28 p.m. OK Python 3 TESTS 15 140 25497600
363899787 harshitbhandari0318 C Feb. 21, 2026, 4:25 p.m. OK Python 3 TESTS 15 140 25804800
363925326 SergiiKo C Feb. 21, 2026, 7:56 p.m. OK Python 3 TESTS 15 171 26726400
363898194 gajanan_5602 C Feb. 21, 2026, 4:21 p.m. OK Python 3 TESTS 15 171 26726400
363893803 vedsys C Feb. 21, 2026, 4:10 p.m. OK Python 3 TESTS 15 187 26726400
363899381 ComaTrain C Feb. 21, 2026, 4:24 p.m. OK Python 3 TESTS 15 187 35737600
363925149 kartikeyanrai C Feb. 21, 2026, 7:53 p.m. OK Python 3 TESTS 15 203 26521600
363898978 crazy_bitch_03 C Feb. 21, 2026, 4:23 p.m. OK Python 3 TESTS 15 203 26726400
363899602 tuanduong C Feb. 21, 2026, 4:25 p.m. OK Python 3 TESTS 15 203 32665600
363951827 redgex C Feb. 22, 2026, 4:39 a.m. OK Rust 2024 TESTS 15 46 11776000
363939010 smf C Feb. 21, 2026, 11:27 p.m. OK Rust 2024 TESTS 15 46 14540800
363938398 _JG_ C Feb. 21, 2026, 11:14 p.m. OK Rust 2024 TESTS 15 93 11776000
363938518 _JG_ C Feb. 21, 2026, 11:16 p.m. OK Rust 2024 TESTS 15 109 11776000

remove filters

Back to search problems