I cant see why my code is not working please help me with it

#include<bits/stdc++.h>
using namespace std;
int main(){
int test;
cin >> test;
while(test–){
int a,b ;
cin >> a >> b;
vector ans;
while(a>0){
if((a&1==1) && (b&1==0)){
ans.insert(ans.begin(),1);
}
else if((a&1==0) && (b&1==1))
{
ans.insert(ans.begin(),1);
}
else
{
ans.insert(ans.begin(),0);
}
a>>1;
b>>1;
}
for(auto x:ans)
{
cout<<x ;
}
cout<<"\n";
}
}

https://ide.geeksforgeeks.org/UxoRRlA9q2

Hello @akshpreetsinghs you should check the constraints before solvinf the question as it is clearly mentioned there that the length of the number can be upto 100 digits and even if you use long long int as the data type then also you would not be able to store the number with 18 digits at max.
you should try do this with the help of string only.

@akshpreetsinghs the binary representation of the number will even can be larger.
Here for your refernces i am attaching the correct code:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.