Hello 2026

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
2183 Hello 2026 FINISHED False 10800 8609123 Jan. 7, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 10578 ) C War Strategy PROGRAMMING binary search greedy math two pointers

A war has broken out! You, as the country's top general, must strategize where to place your troops. There are (n) bases in a line, with the (k)-th of which being the home base for your army. Initially, there is only a single soldier at base (k). Each day, the following happens in order: You give out an order by choosing a base (i) ((1 \leq i \leq n)), and any number of soldiers inside that base (which is allowed to be (0) or all soldiers in that base currently). Then, tell all soldiers you ordered to either move to base (i-1) or base (i+1). All soldiers must move in the same direction, and no soldier is allowed to move to the left of base (1) or to the right of base (n). Then, a new soldier moves onto base (k). This soldier cannot be ordered by that day's commands. However, time is tight, and there are only (m) days until the enemy attacks. A base is called fortified if at least one soldier resides in it. Your job is to find the maximum number of fortified bases (including the home base) you can have by the end of the (m)-th day. 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 line of each test case contains three integers (n), (m), (k) ((1 \leq k \leq n \leq 10^5), (1 \leq m \leq 10^9)) — denoting the number of bases, the number of days you have to fortify your bases, and the index of the home base. It is guaranteed that the sum of (n) across all test cases does not exceed (2\cdot 10^5). For each test case, print the maximum number of bases you can fortify at the end of the (m)-th day. In the second test case, here is one way to fortify (3) bases: On the first day, order (0) soldiers in base (3) to move to base (2). At the end of the day, a new soldier moves to base (2) (there are now (2) soldiers in base (2) and $$$0$

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
356904919 kunal_keshri C Jan. 8, 2026, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356904256 Professor.Choudhary C Jan. 8, 2026, 5:18 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356898638 hYdr0xY-Zeng C Jan. 8, 2026, 4:01 a.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356888109 AnmolSh C Jan. 8, 2026, midnight OK C++17 (GCC 7-32) TESTS 20 31 0
356883416 milkshake C Jan. 7, 2026, 9:30 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356877438 Sanidhya_Chouhan C Jan. 7, 2026, 7:50 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356876439 blehhP C Jan. 7, 2026, 7:37 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356874510 junshen-001 C Jan. 7, 2026, 7:17 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356862392 unknown_2406 C Jan. 7, 2026, 5:24 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356861197 YiLinG C Jan. 7, 2026, 5:20 p.m. OK C++17 (GCC 7-32) TESTS 20 31 0
356908267 rishawrajofficial75 C Jan. 8, 2026, 6:04 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356906877 neel27 C Jan. 8, 2026, 5:48 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356905507 LuzZ_ShayanZ C Jan. 8, 2026, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356901095 Sam_2027 C Jan. 8, 2026, 4:37 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356899149 mohitvaranasi2006 C Jan. 8, 2026, 4:08 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356897458 mii_sunset C Jan. 8, 2026, 3:43 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356894974 Ioytione C Jan. 8, 2026, 3:03 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356893679 Jayling C Jan. 8, 2026, 2:40 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356889892 Kphong C Jan. 8, 2026, 1:07 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356889621 biank C Jan. 8, 2026, 12:57 a.m. OK C++20 (GCC 13-64) TESTS 20 31 0
356908618 Saurabh_lucifer C Jan. 8, 2026, 6:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356908453 Shanddoshk C Jan. 8, 2026, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356908371 WentaoChen C Jan. 8, 2026, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356908366 Jamalch1k C Jan. 8, 2026, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356908202 WentaoChen C Jan. 8, 2026, 6:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356907751 Enum2 C Jan. 8, 2026, 5:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356907244 sagitarriuspkt C Jan. 8, 2026, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356907193 Violet_Anan C Jan. 8, 2026, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356907188 Divs30 C Jan. 8, 2026, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356906838 a_dityn C Jan. 8, 2026, 5:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 31 0
356890372 NenadDapic C Jan. 8, 2026, 1:24 a.m. OK FPC TESTS 20 31 102400
356873868 1435730 C Jan. 7, 2026, 7:11 p.m. OK GNU C11 TESTS 20 46 0
356860853 Des_007 C Jan. 7, 2026, 5:19 p.m. OK GNU C11 TESTS 20 46 0
356859521 Killer_1507 C Jan. 7, 2026, 5:15 p.m. OK GNU C11 TESTS 20 46 0
356855946 zhanzhijiea C Jan. 7, 2026, 5:05 p.m. OK GNU C11 TESTS 20 46 0
356857223 kabeersinghal C Jan. 7, 2026, 5:08 p.m. OK GNU C11 TESTS 20 62 0
356899956 __baozii__ C Jan. 8, 2026, 4:20 a.m. OK Go TESTS 20 46 614400
356856458 treasuryonly C Jan. 7, 2026, 5:06 p.m. OK Haskell TESTS 20 78 0
356861040 EvilsBack C Jan. 7, 2026, 5:20 p.m. OK Java 21 TESTS 20 187 614400
356855818 RandomSummer C Jan. 7, 2026, 5:04 p.m. OK Java 21 TESTS 20 187 614400
356850527 Rick_7799 C Jan. 7, 2026, 4:49 p.m. OK Java 21 TESTS 20 187 1024000
356888116 SoHxM2K C Jan. 8, 2026, 12:01 a.m. OK Java 21 TESTS 20 203 409600
356881987 unleashed_me C Jan. 7, 2026, 9 p.m. OK Java 21 TESTS 20 203 716800
356850770 LostDaemon C Jan. 7, 2026, 4:50 p.m. OK Java 21 TESTS 20 218 614400
356855715 M_Abdullah_Q C Jan. 7, 2026, 5:04 p.m. OK Java 21 TESTS 20 218 716800
356857697 Power_Rangers_ C Jan. 7, 2026, 5:09 p.m. OK Java 21 TESTS 20 218 1126400
356856988 ashuramajestic C Jan. 7, 2026, 5:07 p.m. OK Java 21 TESTS 20 218 1536000
356849680 itssah C Jan. 7, 2026, 4:47 p.m. OK Java 21 TESTS 20 218 1536000
356859979 just_shubham C Jan. 7, 2026, 5:16 p.m. OK Java 8 TESTS 20 140 0
356849741 vanishamittal1409 C Jan. 7, 2026, 4:47 p.m. OK Java 8 TESTS 20 140 0
356906806 _sitesh_kumar C Jan. 8, 2026, 5:47 a.m. OK Java 8 TESTS 20 156 0
356897146 Mr.Curious C Jan. 8, 2026, 3:37 a.m. OK Java 8 TESTS 20 203 0
356877575 NavneetKumar123 C Jan. 7, 2026, 7:51 p.m. OK Java 8 TESTS 20 203 0
356894448 _andrewliu_ C Jan. 8, 2026, 2:54 a.m. OK PyPy 3 TESTS 20 156 6656000
356858845 DoryperPevin C Jan. 7, 2026, 5:13 p.m. OK PyPy 3 TESTS 20 234 7884800
356883036 crucious C Jan. 7, 2026, 9:21 p.m. OK PyPy 3 TESTS 20 265 9728000
356877642 rabeysin C Jan. 7, 2026, 7:52 p.m. OK PyPy 3 TESTS 20 296 9830400
356877057 rabeysin C Jan. 7, 2026, 7:45 p.m. OK PyPy 3 TESTS 20 343 9728000
356849633 gitBoy C Jan. 7, 2026, 4:47 p.m. OK PyPy 3-64 TESTS 20 93 4505600
356878787 cappucciyes C Jan. 7, 2026, 8:09 p.m. OK PyPy 3-64 TESTS 20 93 4608000
356854804 Aura328 C Jan. 7, 2026, 5:01 p.m. OK PyPy 3-64 TESTS 20 93 4608000
356890121 ANISH_not_so_GREAT C Jan. 8, 2026, 1:15 a.m. OK PyPy 3-64 TESTS 20 109 3481600
356864144 itokhtarovv C Jan. 7, 2026, 5:29 p.m. OK PyPy 3-64 TESTS 20 109 3993600
356855649 Arshit_Singhal C Jan. 7, 2026, 5:04 p.m. OK PyPy 3-64 TESTS 20 109 4403200
356862777 sivi_21 C Jan. 7, 2026, 5:25 p.m. OK PyPy 3-64 TESTS 20 109 5120000
356900543 hxu10 C Jan. 8, 2026, 4:29 a.m. OK PyPy 3-64 TESTS 20 109 5734400
356881888 SBOSSDestroyer C Jan. 7, 2026, 8:58 p.m. OK PyPy 3-64 TESTS 20 109 5734400
356873257 jigitmax C Jan. 7, 2026, 7:07 p.m. OK PyPy 3-64 TESTS 20 109 7680000
356855101 noir123 C Jan. 7, 2026, 5:02 p.m. OK Python 3 TESTS 20 62 0
356863632 abhi9958 C Jan. 7, 2026, 5:27 p.m. OK Python 3 TESTS 20 62 2764800
356865133 davidmiheev C Jan. 7, 2026, 5:31 p.m. OK Python 3 TESTS 20 78 2048000
356893749 VioletVal C Jan. 8, 2026, 2:42 a.m. OK Python 3 TESTS 20 93 102400
356873054 Raston C Jan. 7, 2026, 7:05 p.m. OK Python 3 TESTS 20 93 102400
356858825 m.anav_dbz07 C Jan. 7, 2026, 5:13 p.m. OK Python 3 TESTS 20 93 1536000
356856775 Ramper C Jan. 7, 2026, 5:07 p.m. OK Python 3 TESTS 20 109 102400
356852049 Sanjaith_007 C Jan. 7, 2026, 4:53 p.m. OK Python 3 TESTS 20 125 4812800
356907366 TpratimAewari C Jan. 8, 2026, 5:54 a.m. OK Python 3 TESTS 20 140 102400
356858237 ThreeFour C Jan. 7, 2026, 5:11 p.m. OK Python 3 TESTS 20 140 4812800
356863042 zilinj C Jan. 7, 2026, 5:26 p.m. OK Ruby 3 TESTS 20 218 2662400
356892350 _JG_ C Jan. 8, 2026, 2:13 a.m. OK Rust 2024 TESTS 20 31 0
356896780 NKS01X C Jan. 8, 2026, 3:31 a.m. OK Rust 2024 TESTS 20 46 0
356863691 allcaps C Jan. 7, 2026, 5:28 p.m. OK Rust 2024 TESTS 20 46 0
356862539 ChinG_Lynn C Jan. 7, 2026, 5:24 p.m. OK Rust 2024 TESTS 20 46 0
356860638 silicalet C Jan. 7, 2026, 5:18 p.m. OK Rust 2024 TESTS 20 46 0
356857917 smf C Jan. 7, 2026, 5:10 p.m. OK Rust 2024 TESTS 20 46 0
356861550 varunnn_gupta C Jan. 7, 2026, 5:21 p.m. OK Rust 2024 TESTS 20 1500 0

remove filters

Back to search problems