#include <cstdio>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
unsigned short a, b;
int t;
#ifndef ONLINE_JUDGE
freopen("d:\\OJ\\uva_in.txt", "r", stdin);
#endif
scanf("%d", &t);
while (t-- > 0) {
scanf("%hu%hu", &a, &b);
int i;
for (i = 0; i < 16; i++) {
unsigned short tmp = (a << i) | (a >> (16 - i));
if (tmp == b) {
printf("YES\n");
break;
}
}
if (i >= 16) {
printf("NO\n");
}
}
return 0;
}
题目1151:位操作练习
最新推荐文章于 2020-05-28 23:49:20 发布