提交时间:2024-08-19 22:33:39
运行 ID: 168095
#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; k=2; //cout<<w<<endl; if(w==2) { cout<<"yes"<<endl; }else{ while(k<w) { k=k*2; } k=k/2; w=w-k; //cout<<k<<endl; //cout<<w<<endl; if(w==0) cout<<"yes"<<endl; else cout<<"no"<<endl; } } }