My issue
My code
#include <bits/stdc++.h>
using namespace std;
void solve(){
long long c;
cin>>c;
long long d=0LL;
while(pow(2,d)<c){
d++;
}
long long a=0LL, b=0LL;
bool change=true;
for(long long i=d-1;i>=0;i--){
if(i==d-1){
a|=(1<<i);
}
else{
if(c & (1<<i)){
b|=(1<<i);
}else{
a|=(1<<i);
b|=(1<<i);
}
}
}
cout<<a*b<<endl;
}
int main() {
int t;
cin>>t;
while(t--){
solve();
}
return 0;
}
Problem Link: IRSTXOR Problem - CodeChef