0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:28:47 +00:00

D - Zookeeper and The Infinite Zoo

https://codeforces.com/contest/1491/submission/179545851
This commit is contained in:
Baoshuo Ren 2022-11-06 20:56:14 +08:00
parent e15651066a
commit a041302b0d
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

38
Codeforces/1491/D/D.cpp Normal file
View File

@ -0,0 +1,38 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
int q;
cin >> q;
while (q--) {
unsigned int u, v;
int cnt_u = 0,
cnt_v = 0;
cin >> u >> v;
bool flag = u <= v;
for (int i = 0; i < 30; i++) {
if (u & (1 << i)) cnt_u++;
if (v & (1 << i)) cnt_v++;
if (cnt_u < cnt_v) {
flag = false;
break;
}
}
cout << (flag ? "YES" : "NO") << endl;
}
return 0;
}