Codeforces Global Round 28

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
2048 Codeforces Global Round 28 FINISHED False 10800 41786723 Dec. 19, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 15081 ) C Kevin and Binary Strings PROGRAMMING bitmasks brute force greedy strings

Kevin discovered a binary string (s) that starts with 1 in the river at Moonlit River Park and handed it over to you. Your task is to select two non-empty substrings(^{\text{∗}}) of (s) (which can be overlapped) to maximize the XOR value of these two substrings. The XOR of two binary strings (a) and (b) is defined as the result of the (\oplus) operation applied to the two numbers obtained by interpreting (a) and (b) as binary numbers, with the leftmost bit representing the highest value. Here, (\oplus) denotes the bitwise XOR operation . The strings you choose may have leading zeros. (^{\text{∗}})A string (a) is a substring of a string (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^3)). The only line of each test case contains a binary string (s) that starts with 1 ((1\le\lvert s\rvert\le 5000)). It is guaranteed that the sum of (\lvert s\rvert) over all test cases doesn't exceed (5000). For each test case, output four integers (l_1, r_1, l_2, r_2) ((1 \le l_1 \le r_1 \le |s|), (1 \le l_2 \le r_2 \le |s|)) — in the case the two substrings you selected are (s_{l_1} s_{l_1 + 1} \ldots s_{r_1}) and (s_{l_2} s_{l_2 + 1} \ldots s_{r_2}). If there are multiple solutions, print any of them. In the first test case, we can choose (s_2=1) and (s_1 s_2 s_3=111), and (1\oplus111=110). It can be proven that it is impossible to obtain a larger result. Additionally, (l_1=3), (r_1=3), (l_2=1), (r_2=3) is also a valid solution. In the second test case, (s_1 s_2 s_3=100), (s_1 s_2 s_3 s_4=1000), the result is $$$ 100\oplu

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
297376793 calmtrout C Dec. 20, 2024, 2:39 a.m. OK C# 10 TESTS 21 171 3072000
297390269 run2306jhun C Dec. 20, 2024, 5:55 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297388194 curiousbeast C Dec. 20, 2024, 5:33 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297388096 Akshansh10 C Dec. 20, 2024, 5:32 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297388028 Codernikk C Dec. 20, 2024, 5:31 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297386952 Antony_smiles C Dec. 20, 2024, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297386831 CeHang C Dec. 20, 2024, 5:18 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297385986 anim901 C Dec. 20, 2024, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297385288 c0mm4nd C Dec. 20, 2024, 4:58 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297383382 Mamun064 C Dec. 20, 2024, 4:32 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297383824 bhambureaniruddha C Dec. 20, 2024, 4:39 a.m. OK C++17 (GCC 7-32) TESTS 21 46 0
297382122 schrodeR C Dec. 20, 2024, 4:11 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297389413 umme_habiba17 C Dec. 20, 2024, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297389278 shelby70 C Dec. 20, 2024, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297386963 temporary-case C Dec. 20, 2024, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297386061 rohith6792 C Dec. 20, 2024, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297385665 abjaiswal7661 C Dec. 20, 2024, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297384525 Aerysaint C Dec. 20, 2024, 4:48 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297383147 amr_abdelazim C Dec. 20, 2024, 4:28 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297382826 RumiLumo C Dec. 20, 2024, 4:23 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297381642 Lolboyyyy C Dec. 20, 2024, 4:05 a.m. OK C++20 (GCC 13-64) TESTS 21 46 0
297379988 Mrinal_Kanti C Dec. 20, 2024, 3:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297391643 ritvij611 C Dec. 20, 2024, 6:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297390213 Sameer_Raj C Dec. 20, 2024, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297384825 anas_pro C Dec. 20, 2024, 4:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297384551 ashab.tanim C Dec. 20, 2024, 4:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297382346 NinaWalker C Dec. 20, 2024, 4:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297378092 coldwheat233 C Dec. 20, 2024, 3:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297377682 reeCompiler C Dec. 20, 2024, 2:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297376888 sangam2ishra C Dec. 20, 2024, 2:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297372143 wfb C Dec. 20, 2024, 12:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 21 46 0
297334012 date_masamune C Dec. 19, 2024, 4:57 p.m. OK C# 8 TESTS 21 140 102400
297366930 ruban C Dec. 19, 2024, 9:57 p.m. OK Delphi TESTS 21 265 27033600
297343517 CharlesLarose C Dec. 19, 2024, 5:28 p.m. OK GNU C11 TESTS 21 46 0
297333657 EdgeOfMind C Dec. 19, 2024, 4:55 p.m. OK GNU C11 TESTS 21 46 102400
297333697 AmineHarrabi C Dec. 19, 2024, 4:56 p.m. OK GNU C11 TESTS 21 46 204800
297376675 coding_pot C Dec. 20, 2024, 2:36 a.m. OK GNU C11 TESTS 21 46 13312000
297335891 haveOlogntime C Dec. 19, 2024, 5:03 p.m. OK GNU C11 TESTS 21 61 0
297363766 litch07 C Dec. 19, 2024, 8:56 p.m. OK GNU C11 TESTS 21 62 102400
297338895 Shreyank001 C Dec. 19, 2024, 5:13 p.m. OK GNU C11 TESTS 21 62 102400
297336493 nyusip_16 C Dec. 19, 2024, 5:05 p.m. OK GNU C11 TESTS 21 62 512000
297344546 Young1598 C Dec. 19, 2024, 5:31 p.m. OK GNU C11 TESTS 21 77 102400
297336048 DAKSHB405 C Dec. 19, 2024, 5:03 p.m. OK GNU C11 TESTS 21 78 102400
297376541 TheILICH C Dec. 20, 2024, 2:33 a.m. OK Go TESTS 21 93 5017600
297337789 treasuryonly C Dec. 19, 2024, 5:09 p.m. OK Haskell TESTS 21 249 0
297366508 shadowBlaze29 C Dec. 19, 2024, 9:48 p.m. OK Java 21 TESTS 21 249 921600
297366560 Jatin_jain C Dec. 19, 2024, 9:49 p.m. OK Java 21 TESTS 21 249 921600
297344401 DevankSachdeva C Dec. 19, 2024, 5:31 p.m. OK Java 21 TESTS 21 265 409600
297383165 iamalizaidi C Dec. 20, 2024, 4:28 a.m. OK Java 21 TESTS 21 265 614400
297390439 amit_roy C Dec. 20, 2024, 5:56 a.m. OK Java 21 TESTS 21 280 716800
297388215 tekka_ity C Dec. 20, 2024, 5:33 a.m. OK Java 21 TESTS 21 280 921600
297351327 vishnuyash C Dec. 19, 2024, 6:40 p.m. OK Java 21 TESTS 21 281 819200
297378607 Bhavya_RI C Dec. 20, 2024, 3:14 a.m. OK Java 21 TESTS 21 281 1126400
297382052 iamalizaidi C Dec. 20, 2024, 4:11 a.m. OK Java 21 TESTS 21 296 921600
297340029 yang_wei C Dec. 19, 2024, 5:17 p.m. OK Java 21 TESTS 21 296 921600
297336319 anasansari54283 C Dec. 19, 2024, 5:04 p.m. OK Java 8 TESTS 21 171 0
297335925 malikjaanvi26 C Dec. 19, 2024, 5:03 p.m. OK Java 8 TESTS 21 187 0
297344972 ahmedhosny2002 C Dec. 19, 2024, 5:32 p.m. OK Java 8 TESTS 21 202 0
297335676 nekhilb.ug23.cs C Dec. 19, 2024, 5:02 p.m. OK Java 8 TESTS 21 202 0
297336246 Karthikeya__00 C Dec. 19, 2024, 5:04 p.m. OK Java 8 TESTS 21 203 0
297333582 y.d.chandra_kumar C Dec. 19, 2024, 4:55 p.m. OK Java 8 TESTS 21 296 0
297341305 krishnasainakka C Dec. 19, 2024, 5:21 p.m. OK Java 8 TESTS 21 342 0
297336966 ahmedmostafa8701 C Dec. 19, 2024, 5:06 p.m. OK Kotlin 1.9 TESTS 21 218 2662400
297377721 hp3005 C Dec. 20, 2024, 2:57 a.m. OK PyPy 3 TESTS 21 155 4403200
297334825 pTaran17 C Dec. 19, 2024, 4:59 p.m. OK PyPy 3 TESTS 21 171 3891200
297334675 SPARSH_EE1 C Dec. 19, 2024, 4:59 p.m. OK PyPy 3 TESTS 21 171 4915200
297380119 nasa07 C Dec. 20, 2024, 3:39 a.m. OK PyPy 3 TESTS 21 374 4300800
297389947 coord_axis C Dec. 20, 2024, 5:51 a.m. OK PyPy 3 TESTS 21 764 9216000
297334730 parshiv.kapoor C Dec. 19, 2024, 4:59 p.m. OK PyPy 3 TESTS 21 967 9625600
297343355 algoRaj C Dec. 19, 2024, 5:27 p.m. OK PyPy 3-64 TESTS 21 93 2048000
297384942 txnb C Dec. 20, 2024, 4:54 a.m. OK PyPy 3-64 TESTS 21 93 2355200
297342718 rupam20 C Dec. 19, 2024, 5:25 p.m. OK PyPy 3-64 TESTS 21 108 2048000
297355670 shubham6105 C Dec. 19, 2024, 7:16 p.m. OK PyPy 3-64 TESTS 21 108 2150400
297390844 gauravmishra_iitr C Dec. 20, 2024, 6 a.m. OK PyPy 3-64 TESTS 21 108 2764800
297377950 Steampunkstar C Dec. 20, 2024, 3:02 a.m. OK PyPy 3-64 TESTS 21 108 2764800
297388197 cpdantes C Dec. 20, 2024, 5:33 a.m. OK PyPy 3-64 TESTS 21 109 2150400
297350759 tanmay1610 C Dec. 19, 2024, 6:37 p.m. OK PyPy 3-64 TESTS 21 109 2150400
297341297 MathModel C Dec. 19, 2024, 5:21 p.m. OK PyPy 3-64 TESTS 21 109 2150400
297338352 The....... C Dec. 19, 2024, 5:11 p.m. OK PyPy 3-64 TESTS 21 109 2150400
297369480 sifatshikdhar0 C Dec. 19, 2024, 11:10 p.m. OK Python 3 TESTS 21 62 0
297362473 Fgdg45 C Dec. 19, 2024, 8:38 p.m. OK Python 3 TESTS 21 62 0
297340492 Adiii__17 C Dec. 19, 2024, 5:18 p.m. OK Python 3 TESTS 21 77 0
297339831 TejasVarshney C Dec. 19, 2024, 5:16 p.m. OK Python 3 TESTS 21 77 0
297334492 rachitgupta1956 C Dec. 19, 2024, 4:58 p.m. OK Python 3 TESTS 21 77 0
297356973 amieow C Dec. 19, 2024, 7:30 p.m. OK Python 3 TESTS 21 77 102400
297351614 Golgawitch C Dec. 19, 2024, 6:42 p.m. OK Python 3 TESTS 21 92 0
297334589 PraveenBarathi C Dec. 19, 2024, 4:59 p.m. OK Python 3 TESTS 21 92 0
297373684 AryanGoel575 C Dec. 20, 2024, 1:25 a.m. OK Python 3 TESTS 21 93 0
297370338 sifatshikdhar0 C Dec. 19, 2024, 11:40 p.m. OK Python 3 TESTS 21 93 0
297353562 urparvezali C Dec. 19, 2024, 6:56 p.m. OK Rust 2021 TESTS 21 62 0
297372561 Lord-scheme C Dec. 20, 2024, 12:52 a.m. OK Rust 2021 TESTS 21 93 0
297339637 posiedon_7 C Dec. 19, 2024, 5:15 p.m. OK Scala TESTS 21 546 0

remove filters

Back to search problems