提交时间:2024-08-20 00:05:20
运行 ID: 168200
#include<iostream> using namespace std; int main() { int n,w,k=2; cin>>n; for(int i=1;i<=n;i++) { cin>>w; while(k<w) { k=k*2; } k=k/2; //cout<<k<<endl; w=w-k; if(w>0&&w<=2) { cout<<"yes"<<endl; }else{ while(k<=w) { k=k*2; } k=k/2; //cout<<k<<endl; w=w-k; if(w==0){ cout<<"yes"<<endl; }else{ cout<<"no"<<endl; } } // if(w==1 || w%2==0) // cout<<"yes"<<endl; // else // cout<<"no"<<endl; } }