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 two integers l and r in binary representation. Let g(x, y) be equal to the bitwise XOR of all integers from x to y inclusive (that is x oplus (x+1) oplus ... oplus (y-1) oplus y ). Let's define f(l, r) as the maximum of all values of g(x, y) satisfying l <= x <= y <= r . Output f(l, r) . The first line contains a single integer n ( 1 <= n <= 10^6 ) -- the length of the binary representation of r . The second line contains the binary representation of l -- a string of length n consisting of digits 0 and 1 ( 0 <= l < 2^n ). The third line contains the binary representation of r -- a string of length n consisting of digits 0 and 1 ( 0 <= r < 2^n ). It is guaranteed that l <= r . The binary representation of r does not contain any extra leading zeros (if r=0 , the binary representation of it consists of a single zero). The binary representation of l is preceded with leading zeros so that its length is equal to n . In a single line output the value of f(l, r) for the given pair of l and r in binary representation without extra leading zeros. In sample test case l=19 , r=122 . f(x,y) is maximal and is equal to 127 , with x=27 , y=100 , for example. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
109283368 |
Gassa |
E |
March 6, 2021, 5:36 p.m. |
OK |
D |
TESTS |
48 |
218 |
27136000 |
|
|
109300769 |
jxm2001_ |
E |
March 7, 2021, 2:38 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
31 |
2048000 |
|
|
109308217 |
xpysss |
E |
March 7, 2021, 5:40 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
46 |
2048000 |
|
|
109299054 |
Inf_Voltage |
E |
March 7, 2021, 1:41 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
46 |
2048000 |
|
|
109298122 |
_xiyan |
E |
March 7, 2021, 12:54 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
46 |
3481600 |
|
|
109274196 |
clfzs |
E |
March 6, 2021, 4:13 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
46 |
11980800 |
|
|
109285822 |
xing89qs |
E |
March 6, 2021, 6:10 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
61 |
2969600 |
|
|
109297836 |
anodiebird |
E |
March 7, 2021, 12:37 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
62 |
2969600 |
|
|
109297856 |
lee0560 |
E |
March 7, 2021, 12:39 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
77 |
1740800 |
|
|
109301890 |
lovelyz |
E |
March 7, 2021, 3:12 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
108 |
3481600 |
|
|
109299237 |
luogu_bot1 |
E |
March 7, 2021, 1:48 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
156 |
26009600 |
|
|
109286865 |
sinus_070 |
E |
March 6, 2021, 6:27 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
46 |
3481600 |
|
|
109296121 |
thilio |
E |
March 6, 2021, 10:45 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
77 |
3379200 |
|
|
109296063 |
thilio |
E |
March 6, 2021, 10:43 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
77 |
3379200 |
|
|
109288864 |
rainnoob |
E |
March 6, 2021, 7:01 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
77 |
13107200 |
|
|
109271291 |
Hodobox |
E |
March 6, 2021, 4:04 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
77 |
15155200 |
|
|
109296092 |
thilio |
E |
March 6, 2021, 10:44 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
78 |
3379200 |
|
|
109296802 |
Reverent |
E |
March 6, 2021, 11:25 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
93 |
3379200 |
|
|
109279489 |
sjc061031 |
E |
March 6, 2021, 4:54 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
155 |
23756800 |
|
|
109273738 |
szw720711 |
E |
March 6, 2021, 4:11 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
155 |
23756800 |
|
|
109296237 |
Uzumaki_Narutoo |
E |
March 6, 2021, 10:51 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
296 |
5939200 |
|
|
109290144 |
limabeans |
E |
March 6, 2021, 7:27 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3481600 |
|
|
109288626 |
Luca |
E |
March 6, 2021, 6:56 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
2048000 |
|
|
109288595 |
Luca |
E |
March 6, 2021, 6:56 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
2048000 |
|
|
109275472 |
goshko |
E |
March 6, 2021, 4:16 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
3379200 |
|
|
109270421 |
WiwiHo |
E |
March 6, 2021, 4:01 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
3481600 |
|
|
109271289 |
natsugiri |
E |
March 6, 2021, 4:04 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
3993600 |
|
|
109278914 |
Mjgonzales |
E |
March 6, 2021, 4:50 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
5017600 |
|
|
109271211 |
BigBag |
E |
March 6, 2021, 4:03 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
5017600 |
|
|
109282667 |
Nika_Tamliani |
E |
March 6, 2021, 5:26 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
46 |
6144000 |
|
|
109296759 |
fr1234 |
E |
March 6, 2021, 11:23 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
61 |
3481600 |
|
|
109300749 |
dysyn1314 |
E |
March 7, 2021, 2:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
7270400 |
|
|
109297168 |
Dragnoid99 |
E |
March 6, 2021, 11:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
4403200 |
|
|
109270958 |
Akulyat |
E |
March 6, 2021, 4:02 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
4403200 |
|
|
109279646 |
ConanYu |
E |
March 6, 2021, 4:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
4710400 |
|
|
109310921 |
rgnerdplayer |
E |
March 7, 2021, 6:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
5324800 |
|
|
109282770 |
smax |
E |
March 6, 2021, 5:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
5324800 |
|
|
109288843 |
Mangooste |
E |
March 6, 2021, 7 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
6144000 |
|
|
109271539 |
Totiniii |
E |
March 6, 2021, 4:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
8704000 |
|
|
109295920 |
galen_colin |
E |
March 6, 2021, 10:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
29900800 |
|
|
109295990 |
galen_colin |
E |
March 6, 2021, 10:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
46 |
30003200 |
|
|
109279709 |
godxpunk |
E |
March 6, 2021, 4:55 p.m. |
OK |
Java 11 |
TESTS |
48 |
234 |
10342400 |
|
|
109279564 |
hu_tao |
E |
March 6, 2021, 4:54 p.m. |
OK |
Java 8 |
TESTS |
48 |
140 |
2048000 |
|
|
109295732 |
ZerooCool |
E |
March 6, 2021, 10:26 p.m. |
OK |
Java 8 |
TESTS |
48 |
202 |
2150400 |
|
|
109279203 |
Tlatoani |
E |
March 6, 2021, 4:51 p.m. |
OK |
Kotlin |
TESTS |
48 |
233 |
19968000 |
|
|
109292291 |
r57shell |
E |
March 6, 2021, 8:19 p.m. |
OK |
MS C++ |
TESTS |
48 |
62 |
7065600 |
|
|
109290252 |
Gaurav1 |
E |
March 6, 2021, 7:30 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
342 |
58368000 |
|
|
109293595 |
Genius3435 |
E |
March 6, 2021, 8:58 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
295 |
9932800 |
|
|
109293557 |
Genius3435 |
E |
March 6, 2021, 8:57 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
311 |
9830400 |
|
|
109293708 |
Genius3435 |
E |
March 6, 2021, 9:01 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
311 |
9932800 |
|
|
109293425 |
Genius3435 |
E |
March 6, 2021, 8:53 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
374 |
30208000 |
|
|
109293349 |
Genius3435 |
E |
March 6, 2021, 8:50 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
389 |
30208000 |
|
|
109292504 |
r57shell |
E |
March 6, 2021, 8:25 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
748 |
82739200 |
|
|
109275447 |
er888kh |
E |
March 6, 2021, 4:16 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
842 |
21196800 |
|
|
109271736 |
nwi |
E |
March 6, 2021, 4:05 p.m. |
OK |
Python 2 |
TESTS |
48 |
108 |
6553600 |
|
|
109284091 |
sh1194 |
E |
March 6, 2021, 5:45 p.m. |
OK |
Python 3 |
TESTS |
48 |
77 |
5324800 |
|
|
109280868 |
fezjo |
E |
March 6, 2021, 5:05 p.m. |
OK |
Python 3 |
TESTS |
48 |
78 |
5324800 |
|
|
109292713 |
r57shell |
E |
March 6, 2021, 8:31 p.m. |
OK |
Python 3 |
TESTS |
48 |
717 |
51302400 |
|
|
109292576 |
r57shell |
E |
March 6, 2021, 8:27 p.m. |
OK |
Python 3 |
TESTS |
48 |
733 |
52121600 |
|
|
109286219 |
apilat |
E |
March 6, 2021, 6:16 p.m. |
OK |
Rust |
TESTS |
48 |
61 |
13107200 |
|
|
remove filters
Back to search problems