Codeforces Round 1054 (Div. 3)

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
2149 Codeforces Round 1054 (Div. 3) FINISHED False 8100 17594723 Sept. 25, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 4758 ) F Nezuko in the Clearing PROGRAMMING binary search math ternary search

Nezuko suddenly woke up on the number line at point (0) and has (h) health points. She wants to reach point (d). In one turn, she can do exactly one of two things: rest in the shade and increase her current health by (1); move from her current position (x) to (x + 1). Each movement decreases Nezuko's health; if the movement is the (j)-th consecutive movement, her health will decrease by (j) points. If as a result of a move Nezuko's health drops to (0) or below, she cannot make that move. For example, if Nezuko initially had (7) health points and (d=4), her moves could look like this: Move from (0) to (1) and decrease health by (1). Now she is at point (1) with (6) health points. Move from (1) to (2) and decrease health by (2). Now she is at point (2) with (4) health points. Move from (2) to (3) and decrease health by (3). Now she is at point (3) with (1) health point. Rest and restore (1) health point. Now she is at point (3) with (2) health points. Move from (3) to (4) and decrease health by (1). Now she is at point (4) with (1) health point. Find the minimum number of turns required for her to reach point (d). Each test consists of several test cases. The first line contains one integer (t) ((1 \le t \le 10^4)) — the number of test cases. The following describes the test cases. The first line of each test case contains two integers (h) and (d) ((1\le h,d \le 10^9)) — the number of health points and the destination point, respectively. For each test case, output one number — the minimum number of turns required for Nezuko to reach point (d). In the first test case, (h = 3), (d = 2) the actions could be as follows: Move from (0) to (1) and decrease health by (1). Now she is at point (1) with (2) health points. Rest and restore (1) health point. Now she is at point

Tutorials

__rose

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
340566655 niko1473 F Sept. 26, 2025, 5:46 a.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340563041 lwm7708 F Sept. 26, 2025, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340553623 azilebeth F Sept. 26, 2025, 3:13 a.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340537998 EndMyMisery F Sept. 25, 2025, 9:58 p.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340525940 CJor_feg F Sept. 25, 2025, 7:23 p.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340523505 TsotneSV F Sept. 25, 2025, 6:58 p.m. OK C++17 (GCC 7-32) TESTS 14 46 0
340507605 PranekiC F Sept. 25, 2025, 4:53 p.m. OK C++17 (GCC 7-32) TESTS 13 46 0
340514503 Dragon66677750 F Sept. 25, 2025, 5:38 p.m. OK C++17 (GCC 7-32) TESTS 13 46 102400
340565491 VarunGolcha F Sept. 26, 2025, 5:34 a.m. OK C++17 (GCC 7-32) TESTS 14 61 0
340550477 Kesrenal F Sept. 26, 2025, 2:26 a.m. OK C++17 (GCC 7-32) TESTS 14 61 0
340565865 R3mix F Sept. 26, 2025, 5:38 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340562200 jatin1009 F Sept. 26, 2025, 4:59 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340557223 ywc_ F Sept. 26, 2025, 4:03 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340555296 molik_28 F Sept. 26, 2025, 3:36 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340555101 jenny-qd F Sept. 26, 2025, 3:33 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340552160 huanhuanonly F Sept. 26, 2025, 2:51 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340545459 Geothermal F Sept. 26, 2025, 12:57 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340543856 Tvv1I1ght F Sept. 26, 2025, 12:22 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340543047 Ycx20120927harry F Sept. 26, 2025, 12:02 a.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340539909 nikile F Sept. 25, 2025, 10:39 p.m. OK C++20 (GCC 13-64) TESTS 14 46 0
340567166 Ropraite F Sept. 26, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340565103 Pranvesh F Sept. 26, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340561246 _CrazyForCode_ F Sept. 26, 2025, 4:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340560139 VaibhavBansal473 F Sept. 26, 2025, 4:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340559332 Richard_LU_cxjy F Sept. 26, 2025, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340557625 Raymoo_ F Sept. 26, 2025, 4:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340557604 Nathan661 F Sept. 26, 2025, 4:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340555335 fishcathu F Sept. 26, 2025, 3:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340555211 ctw123 F Sept. 26, 2025, 3:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340555108 yltzzz F Sept. 26, 2025, 3:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 46 0
340548577 InfinityX F Sept. 26, 2025, 1:54 a.m. OK Java 21 TESTS 14 280 1331200
340534284 cstemp F Sept. 25, 2025, 9:09 p.m. OK Java 21 TESTS 14 296 1228800
340524448 WrongAnswerOnTestCase2 F Sept. 25, 2025, 7:07 p.m. OK Java 21 TESTS 14 296 1228800
340507991 ironman263 F Sept. 25, 2025, 4:55 p.m. OK Java 21 TESTS 13 358 1228800
340507515 VinayakSha F Sept. 25, 2025, 4:53 p.m. OK Java 21 TESTS 13 359 1024000
340504615 Boda82 F Sept. 25, 2025, 4:46 p.m. OK Java 21 TESTS 13 359 2355200
340506176 Gauti13 F Sept. 25, 2025, 4:49 p.m. OK Java 21 TESTS 13 374 1228800
340507896 teeac F Sept. 25, 2025, 4:54 p.m. OK Java 8 TESTS 13 202 0
340506408 SarthakSharma18 F Sept. 25, 2025, 4:49 p.m. OK PHP TESTS 13 140 0
340511761 sibani F Sept. 25, 2025, 5:18 p.m. OK PyPy 3 TESTS 13 156 4608000
340507003 basakdiwakar F Sept. 25, 2025, 4:49 p.m. OK PyPy 3 TESTS 13 311 6246400
340548769 nazeeftham007 F Sept. 26, 2025, 1:58 a.m. OK PyPy 3 TESTS 14 358 9216000
340564820 kelvinp F Sept. 26, 2025, 5:26 a.m. OK PyPy 3-64 TESTS 14 109 3686400
340505062 shivamsai006 F Sept. 25, 2025, 4:47 p.m. OK PyPy 3-64 TESTS 13 124 3891200
340563567 happybear21 F Sept. 26, 2025, 5:12 a.m. OK PyPy 3-64 TESTS 14 140 2252800
340515362 ibraheemkureshi F Sept. 25, 2025, 5:45 p.m. OK PyPy 3-64 TESTS 13 140 4096000
340537506 JayKimyra F Sept. 25, 2025, 9:50 p.m. OK PyPy 3-64 TESTS 14 156 2252800
340543493 czjnbb F Sept. 26, 2025, 12:14 a.m. OK PyPy 3-64 TESTS 14 156 3481600
340544429 IcyGirl F Sept. 26, 2025, 12:35 a.m. OK PyPy 3-64 TESTS 14 156 6348800
340561706 Emikooh F Sept. 26, 2025, 4:55 a.m. OK PyPy 3-64 TESTS 14 171 2252800
340511757 mistboy F Sept. 25, 2025, 5:18 p.m. OK PyPy 3-64 TESTS 13 171 3481600
340506158 _-VA-_ F Sept. 25, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 13 171 3686400
340518007 Eje_048 F Sept. 25, 2025, 6:07 p.m. OK Python 3 TESTS 13 186 2867200
340514100 SnakeThug F Sept. 25, 2025, 5:35 p.m. OK Python 3 TESTS 13 233 2764800
340506945 anuragsahu4328 F Sept. 25, 2025, 4:49 p.m. OK Python 3 TESTS 13 234 2764800
340515950 Divam F Sept. 25, 2025, 5:50 p.m. OK Python 3 TESTS 13 358 102400
340541666 PatrickCcoaPerez F Sept. 25, 2025, 11:27 p.m. OK Python 3 TESTS 14 453 2867200

remove filters

Back to search problems