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
( 16051 ) B Yet Another MEX Problem PROGRAMMING constructive algorithms greedy

You are given an array (a) of length (n), and an integer (k). Let (f(l,r)) be the value of (\operatorname{mex}(a_l,a_{l+1},\ldots,a_r))(^{\text{∗}}). You want to perform the following operation (n-k+1) times: Let the current length of the sequence be (|a|). You need to find an interval (l, r) of length (k) such that (\operatorname{max}_{i=1}^{|a|-k+1} f(i, i+k-1) = f(l, r).) In other words, you need to select a window of size (k) such that among all windows of size (k), the window you selected has the maximum (\operatorname{mex}). If multiple (l,r) exist, you may select any. Then, you must select any integer (i) such that (l \leq i \leq r), and delete (a_i) from (a). That is, your new sequence will be (a_1, a_2, \ldots, a_{i-1}, a_{i+1}, a_{i+2}, \ldots, a_n). For example, in the array (1,2,0,1,3,0) with (k=3), the two possible ((l,r)) pairs are ((1,3)) and ((2,4)) (since they each have (\operatorname{mex} 3), which is the maximum among all windows of size (3)). Therefore, you can remove any one of the indices (1,2,3,4) in your next move. After (n - k + 1) operations, you will have a sequence of length (k-1). Your objective is to maximize the (\operatorname{mex}) of the remaining elements. Please output the maximum (\operatorname{mex}) possible. (^{\text{∗}})The minimum excluded (MEX) of a collection of integers (c_1, c_2, \ldots, c_k) is defined as the smallest non-negative integer (x) which does not occur in the collection (c). 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 two positive integers (n) and (k) ((2 \le k \le n \le 2 \cdot 10^5)). The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ($$$0 \le

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
356852874 devvvonforces B Jan. 7, 2026, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
356907352 Devraj__ B Jan. 8, 2026, 5:54 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356903869 ObserveGolu B Jan. 8, 2026, 5:13 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356899530 sahil_goyal.js B Jan. 8, 2026, 4:14 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356885006 islam112 B Jan. 7, 2026, 10:09 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356878604 Siddhant_11 B Jan. 7, 2026, 8:07 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356865664 Aesthetic_31ForHer B Jan. 7, 2026, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356864934 lms_08 B Jan. 7, 2026, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356864023 najmiddin06 B Jan. 7, 2026, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356863588 abdul0910abd B Jan. 7, 2026, 5:27 p.m. OK C++17 (GCC 7-32) TESTS 10 62 0
356862955 Crafticat B Jan. 7, 2026, 5:25 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
356851660 sleepyAdarsh B Jan. 7, 2026, 4:52 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
356889498 Nine_Suns B Jan. 8, 2026, 12:53 a.m. OK C++20 (GCC 13-64) TESTS 10 46 1638400
356907640 oapabhaiya15356 B Jan. 8, 2026, 5:57 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356905139 skulldanger__ B Jan. 8, 2026, 5:28 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356900499 libuxiangshuiji B Jan. 8, 2026, 4:28 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356896834 zero_27 B Jan. 8, 2026, 3:32 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356894513 rzgbl2 B Jan. 8, 2026, 2:55 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356891808 FlowerandYou B Jan. 8, 2026, 2:02 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356891630 ddh_sdut B Jan. 8, 2026, 1:57 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
356904651 Wise_Person B Jan. 8, 2026, 5:23 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
356890996 dragonlyz123 B Jan. 8, 2026, 1:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
356873529 nella17 B Jan. 7, 2026, 7:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
356856479 avatar07 B Jan. 7, 2026, 5:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
356892462 a_dityn B Jan. 8, 2026, 2:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 102400
356885080 GeorgiiZaharov B Jan. 7, 2026, 10:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 102400
356875706 FzArK B Jan. 7, 2026, 7:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 102400
356864145 v1shad B Jan. 7, 2026, 5:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 102400
356908131 bercolax B Jan. 8, 2026, 6:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
356907609 VaibhavBansal473 B Jan. 8, 2026, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
356866280 VALKORION B Jan. 7, 2026, 5:34 p.m. OK GNU C11 TESTS 10 62 307200
356852321 sharmadhanish2007 B Jan. 7, 2026, 4:54 p.m. OK GNU C11 TESTS 10 62 819200
356865665 warrior66766 B Jan. 7, 2026, 5:33 p.m. OK GNU C11 TESTS 10 62 1536000
356899636 __baozii__ B Jan. 8, 2026, 4:15 a.m. OK Go TESTS 10 62 9523200
356903594 Yuanny B Jan. 8, 2026, 5:10 a.m. OK Go TESTS 10 62 15667200
356887594 ravishankarg B Jan. 7, 2026, 11:39 p.m. OK Go TESTS 10 109 13516800
356883809 tekka_ity B Jan. 7, 2026, 9:39 p.m. OK Java 21 TESTS 10 187 512000
356851040 madhu0407 B Jan. 7, 2026, 4:50 p.m. OK Java 21 TESTS 10 203 716800
356856210 shingua77 B Jan. 7, 2026, 5:05 p.m. OK Java 21 TESTS 10 218 512000
356875720 beatinghu B Jan. 7, 2026, 7:29 p.m. OK Java 21 TESTS 10 218 614400
356851371 theeleven B Jan. 7, 2026, 4:51 p.m. OK Java 21 TESTS 10 234 716800
356858393 alex_127 B Jan. 7, 2026, 5:11 p.m. OK Java 21 TESTS 10 234 819200
356851298 secretwood01 B Jan. 7, 2026, 4:51 p.m. OK Java 21 TESTS 10 250 307200
356855784 ryuk_baba B Jan. 7, 2026, 5:04 p.m. OK Java 21 TESTS 10 250 409600
356851784 bhanageviraj B Jan. 7, 2026, 4:53 p.m. OK Java 21 TESTS 10 250 409600
356866346 absolutabhay B Jan. 7, 2026, 5:34 p.m. OK Java 21 TESTS 10 250 512000
356864017 harsh_1806 B Jan. 7, 2026, 5:28 p.m. OK Java 8 TESTS 10 125 0
356850808 Mazhathi B Jan. 7, 2026, 4:50 p.m. OK Java 8 TESTS 10 125 0
356881974 NavneetKumar123 B Jan. 7, 2026, 9 p.m. OK Java 8 TESTS 10 390 0
356881947 TriptiChaurasia B Jan. 7, 2026, 8:59 p.m. OK Java 8 TESTS 10 390 0
356873252 pradhumn4416 B Jan. 7, 2026, 7:07 p.m. OK Java 8 TESTS 10 406 0
356856207 jayasrishanmathi B Jan. 7, 2026, 5:05 p.m. OK Java 8 TESTS 10 453 0
356906007 Walter_white100204 B Jan. 8, 2026, 5:38 a.m. OK Java 8 TESTS 10 500 13824000
356853869 divyanshvijay079 B Jan. 7, 2026, 4:58 p.m. OK Java 8 TESTS 10 906 5017600
356859181 prachilakha B Jan. 7, 2026, 5:14 p.m. OK Java 8 TESTS 10 953 16588800
356900978 AnatolyS B Jan. 8, 2026, 4:35 a.m. OK Kotlin 2.2 TESTS 10 343 12492800
356876968 _andrewliu_ B Jan. 7, 2026, 7:44 p.m. OK PyPy 3 TESTS 10 125 14540800
356853366 IamDivyansh B Jan. 7, 2026, 4:57 p.m. OK PyPy 3 TESTS 10 218 20377600
356849857 shxd1k B Jan. 7, 2026, 4:47 p.m. OK PyPy 3 TESTS 10 265 13516800
356856101 Dharanidharram B Jan. 7, 2026, 5:05 p.m. OK PyPy 3 TESTS 10 281 16076800
356893879 youngdp B Jan. 8, 2026, 2:44 a.m. OK PyPy 3 TESTS 10 296 12595200
356879005 Bad_Bear B Jan. 7, 2026, 8:13 p.m. OK PyPy 3 TESTS 10 312 16384000
356862589 Nghaizzz B Jan. 7, 2026, 5:24 p.m. OK PyPy 3-64 TESTS 10 93 20582400
356894588 hxu10 B Jan. 8, 2026, 2:57 a.m. OK PyPy 3-64 TESTS 10 93 23449600
356849625 Defyh B Jan. 7, 2026, 4:47 p.m. OK PyPy 3-64 TESTS 10 93 26009600
356873100 CSLANAA B Jan. 7, 2026, 7:06 p.m. OK PyPy 3-64 TESTS 10 109 19456000
356886766 char_zero B Jan. 7, 2026, 11:08 p.m. OK PyPy 3-64 TESTS 10 109 20582400
356862675 sqRYU B Jan. 7, 2026, 5:25 p.m. OK PyPy 3-64 TESTS 10 109 20787200
356891054 tingshuo2917 B Jan. 8, 2026, 1:43 a.m. OK PyPy 3-64 TESTS 10 109 29081600
356883324 porkBarrel B Jan. 7, 2026, 9:28 p.m. OK PyPy 3-64 TESTS 10 125 19456000
356849764 anandchirag31 B Jan. 7, 2026, 4:47 p.m. OK PyPy 3-64 TESTS 10 125 19456000
356862662 kamulbayev B Jan. 7, 2026, 5:25 p.m. OK PyPy 3-64 TESTS 10 125 19660800
356890630 zhr6666666 B Jan. 8, 2026, 1:32 a.m. OK Python 3 TESTS 10 109 22220800
356851122 ihatetheworld B Jan. 7, 2026, 4:51 p.m. OK Python 3 TESTS 10 109 22937600
356890651 Shyam414 B Jan. 8, 2026, 1:32 a.m. OK Python 3 TESTS 10 109 30105600
356888090 coder.sy B Jan. 8, 2026, midnight OK Python 3 TESTS 10 125 23347200
356857184 ThreeFour B Jan. 7, 2026, 5:08 p.m. OK Python 3 TESTS 10 140 23449600
356855840 GHOUS1425 B Jan. 7, 2026, 5:04 p.m. OK Python 3 TESTS 10 140 23449600
356892985 harshitha_09 B Jan. 8, 2026, 2:26 a.m. OK Python 3 TESTS 10 140 23859200
356884519 safidontgetbanned B Jan. 7, 2026, 9:56 p.m. OK Python 3 TESTS 10 140 23859200
356849537 Ruthra_41 B Jan. 7, 2026, 4:46 p.m. OK Python 3 TESTS 10 140 23859200
356864038 _AKS_18 B Jan. 7, 2026, 5:28 p.m. OK Python 3 TESTS 10 140 23961600
356890994 NKS01X B Jan. 8, 2026, 1:42 a.m. OK Rust 2024 TESTS 10 46 0
356861024 varunnn_gupta B Jan. 7, 2026, 5:20 p.m. OK Rust 2024 TESTS 10 46 307200
356865198 Xeramian B Jan. 7, 2026, 5:32 p.m. OK Rust 2024 TESTS 10 93 2764800

remove filters

Back to search problems