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.
Problems
B'You are given an array a of n integers. You need to find the maximum value of a_{i} | ( a_{j} & a_{k} ) over all triplets (i,j,k) such that i < j < k . Here & denotes the bitwise AND operation, and | denotes the bitwise OR operation. The first line of input contains the integer n ( 3 <= n <= 10^{6} ), the size of the array a . Next line contains n space separated integers a_1 , a_2 , ..., a_n ( 0 <= a_{i} <= 2 cdot 10^{6} ), representing the elements of the array a . Output a single integer, the maximum value of the expression given in the statement. In the first example, the only possible triplet is (1, 2, 3) . Hence, the answer is 2 | (4 & 6) = 6 . In the second example, there are 4 possible triplets: The maximum value hence is 12 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
59489468 |
hos.lyric |
F |
Aug. 25, 2019, 6:42 p.m. |
OK |
D |
TESTS |
141 |
889 |
91340800 |
|
2600 |
59552219 |
nantf |
F |
Aug. 27, 2019, 3:54 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
156 |
26726400 |
|
2600 |
60511222 |
vjudge5 |
F |
Sept. 14, 2019, 3:07 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
171 |
34099200 |
|
2600 |
60511742 |
_ppp204 |
F |
Sept. 14, 2019, 3:31 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
11980800 |
|
2600 |
61912386 |
Backseat-Stargazer |
F |
Oct. 5, 2019, 11:15 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
12390400 |
|
2600 |
59593944 |
yijan |
F |
Aug. 27, 2019, 11:17 p.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
16793600 |
|
2600 |
59564110 |
QAQAutoMaton |
F |
Aug. 27, 2019, 9:56 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
20275200 |
|
2600 |
59579198 |
11235813213455 |
F |
Aug. 27, 2019, 3:18 p.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
20992000 |
|
2600 |
63691212 |
wxyww |
F |
Oct. 29, 2019, 2:45 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
32051200 |
|
2600 |
63222346 |
x_faraway_x |
F |
Oct. 23, 2019, 8:15 a.m. |
OK |
GNU C++11 |
TESTS |
142 |
202 |
36044800 |
|
2600 |
60025109 |
luogu_bot5 |
F |
Sept. 4, 2019, 2 p.m. |
OK |
GNU C++11 |
TESTS |
142 |
217 |
16793600 |
|
2600 |
59521873 |
liouzhou_101 |
F |
Aug. 26, 2019, 12:09 p.m. |
OK |
GNU C++14 |
TESTS |
142 |
186 |
27340800 |
|
2600 |
59515601 |
Scut82 |
F |
Aug. 26, 2019, 10:03 a.m. |
OK |
GNU C++14 |
TESTS |
142 |
233 |
33689600 |
|
2600 |
59583588 |
21August |
F |
Aug. 27, 2019, 5:03 p.m. |
OK |
GNU C++14 |
TESTS |
142 |
312 |
20787200 |
|
2600 |
59582944 |
21August |
F |
Aug. 27, 2019, 4:48 p.m. |
OK |
GNU C++14 |
TESTS |
142 |
326 |
20787200 |
|
2600 |
69935674 |
zhangqingqi |
F |
Feb. 1, 2020, 3:34 a.m. |
OK |
GNU C++14 |
TESTS |
142 |
326 |
25190400 |
|
2600 |
59492026 |
mastermindevil |
F |
Aug. 25, 2019, 7:44 p.m. |
OK |
GNU C++14 |
TESTS |
141 |
327 |
20787200 |
|
2600 |
61746737 |
Nson |
F |
Oct. 3, 2019, 12:57 a.m. |
OK |
GNU C++14 |
TESTS |
142 |
327 |
25190400 |
|
2600 |
59478991 |
ecnerwala |
F |
Aug. 25, 2019, 4:14 p.m. |
OK |
GNU C++14 |
TESTS |
138 |
343 |
21196800 |
|
2600 |
59502216 |
Quang |
F |
Aug. 26, 2019, 3:38 a.m. |
OK |
GNU C++14 |
TESTS |
142 |
343 |
25190400 |
|
2600 |
59670024 |
dhxh |
F |
Aug. 29, 2019, 3:39 p.m. |
OK |
GNU C++14 |
TESTS |
142 |
358 |
16076800 |
|
2600 |
59487443 |
neal |
F |
Aug. 25, 2019, 6 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
156 |
14540800 |
|
2600 |
59487720 |
neal |
F |
Aug. 25, 2019, 6:05 p.m. |
OK |
GNU C++17 |
TESTS |
141 |
171 |
14540800 |
|
2600 |
59511321 |
interestingLSY |
F |
Aug. 26, 2019, 8:06 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
233 |
22118400 |
|
2600 |
60510888 |
zryabc |
F |
Sept. 14, 2019, 2:51 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
295 |
32051200 |
|
2600 |
59512671 |
nickluo |
F |
Aug. 26, 2019, 8:35 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
296 |
25702400 |
|
2600 |
60511344 |
vjudge2 |
F |
Sept. 14, 2019, 3:13 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
312 |
32051200 |
|
2600 |
59784670 |
dtc03012 |
F |
Aug. 31, 2019, 5:02 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
358 |
20787200 |
|
2600 |
60511160 |
vjudge2 |
F |
Sept. 14, 2019, 3:04 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
373 |
12083200 |
|
2600 |
59561381 |
_BARUTO |
F |
Aug. 27, 2019, 8:42 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
374 |
9011200 |
|
2600 |
59560643 |
lizhidan |
F |
Aug. 27, 2019, 8:21 a.m. |
OK |
GNU C++17 |
TESTS |
142 |
389 |
12390400 |
|
2600 |
65281888 |
happybelly |
F |
Nov. 18, 2019, 6:17 a.m. |
OK |
Java 11 |
TESTS |
142 |
1231 |
102195200 |
|
2600 |
65238257 |
happybelly |
F |
Nov. 17, 2019, 8:01 a.m. |
OK |
Java 11 |
TESTS |
142 |
1232 |
102195200 |
|
2600 |
59510143 |
uwi |
F |
Aug. 26, 2019, 7:40 a.m. |
OK |
Java 8 |
TESTS |
142 |
389 |
22937600 |
|
2600 |
59510451 |
uwi |
F |
Aug. 26, 2019, 7:47 a.m. |
OK |
Java 8 |
TESTS |
142 |
421 |
15052800 |
|
2600 |
59572641 |
StayAwayFromBitches |
F |
Aug. 27, 2019, 1:06 p.m. |
OK |
Java 8 |
TESTS |
142 |
514 |
6451200 |
|
2600 |
59637239 |
Taran_1407 |
F |
Aug. 28, 2019, 9:36 p.m. |
OK |
Java 8 |
TESTS |
142 |
624 |
37888000 |
|
2600 |
59574414 |
StayAwayFromBitches |
F |
Aug. 27, 2019, 1:40 p.m. |
OK |
Java 8 |
TESTS |
142 |
826 |
90112000 |
|
2600 |
61094940 |
Tomg |
F |
Sept. 23, 2019, 1:58 a.m. |
OK |
Java 8 |
TESTS |
142 |
951 |
99225600 |
|
2600 |
59501903 |
dalt |
F |
Aug. 26, 2019, 3:23 a.m. |
OK |
Java 8 |
TESTS |
142 |
1060 |
47411200 |
|
2600 |
59592668 |
qwerty787788 |
F |
Aug. 27, 2019, 9:50 p.m. |
OK |
Java 8 |
TESTS |
142 |
1060 |
67379200 |
|
2600 |
59576281 |
ankurdua15 |
F |
Aug. 27, 2019, 2:16 p.m. |
OK |
Java 8 |
TESTS |
142 |
1060 |
118476800 |
|
2600 |
59555030 |
tmwilliamlin168 |
F |
Aug. 27, 2019, 5:44 a.m. |
OK |
Java 8 |
TESTS |
142 |
1091 |
47411200 |
|
2600 |
60589005 |
vjudge5 |
F |
Sept. 15, 2019, 12:13 a.m. |
OK |
MS C++ |
TESTS |
142 |
1029 |
188416000 |
|
2600 |
60589105 |
vjudge1 |
F |
Sept. 15, 2019, 12:19 a.m. |
OK |
MS C++ |
TESTS |
142 |
1044 |
188416000 |
|
2600 |
60547158 |
vjudge2 |
F |
Sept. 14, 2019, 1:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
717 |
36044800 |
|
2600 |
69002832 |
AleksanderBalobanov |
F |
Jan. 17, 2020, 8:36 p.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
748 |
45875200 |
|
2600 |
59553566 |
siwei |
F |
Aug. 27, 2019, 4:54 a.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
1076 |
20787200 |
|
2600 |
62553201 |
Kirundel |
F |
Oct. 14, 2019, 9:33 a.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
1091 |
29286400 |
|
2600 |
59708419 |
nuchenghao |
F |
Aug. 30, 2019, 1:39 p.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
1434 |
180531200 |
|
2600 |
59788609 |
nuchenghao |
F |
Aug. 31, 2019, 6:27 a.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
1466 |
180531200 |
|
2600 |
59792694 |
nuchenghao |
F |
Aug. 31, 2019, 7:38 a.m. |
OK |
MS C++ 2017 |
TESTS |
142 |
1497 |
180531200 |
|
2600 |
69853523 |
sansen |
F |
Jan. 30, 2020, 4:19 p.m. |
OK |
Rust |
TESTS |
142 |
342 |
29184000 |
|
2600 |
59924596 |
sansen |
F |
Sept. 3, 2019, 2:48 a.m. |
OK |
Rust |
TESTS |
142 |
389 |
29184000 |
|
2600 |
59681089 |
ValenKof |
F |
Aug. 29, 2019, 8:41 p.m. |
OK |
Rust |
TESTS |
142 |
577 |
50585600 |
|
2600 |
remove filters
Back to search problems