提交时间:2023-08-21 22:44:27
运行 ID: 99084
#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; cin >> n; for(int i=0;i<n;i++){ cin >> x; if(x-lp2(x)-lp2(x-lp2(x))==0) cout << "yes\n"; else cout << "no\n"; } return 0; }