提交时间:2023-08-21 22:49:18
运行 ID: 99085
#include <iostream> #include <cmath> using namespace std; int lp2(int x){ x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); x |= (x >> 8); x |= (x >> 16); return (x & ~(x>>1)); } int main(){ int n,x; string y; cin >> n; for(int i=0;i<n;i++){ cin >> x; if(x-lp2(x)-lp2(x-lp2(x))==0) y += "yes\n"; else y += "no\n"; } cout << y; return 0; }