Codeforces Round 1044 (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
2133 Codeforces Round 1044 (Div. 2) FINISHED False 7200 20359523 Aug. 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 7435 ) D Chicken Jockey PROGRAMMING binary search brute force dp greedy math

Steve made the foolish decision to mine at night, and came across a monstrous creature: the chicken jockey (^n)! A chicken jockey(^n) consists of (n) mobs stacked in order on top of each other, with mob (1) at the bottom and mob (n) at the top. Mob (i) initially has (h_i) health. In one attack, Steve can deal (1) damage to any mob. If any mob reaches (0) or less health, it dies, and all the mobs on top of it fall down and form a new stack. The bottom mob in the new stack takes (1) fall damage for every mob it was on top of before falling (i.e. the number of mobs below it in the previous stack, including the one that just died). This may kill it as well, in which case all mobs on top of it fall down again and the process repeats. For example, consider a chicken jockey(^6) with initial mob healths (1, 2, 1, 3, 5, 2). If Steve damages the third mob in the stack, it dies and the mobs with health (3, 5, 2) fall down in a new stack. The bottom mob takes (3) units of fall damage so it also dies, and the mobs with health (5, 2) fall down in a new stack. The bottom mob takes (1) unit of fall damage. As a result, after Steve's first attack, there will be two stacks with healths (1, 2) and (4, 2). Steve's sword's durability is low, so he wishes to know the minimum attacks required to kill all the mobs. 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) ((2 \le n \le 2 \cdot 10^5)) — the number of mobs. The second line of each test case contains (n) integers (h_1, h_2,\ldots, h_n) ((1 \le h_i \le 10^9)) — the initial health of each mob. 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 minimum atta

Tutorials

Codeforces Round 1044 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335442960 Equinox_Ya D Aug. 25, 2025, 4:30 a.m. OK C# 13 TESTS 17 140 819200
335448790 dauhang494 D Aug. 25, 2025, 5:50 a.m. OK C++17 (GCC 7-32) TESTS 17 77 0
335421102 Hiya1055 D Aug. 24, 2025, 8:51 p.m. OK C++17 (GCC 7-32) TESTS 17 77 0
335419367 vik2_ D Aug. 24, 2025, 8:24 p.m. OK C++17 (GCC 7-32) TESTS 17 77 0
335431191 Panyang D Aug. 25, 2025, 1:34 a.m. OK C++17 (GCC 7-32) TESTS 17 77 204800
335419636 hamdymo_93 D Aug. 24, 2025, 8:27 p.m. OK C++17 (GCC 7-32) TESTS 17 77 921600
335433300 Pirate88 D Aug. 25, 2025, 2:13 a.m. OK C++17 (GCC 7-32) TESTS 17 77 2457600
335446968 ihapiw D Aug. 25, 2025, 5:27 a.m. OK C++17 (GCC 7-32) TESTS 17 77 3276800
335449385 Dipole23 D Aug. 25, 2025, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 17 78 0
335442058 himadri765 D Aug. 25, 2025, 4:15 a.m. OK C++17 (GCC 7-32) TESTS 17 78 0
335439574 little_beetle D Aug. 25, 2025, 3:33 a.m. OK C++17 (GCC 7-32) TESTS 17 78 0
335402896 LRC11 D Aug. 24, 2025, 5:44 p.m. OK C++20 (GCC 13-64) TESTS 17 62 0
335430917 4NaHCO3 D Aug. 25, 2025, 1:28 a.m. OK C++20 (GCC 13-64) TESTS 17 62 3276800
335449233 tripathirajul0802 D Aug. 25, 2025, 5:55 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335447689 itsiftikar02 D Aug. 25, 2025, 5:37 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335446184 stevewayne478 D Aug. 25, 2025, 5:17 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335445868 travel. D Aug. 25, 2025, 5:12 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335445756 AS23 D Aug. 25, 2025, 5:11 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335445383 ag._. D Aug. 25, 2025, 5:06 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335443931 jai_hanumant D Aug. 25, 2025, 4:44 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335439949 SandTea D Aug. 25, 2025, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 17 77 0
335438831 Vivek15Sahu D Aug. 25, 2025, 3:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 61 1843200
335430807 Whitecarrot D Aug. 25, 2025, 1:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 0
335403246 zeemanz D Aug. 24, 2025, 5:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 0
335437367 Little_Sheep_Yawn D Aug. 25, 2025, 3:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 102400
335436979 j30 D Aug. 25, 2025, 3 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 102400
335429284 Bahy. D Aug. 25, 2025, 12:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 102400
335439086 creepeer D Aug. 25, 2025, 3:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 62 5632000
335448821 Atlansesrt D Aug. 25, 2025, 5:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 77 0
335447774 stack_overload D Aug. 25, 2025, 5:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 77 0
335446769 StoneXie D Aug. 25, 2025, 5:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 77 0
335402949 rainboy D Aug. 24, 2025, 5:44 p.m. OK GNU C11 TESTS 17 77 102400
335402160 rainboy D Aug. 24, 2025, 5:39 p.m. OK GNU C11 TESTS 17 92 921600
335397009 vinygoat D Aug. 24, 2025, 4:33 p.m. OK GNU C11 TESTS 17 108 1638400
335391988 glebsamsonov D Aug. 24, 2025, 4:22 p.m. OK Go TESTS 17 140 5836800
335441267 silicalet D Aug. 25, 2025, 4:01 a.m. OK Haskell TESTS 17 905 55603200
335402550 stevie1024 D Aug. 24, 2025, 5:42 p.m. OK Haskell TESTS 17 936 55603200
335392636 ryuk_baba D Aug. 24, 2025, 4:24 p.m. OK Java 21 TESTS 17 265 307200
335429795 mastacoda D Aug. 25, 2025, 1:02 a.m. OK Java 21 TESTS 17 280 614400
335395060 SaurabhBansal D Aug. 24, 2025, 4:29 p.m. OK Java 21 TESTS 17 281 1024000
335417550 AJ_Forces D Aug. 24, 2025, 7:59 p.m. OK Java 21 TESTS 17 296 102400
335389452 finalboss_20 D Aug. 24, 2025, 4:16 p.m. OK Java 21 TESTS 17 296 819200
335391066 wenbozh D Aug. 24, 2025, 4:20 p.m. OK Java 21 TESTS 17 312 409600
335415452 sahasrad D Aug. 24, 2025, 7:32 p.m. OK Java 21 TESTS 17 312 1536000
335407115 coder-beer D Aug. 24, 2025, 6:13 p.m. OK Java 21 TESTS 17 327 819200
335406214 amayank18 D Aug. 24, 2025, 6:06 p.m. OK Java 21 TESTS 17 327 1331200
335391516 Shivam_1021 D Aug. 24, 2025, 4:21 p.m. OK Java 21 TESTS 17 342 716800
335388788 sorter D Aug. 24, 2025, 4:15 p.m. OK Java 8 TESTS 17 218 3584000
335394949 ironspec D Aug. 24, 2025, 4:29 p.m. OK Java 8 TESTS 17 218 3686400
335402062 xmjlove D Aug. 24, 2025, 5:39 p.m. OK Java 8 TESTS 17 233 6758400
335422635 testtest111ksjfrdvn D Aug. 24, 2025, 9:22 p.m. OK Java 8 TESTS 17 234 29286400
335404694 kamranm D Aug. 24, 2025, 5:56 p.m. OK Java 8 TESTS 17 265 225792000
335412175 kasiru_69 D Aug. 24, 2025, 6:57 p.m. OK Java 8 TESTS 17 280 16691200
335391347 ujwalcoderhunter D Aug. 24, 2025, 4:21 p.m. OK Java 8 TESTS 17 468 0
335394166 ayush_chaudhary23 D Aug. 24, 2025, 4:27 p.m. OK Java 8 TESTS 17 593 0
335389268 Abhishek_7909 D Aug. 24, 2025, 4:16 p.m. OK Mono C# TESTS 17 156 20480000
335421699 RonnieChen D Aug. 24, 2025, 9:02 p.m. OK PyPy 3 TESTS 17 296 22323200
335402302 Fishion D Aug. 24, 2025, 5:40 p.m. OK PyPy 3 TESTS 17 311 22630400
335419492 Manvendra27 D Aug. 24, 2025, 8:25 p.m. OK PyPy 3 TESTS 17 312 22220800
335389001 _PD_ D Aug. 24, 2025, 4:15 p.m. OK PyPy 3 TESTS 17 374 19353600
335404486 vermakunal088 D Aug. 24, 2025, 5:54 p.m. OK PyPy 3 TESTS 17 374 22220800
335425405 amirhassanpour D Aug. 24, 2025, 10:34 p.m. OK PyPy 3-64 TESTS 17 140 21094400
335427606 gardengnome D Aug. 24, 2025, 11:54 p.m. OK PyPy 3-64 TESTS 17 140 26624000
335428875 monocrap D Aug. 25, 2025, 12:34 a.m. OK PyPy 3-64 TESTS 17 140 26931200
335417994 Leo25Darklight D Aug. 24, 2025, 8:05 p.m. OK PyPy 3-64 TESTS 17 140 27852800
335394594 Mukundan314 D Aug. 24, 2025, 4:28 p.m. OK PyPy 3-64 TESTS 17 155 26726400
335391165 PIYOOSH279 D Aug. 24, 2025, 4:20 p.m. OK PyPy 3-64 TESTS 17 155 31436800
335408268 hxu10 D Aug. 24, 2025, 6:22 p.m. OK PyPy 3-64 TESTS 17 171 27648000
335447388 kelvinp D Aug. 25, 2025, 5:32 a.m. OK PyPy 3-64 TESTS 17 171 28467200
335421715 blitzbyte07 D Aug. 24, 2025, 9:03 p.m. OK PyPy 3-64 TESTS 17 186 26624000
335443468 Bakytz7zaN D Aug. 25, 2025, 4:37 a.m. OK PyPy 3-64 TESTS 17 186 27238400
335393996 lovya_006 D Aug. 24, 2025, 4:27 p.m. OK Python 3 TESTS 17 140 26726400
335388455 tanishasingh7 D Aug. 24, 2025, 4:14 p.m. OK Python 3 TESTS 17 171 26521600
335391068 ItsMePV D Aug. 24, 2025, 4:20 p.m. OK Python 3 TESTS 17 171 26624000
335421431 MadhavPeddi D Aug. 24, 2025, 8:57 p.m. OK Python 3 TESTS 17 186 26521600
335396172 dpaladiyaa D Aug. 24, 2025, 4:31 p.m. OK Python 3 TESTS 17 202 24678400
335393339 HiaGo4 D Aug. 24, 2025, 4:25 p.m. OK Python 3 TESTS 17 233 25497600
335395363 twngzxc D Aug. 24, 2025, 4:30 p.m. OK Python 3 TESTS 17 233 26521600
335394262 coderrg21 D Aug. 24, 2025, 4:27 p.m. OK Python 3 TESTS 17 264 26828800
335442669 golu20062004 D Aug. 25, 2025, 4:25 a.m. OK Python 3 TESTS 17 265 26419200
335442072 rishu_iitd D Aug. 25, 2025, 4:15 a.m. OK Python 3 TESTS 17 265 26419200
335397359 yaoyitao D Aug. 24, 2025, 4:34 p.m. OK Rust 2021 TESTS 17 93 2355200
335407612 ardririy D Aug. 24, 2025, 6:17 p.m. OK Rust 2024 TESTS 17 62 4403200
335436725 silicalet D Aug. 25, 2025, 2:56 a.m. OK Rust 2024 TESTS 17 77 2457600
335406850 ardririy D Aug. 24, 2025, 6:11 p.m. OK Rust 2024 TESTS 17 77 4300800

remove filters

Back to search problems