# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
127995508 |
Practice:
eugalt |
1567B
- 35
|
Python 3
|
Accepted
|
639 ms
|
9268 KB
|
2021-09-05 23:27:27 |
2021-09-05 23:27:27 |
|
for s in[*open(0)][1:]:
a,b=map(int,s.split());r=a%4>1;i=a-1;j=1
while k:=i>>j:r|=(k&~i&1)<<j;j+=1
print(a+(r!=b)+(r^b==a))
Click to see test details