提交时间:2024-08-19 22:36:43

运行 ID: 168099

#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; } } }