Codeforces Round 1075 (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
2189 Codeforces Round 1075 (Div. 2) FINISHED False 7200 7226723 Jan. 23, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 15118 ) B The Curse of the Frog PROGRAMMING greedy math

On an infinite number line, at point (0), sits a frog. After many years of meditation, the frog has mastered (n) unique types of magical jumps. The (i)-th type of jump allows it to jump forward by no more than (a_i) units. In other words, if it was at integer point (k), after the jump it can land at any integer point from (k) to (k+a_i) . But magic always comes with a price; it has been cursed. Before each (b_i)-th attempt (before (b_i)-th, (2b_i)-th, (3b_i)-th etc. attempt among the jumps of type (i)) to use the (i)-th type of jump, the frog rolls back (c_i) units! In other words, if it was at point (k), it will first find itself at point (k-c_i), and after the jump, it can land at any integer point from (k-c_i) to (k-c_i+a_i). The frog's goal is to reach the point with the number (x), using jumps while minimizing the number of rollbacks. Help the frog — find the minimum number of rollbacks it will have to endure on its way to the goal, or determine that it cannot reach point (x). 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. In the first line of each test case, there are (2) integers (n) and (x) ((1 \leq n \leq 10^5), (1 \leq x \leq 10^{18})) — the number of types of jumps the frog can make and its final target. In the following (n) lines, the description of the jump types is provided; the (i)-th line contains (3) integers (a_i), (b_i), and (c_i) ((1 \leq a_i, b_i, c_i \leq 10^6)). It is guaranteed that the sum of (n) across all test cases does not exceed (10^5). For each test case, if the frog can reach point (x), find the smallest number of rollbacks it must endure to do so. If it cannot reach point (x), output (-1). In the first test case, the frog can jump forward by (1) unit and wil

Tutorials

Codeforces Round 1075 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359495754 RaghavSingla B Jan. 24, 2026, 4:49 a.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359479260 rohitsk1 B Jan. 23, 2026, 10:26 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359478672 deanish005 B Jan. 23, 2026, 10:11 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359476474 Harsh_Saini B Jan. 23, 2026, 9:26 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359462894 arjunpundir B Jan. 23, 2026, 6:38 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359461997 sad_af007 B Jan. 23, 2026, 6:30 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359458835 adityashukla.sun B Jan. 23, 2026, 6:07 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359458270 golu20062004 B Jan. 23, 2026, 6:03 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359455136 _Aadarsh_ B Jan. 23, 2026, 5:40 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359453930 Midcoldnight B Jan. 23, 2026, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 10 78 0
359502341 csgogogo114514 B Jan. 24, 2026, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 10 46 4915200
359501703 velocity___09 B Jan. 24, 2026, 5:42 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359494270 khrixna B Jan. 24, 2026, 4:33 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359491517 FlowerandYou B Jan. 24, 2026, 3:48 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359476491 DeepanshuRanjan B Jan. 23, 2026, 9:26 p.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359466999 he_aniket B Jan. 23, 2026, 7:17 p.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359458786 drogbaaaa B Jan. 23, 2026, 6:07 p.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359450115 QRQRQR B Jan. 23, 2026, 5:10 p.m. OK C++20 (GCC 13-64) TESTS 10 62 0
359499089 shine_rocks B Jan. 24, 2026, 5:22 a.m. OK C++20 (GCC 13-64) TESTS 10 62 102400
359498933 Shine_mah B Jan. 24, 2026, 5:21 a.m. OK C++20 (GCC 13-64) TESTS 10 62 102400
359445369 PSAbhiram B Jan. 23, 2026, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 102400
359505153 mysterioo B Jan. 24, 2026, 6:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359500324 rabinkarp B Jan. 24, 2026, 5:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359496114 mATRiX2410 B Jan. 24, 2026, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359492340 Bit_Riser B Jan. 24, 2026, 4:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359490505 Mahadi_Hassan B Jan. 24, 2026, 3:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359489985 abhinavsingh8805 B Jan. 24, 2026, 3:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359486184 dsn_20051209 B Jan. 24, 2026, 2:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359485075 Mahedi_02 B Jan. 24, 2026, 1:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359484459 dooglius B Jan. 24, 2026, 1:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
359467405 NenadDapic B Jan. 23, 2026, 7:22 p.m. OK FPC TESTS 10 93 819200
359467066 NenadDapic B Jan. 23, 2026, 7:18 p.m. OK FPC TESTS 10 93 819200
359439239 sakethreddypingili B Jan. 23, 2026, 4:23 p.m. OK GNU C11 TESTS 10 93 0
359468464 Maybeinnextlife B Jan. 23, 2026, 7:33 p.m. OK GNU C11 TESTS 10 109 3174400
359444146 uygaratesdogan31 B Jan. 23, 2026, 4:31 p.m. OK GNU C11 TESTS 10 125 0
359489925 David_Yap B Jan. 24, 2026, 3:18 a.m. OK Go TESTS 10 140 4198400
359488971 chethan_coding B Jan. 24, 2026, 3 a.m. OK Go TESTS 10 140 4198400
359490805 567jiong B Jan. 24, 2026, 3:35 a.m. OK Go TESTS 10 171 5120000
359473139 shyamPrajapat B Jan. 23, 2026, 8:29 p.m. OK Java 21 TESTS 10 187 204800
359442663 sparky_1234 B Jan. 23, 2026, 4:29 p.m. OK Java 21 TESTS 10 187 512000
359440501 Trijyachoubey B Jan. 23, 2026, 4:25 p.m. OK Java 21 TESTS 10 187 512000
359474446 NanDemo B Jan. 23, 2026, 8:49 p.m. OK Java 21 TESTS 10 203 102400
359452082 dasarimerwinmighty B Jan. 23, 2026, 5:20 p.m. OK Java 21 TESTS 10 218 512000
359456676 naman2277 B Jan. 23, 2026, 5:52 p.m. OK Java 21 TESTS 10 218 1433600
359490888 Dan1c B Jan. 24, 2026, 3:36 a.m. OK Java 21 TESTS 10 265 614400
359501898 anitusiruk B Jan. 24, 2026, 5:43 a.m. OK Java 21 TESTS 10 265 1126400
359462852 fatal-98 B Jan. 23, 2026, 6:37 p.m. OK Java 21 TESTS 10 281 819200
359490710 _ameysawant_ B Jan. 24, 2026, 3:33 a.m. OK Java 21 TESTS 10 281 921600
359471326 public-static-void-main B Jan. 23, 2026, 8:06 p.m. OK Java 8 TESTS 10 171 16998400
359475528 divyanshvijay079 B Jan. 23, 2026, 9:08 p.m. OK Java 8 TESTS 10 546 0
359479699 tin.le2 B Jan. 23, 2026, 10:39 p.m. OK Kotlin 1.7 TESTS 10 484 78233600
359481166 skyblu-ltng B Jan. 23, 2026, 11:26 p.m. OK Kotlin 1.9 TESTS 10 234 204800
359475800 daanolav B Jan. 23, 2026, 9:13 p.m. OK Kotlin 2.2 TESTS 10 296 204800
359492625 mehalpandkar B Jan. 24, 2026, 4:07 a.m. OK PyPy 3 TESTS 10 328 11059200
359504058 shivam_9939 B Jan. 24, 2026, 5:58 a.m. OK PyPy 3 TESTS 10 406 11571200
359456119 Aroson B Jan. 23, 2026, 5:47 p.m. OK PyPy 3 TESTS 10 453 9523200
359446547 dka0212 B Jan. 23, 2026, 4:34 p.m. OK PyPy 3 TESTS 10 812 16691200
359482543 OAY71011 B Jan. 24, 2026, 12:13 a.m. OK PyPy 3-64 TESTS 10 93 7270400
359478554 Shutcapybara B Jan. 23, 2026, 10:08 p.m. OK PyPy 3-64 TESTS 10 109 11264000
359494301 Sayanth_19 B Jan. 24, 2026, 4:33 a.m. OK PyPy 3-64 TESTS 10 109 24678400
359463738 esdeee B Jan. 23, 2026, 6:45 p.m. OK PyPy 3-64 TESTS 10 125 6656000
359451237 cappucciyes B Jan. 23, 2026, 5:16 p.m. OK PyPy 3-64 TESTS 10 125 7475200
359461278 srihari2712 B Jan. 23, 2026, 6:25 p.m. OK PyPy 3-64 TESTS 10 125 16691200
359442210 vignesh.ph10 B Jan. 23, 2026, 4:28 p.m. OK PyPy 3-64 TESTS 10 125 24473600
359486250 wayneisadog B Jan. 24, 2026, 2:04 a.m. OK PyPy 3-64 TESTS 10 125 25088000
359494393 sharmaujjwal5706 B Jan. 24, 2026, 4:35 a.m. OK PyPy 3-64 TESTS 10 125 25804800
359487273 kaushik.atla B Jan. 24, 2026, 2:28 a.m. OK PyPy 3-64 TESTS 10 125 35840000
359480574 daviddorante B Jan. 23, 2026, 11:06 p.m. OK Python 3 TESTS 10 125 33382400
359465959 co_ron B Jan. 23, 2026, 7:07 p.m. OK Python 3 TESTS 10 156 22528000
359459649 bogumil B Jan. 23, 2026, 6:13 p.m. OK Python 3 TESTS 10 171 307200
359450403 ishDebugger B Jan. 23, 2026, 5:11 p.m. OK Python 3 TESTS 10 171 14950400
359500999 kannakans B Jan. 24, 2026, 5:37 a.m. OK Python 3 TESTS 10 187 204800
359445288 rajeevranjan8863 B Jan. 23, 2026, 4:33 p.m. OK Python 3 TESTS 10 187 204800
359478413 SergiiKo B Jan. 23, 2026, 10:05 p.m. OK Python 3 TESTS 10 203 6860800
359450683 24bcs10756_kaustubh B Jan. 23, 2026, 5:13 p.m. OK Python 3 TESTS 10 218 307200
359445123 prathamesh_.PY B Jan. 23, 2026, 4:33 p.m. OK Python 3 TESTS 10 218 307200
359440483 SiddharthSNUC B Jan. 23, 2026, 4:25 p.m. OK Python 3 TESTS 10 218 307200
359495804 vanshit B Jan. 24, 2026, 4:50 a.m. OK Rust 2024 TESTS 10 46 3379200
359472792 charles0123 B Jan. 23, 2026, 8:25 p.m. OK Rust 2024 TESTS 10 46 3379200
359489883 StoneXie B Jan. 24, 2026, 3:17 a.m. OK Rust 2024 TESTS 10 62 3686400
359439329 PaddyConnolly B Jan. 23, 2026, 4:23 p.m. OK Rust 2024 TESTS 10 62 11776000

remove filters

Back to search problems