VK Cup 2022 - Финальный раунд (Engine)

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
1784 VK Cup 2022 - Финальный раунд (Engine) FINISHED False 10800 56224499 Feb. 5, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15261 ) A Monsters (easy version) PROGRAMMING greedy

B"This is the easy version of the problem. In this version, you only need to find the answer once. In this version, hacks are not allowed. In a computer game, you are fighting against n monsters. Monster number i has a_i health points, all a_i are integers. A monster is alive while it has at least 1 health point. You can cast spells of two types: Dealing 1 damage to a monster reduces its health by 1 . Spells of type 1 can be cast any number of times, while a spell of type 2 can be cast at most once during the game. What is the smallest number of times you need to cast spells of type 1 to kill all monsters? 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. Each test case consists of two lines. The first line contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of monsters. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- monsters' health points. 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 smallest number of times you need to cast spells of type 1 to kill all monsters. In the first test case, the initial health points of the monsters are [3, 1, 2] . It is enough to cast a spell of type 2: Since it is possible to use no spells of type 1 at all, the answer is 0 . In the second test case, the initial health points of the monsters are [4, 1, 5, 4, 1, 1] . Here is one of the optimal action sequences: Spells of type 1 are cast 4 times in total. It can be shown that this is the smallest possible number. "...

Tutorials

Codeforces Round #850 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
192408837 Six_San A Feb. 6, 2023, 12:58 a.m. OK FPC TESTS 35 62 3174400
192425858 c20231020__ A Feb. 6, 2023, 5:56 a.m. OK GNU C++14 TESTS 35 31 2867200
192415342 LJB00126 A Feb. 6, 2023, 3:12 a.m. OK GNU C++14 TESTS 35 62 819200
192415334 HedgehogOwO A Feb. 6, 2023, 3:12 a.m. OK GNU C++14 TESTS 35 77 1638400
192409941 baiABC A Feb. 6, 2023, 1:24 a.m. OK GNU C++14 TESTS 35 78 819200
192425025 xxxyyyzzz A Feb. 6, 2023, 5:46 a.m. OK GNU C++14 TESTS 35 78 1638400
192415952 rui_er A Feb. 6, 2023, 3:23 a.m. OK GNU C++14 TESTS 35 78 1638400
192415908 intmain111 A Feb. 6, 2023, 3:22 a.m. OK GNU C++14 TESTS 35 78 1638400
192404245 zltzlt A Feb. 5, 2023, 11:14 p.m. OK GNU C++14 TESTS 35 78 1638400
192408467 william556 A Feb. 6, 2023, 12:49 a.m. OK GNU C++14 TESTS 35 78 2457600
192412437 hellolin A Feb. 6, 2023, 2:19 a.m. OK GNU C++14 TESTS 35 93 819200
192377838 Azimjonm0012 A Feb. 5, 2023, 6 p.m. OK GNU C++17 TESTS 35 31 2867200
192417227 kidcodeforces A Feb. 6, 2023, 3:46 a.m. OK GNU C++17 TESTS 35 62 819200
192383717 HaroldVemeno A Feb. 5, 2023, 6:50 p.m. OK GNU C++17 TESTS 35 62 819200
192389331 Jaival A Feb. 5, 2023, 7:46 p.m. OK GNU C++17 TESTS 35 77 819200
192423683 Sayan_Jasu A Feb. 6, 2023, 5:29 a.m. OK GNU C++17 TESTS 35 78 819200
192383976 dionysios A Feb. 5, 2023, 6:52 p.m. OK GNU C++17 TESTS 35 78 819200
192415641 chandu1479 A Feb. 6, 2023, 3:17 a.m. OK GNU C++17 TESTS 35 78 1843200
192380931 Sourav.VK18 A Feb. 5, 2023, 6:25 p.m. OK GNU C++17 TESTS 35 78 15769600
192416481 Asad_Bin A Feb. 6, 2023, 3:32 a.m. OK GNU C++17 TESTS 35 93 1638400
192389766 p8324r A Feb. 5, 2023, 7:51 p.m. OK GNU C++17 TESTS 35 296 1638400
192420722 Physics212303 A Feb. 6, 2023, 4:44 a.m. OK GNU C++17 (64) TESTS 35 62 1638400
192282825 353cerega A Feb. 5, 2023, 12:07 p.m. OK GNU C++17 (64) TESTS 35 62 1638400
192411692 PEKKA_l A Feb. 6, 2023, 2:05 a.m. OK GNU C++17 (64) TESTS 35 78 6451200
192415275 yemuzhe A Feb. 6, 2023, 3:11 a.m. OK GNU C++17 (64) TESTS 35 124 716800
192400495 Fifat A Feb. 5, 2023, 10:11 p.m. OK GNU C++17 (64) TESTS 35 280 2150400
192382635 MUIabk A Feb. 5, 2023, 6:39 p.m. OK GNU C++20 (64) TESTS 35 46 819200
192286530 244mhq A Feb. 5, 2023, 12:14 p.m. OK GNU C++20 (64) TESTS 35 46 819200
192283806 Mangooste A Feb. 5, 2023, 12:09 p.m. OK GNU C++20 (64) TESTS 35 46 819200
192283129 Ormlis A Feb. 5, 2023, 12:08 p.m. OK GNU C++20 (64) TESTS 35 46 819200
192282826 Maksim1744 A Feb. 5, 2023, 12:07 p.m. OK GNU C++20 (64) TESTS 35 46 819200
192414824 filch178 A Feb. 6, 2023, 3:03 a.m. OK GNU C++20 (64) TESTS 35 46 1638400
192285258 isaf27 A Feb. 5, 2023, 12:12 p.m. OK GNU C++20 (64) TESTS 35 46 1638400
192284804 Allvik06 A Feb. 5, 2023, 12:11 p.m. OK GNU C++20 (64) TESTS 35 46 1638400
192283068 never_giveup A Feb. 5, 2023, 12:08 p.m. OK GNU C++20 (64) TESTS 35 46 1638400
192282772 Kirill22 A Feb. 5, 2023, 12:07 p.m. OK GNU C++20 (64) TESTS 35 46 1638400
192424220 AKhacks A Feb. 6, 2023, 5:35 a.m. OK Java 17 TESTS 35 576 1433600
192393574 ardakdj A Feb. 5, 2023, 8:36 p.m. OK Java 8 TESTS 35 202 64409600
192391153 person_exe A Feb. 5, 2023, 8:07 p.m. OK PyPy 3-64 TESTS 35 249 22835200
192391577 person_exe A Feb. 5, 2023, 8:12 p.m. OK PyPy 3-64 TESTS 35 280 22732800
192390769 person_exe A Feb. 5, 2023, 8:03 p.m. OK PyPy 3-64 TESTS 35 311 22425600
192390949 person_exe A Feb. 5, 2023, 8:05 p.m. OK PyPy 3-64 TESTS 35 311 22630400
192391607 person_exe A Feb. 5, 2023, 8:12 p.m. OK Python 3 TESTS 35 295 14233600
192390968 person_exe A Feb. 5, 2023, 8:05 p.m. OK Python 3 TESTS 35 343 14233600
192291176 Egor A Feb. 5, 2023, 12:22 p.m. OK Rust 2021 TESTS 35 31 2457600

remove filters

Back to search problems