Codeforces Round 1025 (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
2109 Codeforces Round 1025 (Div. 2) FINISHED False 8100 28913123 May 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 17232 ) B Slice to Survive PROGRAMMING bitmasks greedy

Duelists Mouf and Fouad enter the arena, which is an (n \times m) grid! Fouad's monster starts at cell ((a, b)), where rows are numbered (1) to (n) and columns (1) to (m). Mouf and Fouad will keep duelling until the grid consists of only one cell. In each turn: Mouf first cuts the grid along a row or column line into two parts, discarding the part without Fouad's monster. Note that the grid must have at least two cells; otherwise, the game has already ended. After that, in the same turn, Fouad moves his monster to any cell (possibly the same one it was in) within the remaining grid. Mouf wants to minimize the number of turns, while Fouad wants to maximize them. How many turns will this epic duel last if both play 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 first and only line of each test case contains four integers (n), (m), (a), and (b) ((2 \le n, m \le 10^9), (1 \le a \le n), (1 \le b \le m)) — denoting the number of rows, the number of columns, the starting row of the monster, and the starting column of the monster, respectively. For each test case, output a single integer — the number of turns this epic duel will last if both play optimally. In the first test case, one possible duel sequence is as follows: Turn 1: Mouf cuts the grid horizontally along the line between the rows (1) and (2), removing the bottom half and leaving a (1 \times 2) grid. Turn 1: Fouad's monster is at the cell ((1,1)). Turn 2: Mouf cuts the (1 \times 2) grid again, removes one column, and isolates the cell ((1,1)). The duel is completed in (2) turns. In the fourth case, one possible duel sequence is as follows: Turn 1: Mouf cuts the grid vertically along the line between the columns (2) and (3), splitting it into a (2 \times 2) and a (2 \times 5) f

Tutorials

Codeforces Round 1025 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
320179401 wujijlc B May 18, 2025, 4:25 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320174725 Ranpo_Edogawa B May 18, 2025, 4:03 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320172997 Azzay_11 B May 18, 2025, 3:38 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320166530 DNAkash B May 18, 2025, 1:52 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320166421 HongKe2828 B May 18, 2025, 1:49 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320164522 TANIM67 B May 18, 2025, 1:05 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320163787 Madhukm2050 B May 18, 2025, 12:43 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320155948 untoldme B May 17, 2025, 9 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
320186401 Ash_K.24 B May 18, 2025, 5:47 a.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
320181455 yumingsk B May 18, 2025, 4:53 a.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
320188144 ltmh B May 18, 2025, 6:03 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320182511 SerenityPeak B May 18, 2025, 5:06 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320182453 PallavOP B May 18, 2025, 5:05 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320178899 anisshh B May 18, 2025, 4:17 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320178585 timerl B May 18, 2025, 4:12 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320174276 f2021ljh B May 18, 2025, 3:57 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320173971 OKNOTOK__ B May 18, 2025, 3:52 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320172596 Mani_Deep B May 18, 2025, 3:32 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320171799 ASDFGHJKLMNBVCXZQWERT B May 18, 2025, 3:20 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320170137 dylsd12345 B May 18, 2025, 2:54 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
320188181 AZATHOTH B May 18, 2025, 6:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320186602 shobhit_jha B May 18, 2025, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320186396 LouisHurtin B May 18, 2025, 5:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320186254 saiteja B May 18, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320184944 shyamramani B May 18, 2025, 5:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320181685 Kyoshin B May 18, 2025, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320180811 Rhyme3 B May 18, 2025, 4:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320174834 big-LingKerly B May 18, 2025, 4:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320174807 sad12 B May 18, 2025, 4:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320173707 MrArbaz003 B May 18, 2025, 3:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
320127926 BenriLap B May 17, 2025, 4:39 p.m. OK GNU C11 TESTS 10 108 0
320180261 shiou B May 18, 2025, 4:37 a.m. OK Go TESTS 10 93 1126400
320161415 sohxm2k B May 17, 2025, 11:19 p.m. OK Java 21 TESTS 10 218 716800
320164647 sk1234__ B May 18, 2025, 1:09 a.m. OK Java 21 TESTS 10 233 921600
320156036 Master_Shifu46 B May 17, 2025, 9:02 p.m. OK Java 21 TESTS 10 233 1331200
320153803 tekka_ity B May 17, 2025, 8:27 p.m. OK Java 21 TESTS 10 265 819200
320161747 yang_wei B May 17, 2025, 11:31 p.m. OK Java 21 TESTS 10 265 1126400
320181095 tomcat11 B May 18, 2025, 4:49 a.m. OK Java 21 TESTS 10 265 1843200
320157225 LordKRiS B May 17, 2025, 9:25 p.m. OK Java 21 TESTS 10 280 512000
320151474 gupta_harshal B May 17, 2025, 7:56 p.m. OK Java 21 TESTS 10 280 716800
320155946 swatishivam23 B May 17, 2025, 9 p.m. OK Java 21 TESTS 10 280 1126400
320163383 singhdevansh024 B May 18, 2025, 12:29 a.m. OK Java 21 TESTS 10 281 716800
320178916 _CHEEMS_ B May 18, 2025, 4:18 a.m. OK Java 8 TESTS 10 156 0
320178288 prime29 B May 18, 2025, 4:08 a.m. OK Java 8 TESTS 10 265 0
320127901 phoenix_beast117 B May 17, 2025, 4:39 p.m. OK Java 8 TESTS 10 265 0
320144211 aaryanman05 B May 17, 2025, 6:39 p.m. OK Java 8 TESTS 10 280 0
320132486 vikaschhonkar1 B May 17, 2025, 4:47 p.m. OK Java 8 TESTS 10 327 0
320144297 Akshatgupta069_069 B May 17, 2025, 6:39 p.m. OK Java 8 TESTS 10 358 0
320146796 priyanshu3003 B May 17, 2025, 7:03 p.m. OK Java 8 TESTS 10 390 0
320139469 jagbarrameda B May 17, 2025, 6:11 p.m. OK Kotlin 1.9 TESTS 10 296 409600
320139722 Code.Virtuoso B May 17, 2025, 6:12 p.m. OK PyPy 3 TESTS 10 312 9216000
320127820 _gaurav_3043 B May 17, 2025, 4:39 p.m. OK PyPy 3 TESTS 10 405 10342400
320143843 Calculuslove B May 17, 2025, 6:36 p.m. OK PyPy 3 TESTS 10 609 10137600
320179002 llllllgllllll B May 18, 2025, 4:19 a.m. OK PyPy 3-64 TESTS 10 171 4505600
320131901 NatiYoni B May 17, 2025, 4:46 p.m. OK PyPy 3-64 TESTS 10 171 5222400
320148217 amongsus B May 17, 2025, 7:18 p.m. OK PyPy 3-64 TESTS 10 186 7475200
320152899 Om_Singh_ B May 17, 2025, 8:15 p.m. OK PyPy 3-64 TESTS 10 186 8499200
320185429 Jyotier B May 18, 2025, 5:38 a.m. OK PyPy 3-64 TESTS 10 187 4198400
320172896 manoharsingh2402 B May 18, 2025, 3:36 a.m. OK PyPy 3-64 TESTS 10 187 5222400
320169880 EmeraldBeast B May 18, 2025, 2:50 a.m. OK PyPy 3-64 TESTS 10 187 6963200
320152775 Om_Singh_ B May 17, 2025, 8:13 p.m. OK PyPy 3-64 TESTS 10 187 8294400
320162888 ibraheemkureshi B May 18, 2025, 12:10 a.m. OK PyPy 3-64 TESTS 10 202 7782400
320151122 grecil B May 17, 2025, 7:52 p.m. OK PyPy 3-64 TESTS 10 202 7884800
320166967 pundruvarshith17 B May 18, 2025, 2:01 a.m. OK Python 3 TESTS 10 108 307200
320166771 pundruchidvilash2000 B May 18, 2025, 1:57 a.m. OK Python 3 TESTS 10 108 307200
320128994 swarya B May 17, 2025, 4:41 p.m. OK Python 3 TESTS 10 109 4300800
320149743 FelixCenusa B May 17, 2025, 7:34 p.m. OK Python 3 TESTS 10 171 204800
320131616 Abdul_Naveed B May 17, 2025, 4:46 p.m. OK Python 3 TESTS 10 171 307200
320128336 Max-Mzzn B May 17, 2025, 4:40 p.m. OK Python 3 TESTS 10 171 307200
320151478 NoCodeNoLifeEz B May 17, 2025, 7:56 p.m. OK Python 3 TESTS 10 187 307200
320154566 iwonit B May 17, 2025, 8:38 p.m. OK Python 3 TESTS 10 280 307200
320130392 hotate29 B May 17, 2025, 4:44 p.m. OK Python 3 TESTS 10 281 2457600
320165154 yuLeave B May 18, 2025, 1:21 a.m. OK Python 3 TESTS 10 327 307200
320144879 0x81 B May 17, 2025, 6:45 p.m. OK Rust 2021 TESTS 10 78 0

remove filters

Back to search problems