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
( 23558 ) A Binary Array Game PROGRAMMING games

Alice and Bob are playing a game on an array (a) of size (n), containing only numbers 0 and 1 . Alice moves first, with each player alternating turns. In a player's turn, he or she chooses two integers (l) and (r) such that (1 \leq l \color{red}{<} r \leq |a|) (here, (|a|) denotes the current length of (a)). Then, the subarray (a_l,a_{l+1},\ldots,a_r) is replaced with a single number (1-\operatorname{min}(a_l,a_{l+1},\ldots,a_r)). That is, if all numbers in the subarray are (1), then the subarray (a_l,a_{l+1},\ldots,a_r) is removed, and the number (0) is inserted where the subarray was. Otherwise, the subarray (a_l,a_{l+1},\ldots,a_r) is removed, and the number (1) is inserted where the subarray was. The game ends when there is exactly one number left in the array (where the player to go cannot make legal moves). Alice wins if the final number is (0). Otherwise, Bob wins. Please determine who wins this game with optimal play. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains a positive integer (n) ((3 \le n \le 100)), denoting the length of the array (a). The second line of each test case contains (n) integers (a_1,a_2,\ldots,a_n) ((0 \le a_i \le 1)). For each test case, output Alice if Alice wins, and Bob otherwise. You may output each character in any case. For example, the answers Alice , alice , ALICE , AliCe will all be interpreted the same. In the first test case, Alice can win by choosing (l=2) and (r=3). Since (1-\operatorname{min}(a_2,a_3)=1), the subarray (1,0) is replaced with a single integer (1), and (a) becomes (1,1). At this point, it is Bob's turn, and the only move he has is to choose (l=1) and (r=2). Since (1-\operatorname{min}(a_1,a_2)=0), the array $$

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
356907277 __dopamIne A Jan. 8, 2026, 5:53 a.m. OK C# 13 TESTS 4 93 0
356907051 AG0470 A Jan. 8, 2026, 5:50 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356904447 GreedyCoder234 A Jan. 8, 2026, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356901589 Punit9464 A Jan. 8, 2026, 4:44 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356900538 qwertyui66 A Jan. 8, 2026, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356900508 Mohit-Chowdhary A Jan. 8, 2026, 4:28 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356899232 yangzhou0629 A Jan. 8, 2026, 4:09 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356899040 kshitij3250 A Jan. 8, 2026, 4:06 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356898701 12-suraj-12 A Jan. 8, 2026, 4:01 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356896281 tllfun A Jan. 8, 2026, 3:24 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356893172 GuilhermeKK A Jan. 8, 2026, 2:31 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
356883722 fatimaalzhraaalbiek A Jan. 7, 2026, 9:37 p.m. OK C++20 (GCC 13-64) TESTS 4 0 0
356864841 edrlu A Jan. 7, 2026, 5:31 p.m. OK C++20 (GCC 13-64) TESTS 4 0 0
356873363 Birify_48 A Jan. 7, 2026, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 4 0 102400
356908909 AntiMaTTeR_007 A Jan. 8, 2026, 6:10 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356907779 Vaid23 A Jan. 8, 2026, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356904103 Bot_guy A Jan. 8, 2026, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356903228 Zhuozi A Jan. 8, 2026, 5:06 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356902829 sleepy-bateman A Jan. 8, 2026, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356899779 libuxiangshuiji A Jan. 8, 2026, 4:18 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356898752 TheShadowStriker A Jan. 8, 2026, 4:02 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
356907964 herin2301 A Jan. 8, 2026, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356907603 no_comfort_0678 A Jan. 8, 2026, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356907026 mit_1907_ A Jan. 8, 2026, 5:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356905479 sameera23_08 A Jan. 8, 2026, 5:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356905030 zenithXU A Jan. 8, 2026, 5:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356904941 Sowvick_Paul A Jan. 8, 2026, 5:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356904468 Nilayan17 A Jan. 8, 2026, 5:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356904167 monui A Jan. 8, 2026, 5:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356904006 Kachef A Jan. 8, 2026, 5:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356903886 pandafinix00 A Jan. 8, 2026, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
356856122 Vader_723 A Jan. 7, 2026, 5:05 p.m. OK GNU C11 TESTS 4 0 0
356855016 snehvpatel2039 A Jan. 7, 2026, 5:02 p.m. OK GNU C11 TESTS 4 0 0
356907670 sanjoydada A Jan. 8, 2026, 5:57 a.m. OK GNU C11 TESTS 4 15 0
356902986 yyzlji A Jan. 8, 2026, 5:03 a.m. OK GNU C11 TESTS 4 15 0
356898948 AuroraBorealis A Jan. 8, 2026, 4:05 a.m. OK GNU C11 TESTS 4 15 0
356874955 IbrahimKasheef A Jan. 7, 2026, 7:21 p.m. OK GNU C11 TESTS 4 15 0
356861022 Naseer. A Jan. 7, 2026, 5:20 p.m. OK GNU C11 TESTS 4 15 0
356860157 ruchitijani A Jan. 7, 2026, 5:17 p.m. OK GNU C11 TESTS 4 15 0
356858274 v.harsha A Jan. 7, 2026, 5:11 p.m. OK GNU C11 TESTS 4 15 0
356857661 mrSomeone2910 A Jan. 7, 2026, 5:09 p.m. OK GNU C11 TESTS 4 15 0
356900143 567jiong A Jan. 8, 2026, 4:23 a.m. OK Go TESTS 4 31 102400
356899538 __baozii__ A Jan. 8, 2026, 4:14 a.m. OK Go TESTS 4 62 204800
356854910 ryuk_baba A Jan. 7, 2026, 5:02 p.m. OK Java 21 TESTS 4 125 1126400
356904761 __Aviral__ A Jan. 8, 2026, 5:24 a.m. OK Java 21 TESTS 4 156 0
356875068 beatinghu A Jan. 7, 2026, 7:22 p.m. OK Java 21 TESTS 4 156 614400
356908712 Balu2907 A Jan. 8, 2026, 6:08 a.m. OK Java 21 TESTS 4 171 0
356908705 Sahil_Patel_2507 A Jan. 8, 2026, 6:08 a.m. OK Java 21 TESTS 4 171 102400
356881052 tekka_ity A Jan. 7, 2026, 8:45 p.m. OK Java 21 TESTS 4 171 819200
356883469 bomakhamchha A Jan. 7, 2026, 9:32 p.m. OK Java 21 TESTS 4 187 614400
356874527 Pencilgon A Jan. 7, 2026, 7:17 p.m. OK Java 21 TESTS 4 203 0
356878575 krishna_Singh25 A Jan. 7, 2026, 8:06 p.m. OK Java 21 TESTS 4 203 102400
356891370 nahidHasan A Jan. 8, 2026, 1:51 a.m. OK Java 21 TESTS 4 203 512000
356902198 nero_17 A Jan. 8, 2026, 4:53 a.m. OK Java 8 TESTS 4 78 0
356904908 Shreyas0803 A Jan. 8, 2026, 5:25 a.m. OK Java 8 TESTS 4 109 0
356902226 Walter_white100204 A Jan. 8, 2026, 4:53 a.m. OK Java 8 TESTS 4 109 0
356900491 kevin_0911 A Jan. 8, 2026, 4:28 a.m. OK Java 8 TESTS 4 109 0
356852715 stavan_d A Jan. 7, 2026, 4:55 p.m. OK Java 8 TESTS 4 109 0
356858004 comeewhattmayy24 A Jan. 7, 2026, 5:10 p.m. OK Java 8 TESTS 4 125 0
356850258 Mazhathi A Jan. 7, 2026, 4:48 p.m. OK Java 8 TESTS 4 125 0
356863639 flextai A Jan. 7, 2026, 5:27 p.m. OK Java 8 TESTS 4 140 0
356859433 23311a12l4 A Jan. 7, 2026, 5:15 p.m. OK Java 8 TESTS 4 140 0
356858159 Neo_AbysVndrer A Jan. 7, 2026, 5:11 p.m. OK Java 8 TESTS 4 140 0
356876022 gerogeVT A Jan. 7, 2026, 7:32 p.m. OK Kotlin 2.2 TESTS 4 171 0
356905954 krxshh A Jan. 8, 2026, 5:37 a.m. OK PyPy 3 TESTS 4 62 1433600
356886536 NhatHuy08052015 A Jan. 7, 2026, 10:58 p.m. OK PyPy 3 TESTS 4 62 1433600
356883566 WalrusRamen21 A Jan. 7, 2026, 9:34 p.m. OK PyPy 3 TESTS 4 62 1433600
356876324 waste_fellow A Jan. 7, 2026, 7:36 p.m. OK PyPy 3 TESTS 4 78 0
356895099 ml.ashraful37 A Jan. 8, 2026, 3:06 a.m. OK PyPy 3 TESTS 4 78 1331200
356892926 youngdp A Jan. 8, 2026, 2:25 a.m. OK PyPy 3 TESTS 4 78 1433600
356858662 ciberportero A Jan. 7, 2026, 5:12 p.m. OK PyPy 3 TESTS 4 78 1433600
356895682 liuxx A Jan. 8, 2026, 3:15 a.m. OK PyPy 3 TESTS 4 93 2969600
356883000 porkBarrel A Jan. 7, 2026, 9:20 p.m. OK PyPy 3-64 TESTS 4 46 0
356900973 learnerdaily5 A Jan. 8, 2026, 4:35 a.m. OK PyPy 3-64 TESTS 4 46 1331200
356907091 movement124 A Jan. 8, 2026, 5:51 a.m. OK PyPy 3-64 TESTS 4 46 1433600
356906576 vindhya.1110 A Jan. 8, 2026, 5:45 a.m. OK PyPy 3-64 TESTS 4 46 1433600
356899092 hehehe_11 A Jan. 8, 2026, 4:07 a.m. OK PyPy 3-64 TESTS 4 46 1433600
356897135 Njasoo A Jan. 8, 2026, 3:37 a.m. OK PyPy 3-64 TESTS 4 46 1433600
356881647 PavelPaha A Jan. 7, 2026, 8:54 p.m. OK PyPy 3-64 TESTS 4 46 1433600
356873225 ggyongyi A Jan. 7, 2026, 7:07 p.m. OK PyPy 3-64 TESTS 4 46 1433600
356855333 kamulbayev A Jan. 7, 2026, 5:03 p.m. OK PyPy 3-64 TESTS 4 46 1433600
356855267 shalomkeshet A Jan. 7, 2026, 5:03 p.m. OK PyPy 3-64 TESTS 4 46 1433600
356853377 Murali-03 A Jan. 7, 2026, 4:57 p.m. OK Python 2 TESTS 4 31 0
356905067 beheraprat2 A Jan. 8, 2026, 5:27 a.m. OK Python 3 TESTS 4 31 0
356904208 oclvzn A Jan. 8, 2026, 5:17 a.m. OK Python 3 TESTS 4 31 0
356898333 kit27.ad62 A Jan. 8, 2026, 3:57 a.m. OK Python 3 TESTS 4 31 0
356864921 kit27.ad10 A Jan. 7, 2026, 5:31 p.m. OK Python 3 TESTS 4 31 0
356864715 dsdharshika A Jan. 7, 2026, 5:30 p.m. OK Python 3 TESTS 4 31 0
356859850 camp25674 A Jan. 7, 2026, 5:16 p.m. OK Python 3 TESTS 4 31 0
356851957 Rohit_025 A Jan. 7, 2026, 4:53 p.m. OK Python 3 TESTS 4 31 0
356887490 jparkkavan A Jan. 7, 2026, 11:36 p.m. OK Python 3 TESTS 4 31 102400
356889558 zhr6666666 A Jan. 8, 2026, 12:55 a.m. OK Python 3 TESTS 4 31 204800
356852736 Aruna777 A Jan. 7, 2026, 4:55 p.m. OK Python 3 TESTS 4 31 204800
356885490 Garouka A Jan. 7, 2026, 10:24 p.m. OK Rust 2021 TESTS 4 15 0
356890088 NKS01X A Jan. 8, 2026, 1:14 a.m. OK Rust 2024 TESTS 4 31 0
356860487 varunnn_gupta A Jan. 7, 2026, 5:18 p.m. OK Rust 2024 TESTS 4 31 0

remove filters

Back to search problems