提交时间:2023-08-21 23:28:15
运行 ID: 99096
#include<bits/stdc++.h> using namespace std; int t; long long n; int main(){ cin>>t; while(t--){ cin>>n; if(n==2){ cout<<"yes"<<endl; continue; } if(n<4){ cout<<"no"<<endl; continue; } if(n%2!=0){ int uu=n-1; bool pd=0; for(int i=1;i*2<=uu;i++){ if(pow(2,i)==uu){ pd=1; break; } } if(pd){ cout<<"yes"<<endl; continue; } else{ cout<<"no"<<endl; continue; } } int cnt=0; for(int i=1; i<64; i++){ n>>=1; if(n&1) cnt++; } if(cnt==2 || cnt==1) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0; }