fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. long long q,a,b;
  4. void input()
  5. {
  6. cin >> q;
  7. }
  8. void solve()
  9. {
  10. while(q--)
  11. {
  12. long long mask = (1ll<<5ll)-1ll;
  13. cin >> a >> b;
  14. long long res_xor = ((mask&a)^(mask&b));
  15. a= a>>5;
  16. b= b>>5;
  17. long long res_and = ((mask&a)&(mask&b))<<5;
  18. a= a>>5;
  19. b= b>>5;
  20. long long res_or = ((mask&a)|(mask&b))<<10;
  21. long long ans = (res_xor|res_and)|res_or;
  22. cout << ans <<"\n";
  23. }
  24. }
  25. int main()
  26. {
  27. ios_base::sync_with_stdio(0);
  28. cin.tie(0);
  29. input();
  30. solve();
  31.  
  32. }
  33.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty