All Submissions


Sumit likes to play with bits and so one day, out of blue, he came to me and said that he will give me any two number, A and B, and I have to give him the maximum number which is the result of A' xor B'. Here A' and B' are number obtained after shuffling the bits of A and B respectively.

N is the number of bits.
A and B are integers.
Limits
T <= 100
1 <= N <= 30
0 <= A, B < 2N

Sample Input
3
3 5 4
5 0 1
4 3 7

Sample Output
7
16
14

Explanation
Case 1: 5 and 4 as 3-bit binary strings are (101)2 and (100)2 respectively. After shuffling, xor can be maximum for (101)2 ^ (010)2 = (111)2 = 7

Problem Setter : Pushkar Anand

Languages: AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

zvit:
Q. test

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0