Codeforces Round 900 (Div. 3)

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
1878 Codeforces Round 900 (Div. 3) FINISHED False 8100 36084299 Sept. 26, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13139 ) E Iva & Pav PROGRAMMING binary search bitmasks data structures greedy

B'Iva and Pav are a famous Serbian competitive programming couple. In Serbia, they call Pav "papuca" and that 's why he will make all of Iva 's wishes come true. Iva gave Pav an array a of n elements. Let 's define f(l, r) = a_l & a_{l+1} & ... & a_r (here & denotes the bitwise AND operation). Note that f(l, r) is not defined when l>r . Iva also gave Pav q queries. Each query consists of 2 numbers, k and l , and she wants Pav to find the largest index r ( l <= r <= n ), such that f(l, r) ge k . Pav wants to solve this problem fast because he doesn 't want to upset Iva. He needs your help. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of array a . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ) -- the elements of array a . The third line of each test case contains a single integer q ( 1 <= q <= 10^5 ) -- the number of queries Iva gave Pav. The next q lines of each test case contains two numbers, l and k ( 1 <= l <= n , 1 <= k <= 10^9 ) -- the left bound for the subsegment, and the integer k described in statement. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . Also, it is guaranteed that the sum of q over all test cases does not exceed 2 cdot 10^5 . For each query output maximal index r ( l <= r <= n ) such that a_l & a_{l+1} & ... & a_r ge k . If such r doesn 't exist, output -1 . In the first test case n=5 , and the array a = [15, 14, 17, 42, 34] The first query asks for the biggest index r such that the f(1, r) ge 7 . f(1,1) = 15, f(1, 2) = 14,'...

Tutorials

Codeforces round #900 (Div.3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
225476661 bluemegane E Sept. 27, 2023, 8:18 a.m. OK C# 8 TESTS 20 670 83251200
225476073 bluemegane E Sept. 27, 2023, 8:14 a.m. OK C# 8 TESTS 20 732 83251200
225507607 ruban E Sept. 27, 2023, 12:08 p.m. OK FPC TESTS 20 1606 200601600
225452189 rickyxrc E Sept. 27, 2023, 3:05 a.m. OK GNU C++14 TESTS 20 217 63590400
225523604 chenly8128 E Sept. 27, 2023, 1:53 p.m. OK GNU C++14 TESTS 20 218 16076800
225500236 NY2025 E Sept. 27, 2023, 11:21 a.m. OK GNU C++14 TESTS 20 265 30720000
225495691 EasonLiang E Sept. 27, 2023, 10:50 a.m. OK GNU C++14 TESTS 20 265 31846400
225490835 datnq02 E Sept. 27, 2023, 10:11 a.m. OK GNU C++14 TESTS 20 265 51200000
225498810 zhangjianjuncd E Sept. 27, 2023, 11:12 a.m. OK GNU C++14 TESTS 20 265 54169600
225529125 HowlofBeast E Sept. 27, 2023, 2:30 p.m. OK GNU C++14 TESTS 20 280 16896000
225504238 marcus06 E Sept. 27, 2023, 11:46 a.m. OK GNU C++14 TESTS 20 280 31846400
225472075 katarina001 E Sept. 27, 2023, 7:39 a.m. OK GNU C++14 TESTS 20 295 30105600
225493055 LiuYu_penguin E Sept. 27, 2023, 10:29 a.m. OK GNU C++14 TESTS 20 311 30720000
225508948 n0sk1ll E Sept. 27, 2023, 12:17 p.m. OK GNU C++17 TESTS 20 233 9011200
225472815 jacl E Sept. 27, 2023, 7:48 a.m. OK GNU C++17 TESTS 20 233 20275200
225473756 jacl E Sept. 27, 2023, 7:55 a.m. OK GNU C++17 TESTS 20 234 20275200
225549280 nogondess E Sept. 27, 2023, 5 p.m. OK GNU C++17 TESTS 20 248 16076800
225459000 furon E Sept. 27, 2023, 4:42 a.m. OK GNU C++17 TESTS 20 249 3993600
225549462 GGOSHAB E Sept. 27, 2023, 5:02 p.m. OK GNU C++17 TESTS 20 249 16076800
225496067 Lee2004 E Sept. 27, 2023, 10:53 a.m. OK GNU C++17 TESTS 20 249 26726400
225490187 qhw_ E Sept. 27, 2023, 10:06 a.m. OK GNU C++17 TESTS 20 249 26726400
225451688 dadaxigua E Sept. 27, 2023, 2:56 a.m. OK GNU C++17 TESTS 20 249 27545600
225522426 momen159 E Sept. 27, 2023, 1:46 p.m. OK GNU C++17 TESTS 20 264 17612800
225521076 wqweto E Sept. 27, 2023, 1:37 p.m. OK GNU C++17 (64) TESTS 20 140 4198400
225483916 shiro53 E Sept. 27, 2023, 9:14 a.m. OK GNU C++17 (64) TESTS 20 140 4198400
225519699 wqweto E Sept. 27, 2023, 1:28 p.m. OK GNU C++17 (64) TESTS 20 155 4096000
225507773 cjnwq E Sept. 27, 2023, 12:09 p.m. OK GNU C++17 (64) TESTS 20 155 11571200
225456886 handofgod E Sept. 27, 2023, 4:14 a.m. OK GNU C++17 (64) TESTS 20 171 30924800
225454644 wangjunchao E Sept. 27, 2023, 3:42 a.m. OK GNU C++17 (64) TESTS 20 202 27648000
225449545 Cosysl E Sept. 27, 2023, 2:20 a.m. OK GNU C++17 (64) TESTS 20 218 33280000
225478475 Njaso E Sept. 27, 2023, 8:32 a.m. OK GNU C++17 (64) TESTS 20 233 19660800
225537772 tminh E Sept. 27, 2023, 3:32 p.m. OK GNU C++17 (64) TESTS 20 233 28876800
225450293 _chroneZ E Sept. 27, 2023, 2:32 a.m. OK GNU C++17 (64) TESTS 20 249 26214400
225535246 Retired_Isaunoya E Sept. 27, 2023, 3:13 p.m. OK GNU C++20 (64) TESTS 20 109 2150400
225495537 str3ss E Sept. 27, 2023, 10:49 a.m. OK GNU C++20 (64) TESTS 20 109 4198400
225489169 _drifter E Sept. 27, 2023, 9:57 a.m. OK GNU C++20 (64) TESTS 20 109 5017600
225535281 Retired_Isaunoya E Sept. 27, 2023, 3:14 p.m. OK GNU C++20 (64) TESTS 20 124 2150400
225489450 yanke E Sept. 27, 2023, 9:59 a.m. OK GNU C++20 (64) TESTS 20 124 4198400
225462001 abz-codes E Sept. 27, 2023, 5:18 a.m. OK GNU C++20 (64) TESTS 20 124 4198400
225535334 Retired_Isaunoya E Sept. 27, 2023, 3:14 p.m. OK GNU C++20 (64) TESTS 20 139 2150400
225534132 haku_suki E Sept. 27, 2023, 3:05 p.m. OK GNU C++20 (64) TESTS 20 139 9625600
225587832 ssk4988 E Sept. 28, 2023, 2:50 a.m. OK GNU C++20 (64) TESTS 20 139 14233600
225588054 IanISam E Sept. 28, 2023, 2:57 a.m. OK GNU C++20 (64) TESTS 20 139 14438400
225476756 Carve E Sept. 27, 2023, 8:19 a.m. OK Go TESTS 20 498 128102400
225484446 wdjuruo E Sept. 27, 2023, 9:18 a.m. OK Java 11 TESTS 20 1091 65331200
225481617 vijender_8601 E Sept. 27, 2023, 8:56 a.m. OK Java 11 TESTS 20 1434 32358400
225590959 letrithong E Sept. 28, 2023, 3:52 a.m. OK Java 11 TESTS 20 2168 38092800
225500516 TJ_Codes E Sept. 27, 2023, 11:23 a.m. OK Java 11 TESTS 20 2511 32256000
225530593 whd_CN E Sept. 27, 2023, 2:40 p.m. OK Java 17 TESTS 20 919 42700800
225505730 yadavDipesh E Sept. 27, 2023, 11:56 a.m. OK Java 17 TESTS 20 951 47104000
225526533 sahil.dhiman03022001 E Sept. 27, 2023, 2:13 p.m. OK Java 17 TESTS 20 982 85196800
225502664 KAZHYI E Sept. 27, 2023, 11:36 a.m. OK Java 17 TESTS 20 1076 40243200
225503935 AKhacks E Sept. 27, 2023, 11:44 a.m. OK Java 17 TESTS 20 1138 105881600
225471138 1isGreaterThan0 E Sept. 27, 2023, 7:30 a.m. OK Java 17 TESTS 20 1201 90419200
225576661 cpp10 E Sept. 27, 2023, 10:25 p.m. OK Java 17 TESTS 20 1388 39219200
225462808 songminsang E Sept. 27, 2023, 5:27 a.m. OK Java 17 TESTS 20 1388 92672000
225450170 keduolimm E Sept. 27, 2023, 2:30 a.m. OK Java 17 TESTS 20 1465 57036800
225576706 cpp10 E Sept. 27, 2023, 10:26 p.m. OK Java 17 TESTS 20 1528 39424000
225470001 Ligh0x74 E Sept. 27, 2023, 7:19 a.m. OK Java 21 TESTS 20 1169 90828800
225568440 karanprasad2121 E Sept. 27, 2023, 8:07 p.m. OK Java 21 TESTS 20 2121 0
225585242 xiaoshua E Sept. 28, 2023, 1:55 a.m. OK Java 8 TESTS 20 312 20787200
225450529 Zhanzhe_Lee E Sept. 27, 2023, 2:37 a.m. OK Java 8 TESTS 20 436 72294400
225458885 pribic E Sept. 27, 2023, 4:40 a.m. OK Java 8 TESTS 20 514 51814400
225460193 pribic E Sept. 27, 2023, 4:57 a.m. OK Java 8 TESTS 20 514 51916800
225459125 pribic E Sept. 27, 2023, 4:43 a.m. OK Java 8 TESTS 20 530 51916800
225458948 pribic E Sept. 27, 2023, 4:41 a.m. OK Java 8 TESTS 20 546 51814400
225502432 cai_lian_2023 E Sept. 27, 2023, 11:35 a.m. OK Java 8 TESTS 20 1044 67584000
225477119 v3n1v1c11v1c1 E Sept. 27, 2023, 8:22 a.m. OK Java 8 TESTS 20 1153 125644800
225476265 v3n1v1c11v1c1 E Sept. 27, 2023, 8:15 a.m. OK Java 8 TESTS 20 1169 125644800
225549755 formidablechief_27 E Sept. 27, 2023, 5:04 p.m. OK Java 8 TESTS 20 1372 15052800
225470866 tatianyi E Sept. 27, 2023, 7:27 a.m. OK MS C++ 2017 TESTS 20 1185 11571200
225572596 Gaurav1 E Sept. 27, 2023, 9:06 p.m. OK PyPy 2 TESTS 20 1934 35430400
225477987 hunglomdom E Sept. 27, 2023, 8:29 a.m. OK PyPy 3 TESTS 20 3743 88473600
225448809 YMSeah E Sept. 27, 2023, 2:04 a.m. OK PyPy 3-64 TESTS 20 342 88883200
225452759 titan23 E Sept. 27, 2023, 3:14 a.m. OK PyPy 3-64 TESTS 20 374 65228800
225479254 AndreiZherder E Sept. 27, 2023, 8:38 a.m. OK PyPy 3-64 TESTS 20 498 84172800
225581547 RobinFromTheHood E Sept. 28, 2023, 12:30 a.m. OK PyPy 3-64 TESTS 20 967 36454400
225491386 _drifter E Sept. 27, 2023, 10:16 a.m. OK PyPy 3-64 TESTS 20 1497 60108800
225551259 ruvxei E Sept. 27, 2023, 5:17 p.m. OK PyPy 3-64 TESTS 20 1809 29593600
225486292 linhua E Sept. 27, 2023, 9:33 a.m. OK PyPy 3-64 TESTS 20 2027 134758400
225471530 booskako E Sept. 27, 2023, 7:34 a.m. OK PyPy 3-64 TESTS 20 2090 59699200
225536826 InHng E Sept. 27, 2023, 3:25 p.m. OK PyPy 3-64 TESTS 20 2105 125952000
225567027 kunalseth E Sept. 27, 2023, 7:49 p.m. OK PyPy 3-64 TESTS 20 2262 101683200
225455538 TechSavvyAmit E Sept. 27, 2023, 3:56 a.m. OK Python 3 TESTS 20 4461 32358400

remove filters

Back to search problems