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 |
|---|---|---|---|---|---|---|
| 2035 | Codeforces Global Round 27 | FINISHED | False | 10800 | 46365923 | Oct. 27, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1957 ) | E | Monster | PROGRAMMING | binary search brute force math |
You are fighting a monster with (z) health using a weapon with (d) damage. Initially, (d=0). You can perform the following operations. Increase (d) — the damage of your weapon by (1), costing (x) coins. Attack the monster, dealing (d) damage and costing (y) coins. You cannot perform the first operation for more than (k) times in a row. Find the minimum number of coins needed to defeat the monster by dealing at least (z) damage. The first line contains a single integer (t) ((1\le t\le 100)) — the number of test cases. The only line of each test case contains 4 integers (x), (y), (z), and (k) ((1\leq x, y, z, k\leq 10^8)) — the first operation's cost, the second operation's cost, the monster's health, and the limitation on the first operation. For each test case, output the minimum number of coins needed to defeat the monster. In the first test case, (x = 2), (y = 3), (z = 5), and (k = 5). Here's a strategy that achieves the lowest possible cost of (12) coins: Increase damage by (1), costing (2) coins. Increase damage by (1), costing (2) coins. Increase damage by (1), costing (2) coins. Attack the monster, dealing (3) damage, costing (3) coins. Attack the monster, dealing (3) damage, costing (3) coins. You deal a total of (3 + 3 = 6) damage, defeating the monster who has (5) health. The total number of coins you use is (2 + 2 + 2 + 3 + 3 = 12) coins. In the second test case, (x = 10), (y = 20), (z = 40), and (k = 5). Here's a strategy that achieves the lowest possible cost of (190) coins: Increase damage by (5), costing (5\cdot x) = (50) coins. Attack the monster once, dealing (5) damage, costing (20) coins. Increase damage by (2), costing (2\cdot x) = (20) coins. Attack the monster (5) times, dealing (5\cdot 7 = 35) damage, costing (5\cdot y) = (100) co |
| Codeforces Global Round 27 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 288363330 | 5AnCar2727 | E | Oct. 27, 2024, 5:06 p.m. | OK | C# 10 | TESTS | 14 | 577 | 2867200 | ||
| 288382394 | og.kostya | E | Oct. 27, 2024, 6:39 p.m. | OK | C# 10 | TESTS | 16 | 687 | 0 | ||
| 288420058 | convective_rain | E | Oct. 28, 2024, 5:07 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 77 | 102400 | ||
| 288419779 | Zanzad_shubham | E | Oct. 28, 2024, 5:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 77 | 102400 | ||
| 288420457 | Zmq200921 | E | Oct. 28, 2024, 5:13 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 78 | 102400 | ||
| 288420275 | Zmq200921 | E | Oct. 28, 2024, 5:11 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 78 | 102400 | ||
| 288377278 | radaiosm7 | E | Oct. 27, 2024, 6:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 78 | 102400 | ||
| 288408547 | Ion_Gravirei | E | Oct. 28, 2024, 1:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 93 | 102400 | ||
| 288384452 | Hello_zoka | E | Oct. 27, 2024, 6:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 93 | 102400 | ||
| 288382870 | tianbincheng | E | Oct. 27, 2024, 6:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 93 | 102400 | ||
| 288370297 | siewjh | E | Oct. 27, 2024, 5:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 93 | 102400 | ||
| 288369239 | lazymystic | E | Oct. 27, 2024, 5:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 93 | 102400 | ||
| 288377819 | GOTKAKO | E | Oct. 27, 2024, 6:06 p.m. | OK | C++20 (GCC 13-64) | TESTS | 15 | 77 | 102400 | ||
| 288364444 | Lylova | E | Oct. 27, 2024, 5:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 102400 | ||
| 288365715 | Tang___Tang | E | Oct. 27, 2024, 5:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 1638400 | ||
| 288409433 | zltzlt | E | Oct. 28, 2024, 2:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 0 | ||
| 288367609 | Marco_L_T | E | Oct. 27, 2024, 5:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 93 | 0 | ||
| 288413067 | kr_vcf | E | Oct. 28, 2024, 3:20 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
| 288412366 | FakeDuck | E | Oct. 28, 2024, 3:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
| 288410557 | Hojstyer | E | Oct. 28, 2024, 2:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
| 288409155 | Code_quantum | E | Oct. 28, 2024, 2:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
| 288405996 | sunkuangzheng | E | Oct. 28, 2024, 12:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
| 288408319 | TychoElling | E | Oct. 28, 2024, 1:47 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 78 | 102400 | ||
| 288363877 | socho | E | Oct. 27, 2024, 5:08 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 14 | 78 | 102400 | ||
| 288399314 | Shakil17 | E | Oct. 27, 2024, 9:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 17 | 93 | 0 | ||
| 288383517 | Fiction | E | Oct. 27, 2024, 6:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 16 | 93 | 0 | ||
| 288422231 | 20230158322023 | E | Oct. 28, 2024, 5:35 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 102400 | ||
| 288411587 | nicnaknic | E | Oct. 28, 2024, 2:55 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 102400 | ||
| 288408147 | songke123 | E | Oct. 28, 2024, 1:44 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 102400 | ||
| 288408119 | songke123 | E | Oct. 28, 2024, 1:44 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 102400 | ||
| 288403644 | jaehyunp312 | E | Oct. 27, 2024, 11:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 19 | 93 | 102400 | ||
| 288389719 | raoxj | E | Oct. 27, 2024, 7:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 16 | 93 | 102400 | ||
| 288376966 | frocemetocode | E | Oct. 27, 2024, 6:03 p.m. | OK | GNU C11 | TESTS | 14 | 93 | 0 | ||
| 288384978 | rainboy | E | Oct. 27, 2024, 6:56 p.m. | OK | GNU C11 | TESTS | 16 | 156 | 0 | ||
| 288371632 | -dub-otrezkov- | E | Oct. 27, 2024, 5:29 p.m. | OK | Go | TESTS | 14 | 999 | 0 | ||
| 288413324 | lyongwolf | E | Oct. 28, 2024, 3:24 a.m. | OK | Java 21 | TESTS | 19 | 265 | 307200 | ||
| 288413153 | lyongwolf | E | Oct. 28, 2024, 3:21 a.m. | OK | Java 21 | TESTS | 19 | 296 | 614400 | ||
| 288373779 | vzljkf575 | E | Oct. 27, 2024, 5:33 p.m. | OK | Java 21 | TESTS | 14 | 1984 | 819200 | ||
| 288361350 | LMeyling | E | Oct. 27, 2024, 5 p.m. | OK | PyPy 3-64 | TESTS | 14 | 296 | 2252800 | ||
| 288398268 | jeroenodb | E | Oct. 27, 2024, 9:25 p.m. | OK | PyPy 3-64 | TESTS | 17 | 499 | 10444800 | ||
| 288410809 | tassei903 | E | Oct. 28, 2024, 2:39 a.m. | OK | PyPy 3-64 | TESTS | 19 | 671 | 2969600 | ||
| 288369662 | hxu10 | E | Oct. 27, 2024, 5:24 p.m. | OK | PyPy 3-64 | TESTS | 14 | 702 | 3686400 | ||
| 288367321 | ducksson | E | Oct. 27, 2024, 5:17 p.m. | OK | PyPy 3-64 | TESTS | 14 | 874 | 2355200 | ||
| 288407719 | Badint | E | Oct. 28, 2024, 1:34 a.m. | OK | Rust 2021 | TESTS | 19 | 77 | 102400 | ||
| 288377790 | tifv | E | Oct. 27, 2024, 6:06 p.m. | OK | Rust 2021 | TESTS | 15 | 265 | 0 |
Back to search problems