The Description Of Problem:
A. XORwice
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
In order to celebrate Twice's 5th anniversary, Tzuyu and Sana decided to play a game.
Tzuyu gave Sana two integers a and b and a really important quest.
In order to complete the quest, Sana has to output the smallest possible value of (a⊕x)+(b⊕x)for any given x, where ⊕ denotes the bitwise XOR operation.
Input
Each test contains multiple test cases. The first line contains the number of test cases t (1≤t≤104). Description of the test cases follows.
The only line of each test case contains two integers a and b (1≤a,b≤109).
Output
For each testcase, output the smallest possible value of the given expression.
Example:
input:6612495983228144925291211
output:10138911862370
My Answer Code:/*
Author:Albert Tesla Wizard
Time:2020/10/24 15:42
*/#include<bits/stdc++.h>usingnamespace std;using ull=unsignedlonglong;intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);int t;
cin>>t;
vector<vector<ull>>a(t,vector<ull>(2));
vector<ull>ans(t);for(int i=0;i<t;i++){
cin>>a[i][0]>>a[i][1];}for(int i=0;i<t;i++){int Min=min(a[i][0],a[i][1]);
ans[i]=(a[i][0]^Min)+(a[i][1]^Min);}for(int i=0;i<t;i++)cout<<ans[i]<<'\n';return0;}