IMohammedNasr

E. Playing With Bits

Sep 24th, 2022
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3. #include <ext/pb_ds/tree_policy.hpp>
  4. using namespace __gnu_pbds;
  5. using namespace std;
  6. #define cin(v) for (auto &i : v) cin >> i;
  7. #define cout(v) for (auto &i : v) cout << i << " "; cout<<'\n';
  8. #define ll long long
  9. #define all(v) v.begin(), v.end()
  10. #define rall(v) v.rbegin(), v.rend()
  11. #define MOD 1000000007
  12. #define Ceil(a,b) a / b + (a % b != 0)
  13. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs"<< "\n";
  14. #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  15. #define multi_ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
  16.  
  17. void Warding()
  18. {
  19.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  20. #ifndef ONLINE_JUDGE
  21.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  22. #endif
  23. }
  24.  
  25. /*
  26. STOP USING int  
  27. */
  28.  
  29. void solve(){
  30.     ll a, b; cin>>a>>b;
  31.     bool flag = (a | b) == a;
  32.     cout<<(flag ? "YES" : "NO")<<endl;
  33. }
  34.  
  35. int main()
  36. {
  37.     Warding();
  38.     int TC = 1;
  39.     cin >> TC;
  40.     while (TC--)
  41.     {
  42.         solve();
  43.     }
  44.     Time
  45. }
Advertisement
Add Comment
Please, Sign In to add comment