fork download
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3. using namespace std;
  4. #define ll long long
  5. int const mod = 1e9 + 7;
  6. #define int long long
  7. int32_t main() {
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(nullptr);
  10. cout.tie(nullptr);
  11. int t;
  12. cin >> t;
  13. while (t--) {
  14. ll x, y, z;
  15. cin >> x >> y >> z;
  16. ll a = x | z;
  17. ll b = x | y;
  18. ll c = z | y;
  19. // cout << a << ' ' << b << ' ' << c << '\n';
  20. ll x1 = a & b, y1 = b & c, z1 = a & c;
  21. if ((x1 == x) && (z1 == z) && (y1 == y))
  22. cout << "YES";
  23. else
  24. cout << "NO";
  25. cout << '\n';
  26. }
  27. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
NO
NO