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 |
|---|---|---|---|---|---|---|
| 2157 | Codeforces Round 1066 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 12515123 | Nov. 23, 2025, 9:35 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 153 ) | I | Hyper Smawk Bros | PROGRAMMING | dp dp games |
You and Bob are playing Hyper Smawk Bros against each other, facing a single boss with health (n). You and Bob act alternately, and you start. On your turn, you may use an attack that deals an integer amount of damage (x) in (1, m), replacing (n) with (n - x). However, one cannot use the same (x) that his opponent just used on the previous turn (on the very first move of the game, any (x) in (1, m) is allowed). The winner is the first player to reduce the boss's health to (n \leq 0). Determine whether you can force a win if Bob plays optimally. 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 only line of each test case contains two integers (n), (m) ((1 \le n \le 10^6), (2 \leq m \leq 10^6)) — the starting health (n) and the maximum damage per attack (m). Note that there are no constraints on the sum of (n) over all test cases, and there are no constraints on the sum of (m) over all test cases. For each test case, output (YES) if you can force a win against Bob, and (NO) otherwise. The judge is case-insensitive (for example, (YES), (Yes), (yes), (yEs) will all be recognized as positive answers). In the first test case, you can win immediately by dealing damage (8), so that (n) becomes (6-8 = -2 \leq 0). In the second test case, you choose to deal damage (10); Bob can choose to deal any damage in (1, 10) different from (10); then you can choose to deal damage (10) and win. In the third test case, either you start by dealing damage (1), then Bob must deal damage (2), then you must deal damage (1), etc.; or you start by dealing damage (2), then Bob must deal damage (1), then you must deal damage (2), etc. In both cases, you lose. |
| Codeforces Round 1066 (Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 350386187 | bjcb | I | Nov. 23, 2025, 4:04 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 109 | 42291200 | ||
| 350356934 | Radewoosh | I | Nov. 23, 2025, 12:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 671 | 121344000 | ||
| 350415709 | tourist | I | Nov. 23, 2025, 9:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 1030 | 72806400 | ||
| 350366970 | tourist | I | Nov. 23, 2025, 1:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 1452 | 70758400 | ||
| 350383483 | A_G | I | Nov. 23, 2025, 3:40 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 140 | 0 | ||
| 350423907 | IHaveInt | I | Nov. 24, 2025, 1:06 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 140 | 24064000 | ||
| 350406895 | BLOBVISGOD | I | Nov. 23, 2025, 7:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 296 | 33075200 | ||
| 350407185 | BLOBVISGOD | I | Nov. 23, 2025, 7:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 327 | 33075200 | ||
| 350415630 | tourist | I | Nov. 23, 2025, 9:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 327 | 64921600 | ||
| 350371171 | hungchi17 | I | Nov. 23, 2025, 2:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 639 | 121241600 | ||
| 350381246 | Dominater069 | I | Nov. 23, 2025, 3:22 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 655 | 208179200 | ||
| 350368593 | ogenus | I | Nov. 23, 2025, 1:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 656 | 121241600 | ||
| 350389161 | phuc67234346856345 | I | Nov. 23, 2025, 4:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 1343 | 70860800 | ||
| 350415692 | tourist | I | Nov. 23, 2025, 9:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 1546 | 72908800 | ||
| 350369094 | manchik | I | Nov. 23, 2025, 1:48 p.m. | OK | Go | TESTS | 41 | 3108 | 181452800 |
Back to search problems