Codeforces Global Round 29 (Div. 1 + 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
2147 Codeforces Global Round 29 (Div. 1 + Div. 2) FINISHED False 10800 20359530 Sept. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 18765 ) A Shortest Increasing Path PROGRAMMING constructive algorithms

You are at ((0, 0)) in a rectangular grid and want to go to ((x, y)). In order to do so, you are allowed to perform a sequence of steps. Each step consists of moving a positive integer amount of length in the positive direction of either the (x) or the (y) axis. The first step must be along the (x) axis, the second along the (y) axis, the third along the (x) axis, and so on. Formally, if we number steps from one in the order they are done, then odd-numbered steps must be along the (x) axis and even-numbered steps must be along the (y) axis. Additionally, each step must have a length strictly greater than the length of the previous one. Output the minimum number of steps needed to reach ((x, y)), or (-1) if it is impossible. 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 first and only line of each case contains two integers (x) and (y) ((1 \le x, y \le 10^9)). For each test case, output the minimum number of steps to reach ((x, y)) or (-1) if it is impossible. Visualizer link In the second test case, you can move to ((5, 0)) by moving (5) along the (x) axis and then to ((5, 6)) by moving (6) along the (y) axis.

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339642705 Gobl1n A Sept. 21, 2025, 2:46 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
339634349 ghost-58 A Sept. 20, 2025, 10:48 p.m. OK C++17 (GCC 7-32) TESTS 5 31 0
339656545 MMMim A Sept. 21, 2025, 6:04 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339655379 dragonc0der A Sept. 21, 2025, 5:53 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339655125 chetanchauhan A Sept. 21, 2025, 5:49 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339654819 karthikeya48 A Sept. 21, 2025, 5:46 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339654246 am1n_1602 A Sept. 21, 2025, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339653977 wujijlc A Sept. 21, 2025, 5:37 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339653168 10jul2003 A Sept. 21, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339653006 Prit_Patel2008 A Sept. 21, 2025, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
339653881 delusionalparadox_1 A Sept. 21, 2025, 5:36 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
339619629 Muhammad_Bitar A Sept. 20, 2025, 7:41 p.m. OK C++20 (GCC 13-64) TESTS 5 31 0
339655612 Sneaky_Typer A Sept. 21, 2025, 5:55 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339655469 paidaxing_318 A Sept. 21, 2025, 5:54 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339654904 Ecola A Sept. 21, 2025, 5:47 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339653604 Oscaryang A Sept. 21, 2025, 5:33 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339652990 Herothenewdominator A Sept. 21, 2025, 5:26 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339652943 Fur1ous_error A Sept. 21, 2025, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339652011 adarshsingh0427 A Sept. 21, 2025, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339651688 thats_it A Sept. 21, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
339646943 pp031608 A Sept. 21, 2025, 4:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
339640493 Michael_Kaiser_02 A Sept. 21, 2025, 1:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 30 0
339650161 bourbon111 A Sept. 21, 2025, 4:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
339636585 gholyo A Sept. 21, 2025, 12:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
339600953 obaidaabu5200 A Sept. 20, 2025, 5:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
339650017 blhxsdzjr A Sept. 21, 2025, 4:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 102400
339656574 Animmah A Sept. 21, 2025, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
339656523 Vistarin A Sept. 21, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
339656180 Satyam_510 A Sept. 21, 2025, 6:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
339656083 Aminour_35 A Sept. 21, 2025, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
339620868 ICPCCode A Sept. 20, 2025, 7:50 p.m. OK GNU C11 TESTS 5 77 0
339615454 soki1we123z A Sept. 20, 2025, 7:08 p.m. OK GNU C11 TESTS 5 77 0
339598566 Rayid4130_sust A Sept. 20, 2025, 5:18 p.m. OK GNU C11 TESTS 5 77 0
339596660 mohapatraabhisek086 A Sept. 20, 2025, 5:13 p.m. OK GNU C11 TESTS 5 77 0
339656248 Phl9421 A Sept. 21, 2025, 6:01 a.m. OK GNU C11 TESTS 5 77 102400
339646334 nusrat_maya A Sept. 21, 2025, 3:55 a.m. OK GNU C11 TESTS 5 77 102400
339646238 nusratmaya.jahan7 A Sept. 21, 2025, 3:53 a.m. OK GNU C11 TESTS 5 77 102400
339639616 WOL_Noname A Sept. 21, 2025, 1:39 a.m. OK GNU C11 TESTS 5 77 102400
339598816 u2404063 A Sept. 20, 2025, 5:19 p.m. OK GNU C11 TESTS 5 93 102400
339590542 k.saijaswanth A Sept. 20, 2025, 4:55 p.m. OK Go TESTS 5 93 512000
339653041 NpHardcore_05 A Sept. 21, 2025, 5:27 a.m. OK Java 21 TESTS 5 217 716800
339627087 sakshams7778 A Sept. 20, 2025, 8:49 p.m. OK Java 21 TESTS 5 218 512000
339593290 Java_Coder A Sept. 20, 2025, 5:03 p.m. OK Java 21 TESTS 5 218 614400
339647831 Sadhik099 A Sept. 21, 2025, 4:21 a.m. OK Java 21 TESTS 5 218 716800
339611602 code.breaker23 A Sept. 20, 2025, 6:45 p.m. OK Java 21 TESTS 5 234 409600
339617945 shivansh_123 A Sept. 20, 2025, 7:27 p.m. OK Java 21 TESTS 5 249 0
339649155 ccj123 A Sept. 21, 2025, 4:39 a.m. OK Java 21 TESTS 5 249 307200
339613266 akshat.codes A Sept. 20, 2025, 6:54 p.m. OK Java 21 TESTS 5 249 716800
339646534 lupunish A Sept. 21, 2025, 3:59 a.m. OK Java 21 TESTS 5 249 921600
339620348 dharahas A Sept. 20, 2025, 7:46 p.m. OK Java 21 TESTS 5 265 512000
339630720 multibagger A Sept. 20, 2025, 9:33 p.m. OK Java 8 TESTS 5 171 0
339620743 sarthaKKharKa_18 A Sept. 20, 2025, 7:49 p.m. OK Java 8 TESTS 5 171 0
339653191 yallappaJ A Sept. 21, 2025, 5:28 a.m. OK Java 8 TESTS 5 202 0
339614944 Abhishek_Yadav123 A Sept. 20, 2025, 7:05 p.m. OK Java 8 TESTS 5 218 0
339638301 nkeerthika A Sept. 21, 2025, 1:01 a.m. OK Java 8 TESTS 5 233 0
339628014 vootkuriakshayreddy A Sept. 20, 2025, 8:59 p.m. OK Java 8 TESTS 5 233 0
339625893 not_mohith A Sept. 20, 2025, 8:37 p.m. OK Java 8 TESTS 5 233 0
339597511 prateek15 A Sept. 20, 2025, 5:15 p.m. OK Java 8 TESTS 5 233 0
339656418 KrisnhnaSrivastava A Sept. 21, 2025, 6:03 a.m. OK Java 8 TESTS 5 234 0
339599013 klu2300030794 A Sept. 20, 2025, 5:20 p.m. OK Java 8 TESTS 5 234 0
339641470 A_23 A Sept. 21, 2025, 2:21 a.m. OK Kotlin 1.9 TESTS 5 140 0
339642859 mahaha A Sept. 21, 2025, 2:49 a.m. OK Kotlin 2.2 TESTS 5 249 102400
339639356 archittect A Sept. 21, 2025, 1:32 a.m. OK PyPy 3 TESTS 5 156 5120000
339630327 Pheww_coder A Sept. 20, 2025, 9:28 p.m. OK PyPy 3-64 TESTS 5 93 3276800
339647226 ntarsis30 A Sept. 21, 2025, 4:11 a.m. OK PyPy 3-64 TESTS 5 93 3788800
339639893 tassei903 A Sept. 21, 2025, 1:45 a.m. OK PyPy 3-64 TESTS 5 109 3584000
339631270 CopyNinja6 A Sept. 20, 2025, 9:41 p.m. OK PyPy 3-64 TESTS 5 124 3276800
339614528 dhruvsareen24 A Sept. 20, 2025, 7:02 p.m. OK PyPy 3-64 TESTS 5 124 3584000
339617372 alexwice A Sept. 20, 2025, 7:22 p.m. OK PyPy 3-64 TESTS 5 124 3891200
339615232 kidus72 A Sept. 20, 2025, 7:07 p.m. OK PyPy 3-64 TESTS 5 124 3891200
339649008 susan_07 A Sept. 21, 2025, 4:37 a.m. OK PyPy 3-64 TESTS 5 139 3686400
339631952 anshgoel2580 A Sept. 20, 2025, 9:51 p.m. OK PyPy 3-64 TESTS 5 139 4710400
339655453 ajayvarmak5 A Sept. 21, 2025, 5:53 a.m. OK PyPy 3-64 TESTS 5 140 3276800
339639518 biltharesatyendra A Sept. 21, 2025, 1:36 a.m. OK Python 2 TESTS 5 77 0
339654715 zjz_Beiming A Sept. 21, 2025, 5:45 a.m. OK Python 3 TESTS 5 77 102400
339622217 WickedCipher A Sept. 20, 2025, 8:02 p.m. OK Python 3 TESTS 5 77 102400
339617193 krishnaprasadj2003 A Sept. 20, 2025, 7:21 p.m. OK Python 3 TESTS 5 77 409600
339624355 Saugata123 A Sept. 20, 2025, 8:23 p.m. OK Python 3 TESTS 5 77 1740800
339655194 Vidsolu03 A Sept. 21, 2025, 5:50 a.m. OK Python 3 TESTS 5 78 102400
339615854 KAMALASHKUMAARC A Sept. 20, 2025, 7:11 p.m. OK Python 3 TESTS 5 78 1228800
339597019 whatspoppinboys25 A Sept. 20, 2025, 5:14 p.m. OK Python 3 TESTS 5 92 204800
339655738 Snahal04 A Sept. 21, 2025, 5:56 a.m. OK Python 3 TESTS 5 93 0
339644428 __akash24_13 A Sept. 21, 2025, 3:20 a.m. OK Python 3 TESTS 5 93 0
339643050 Cipher_In_ A Sept. 21, 2025, 2:53 a.m. OK Python 3 TESTS 5 93 0
339620209 0x81 A Sept. 20, 2025, 7:45 p.m. OK Rust 2024 TESTS 5 61 0

remove filters

Back to search problems