提交时间:2024-08-19 10:59:39

运行 ID: 166298

#include<bits/stdc++.h> using namespace std; bool f(long long n){ return (!(n&(n-1)))&&n; } int main(){ int t,a; long long n,c; cin>>t; while(t--){ cin>>n; if(n%2==1||n==0){ cout<<"no"<<endl; continue; } if(f(n)==1){ if(n!=2){ cout<<"yes"<<endl; } else{ cout<<"no"<<endl; } continue; } long long m=n; a=0; while(m>1){ m=m>>1; a++; } if(f(n-(long long)pow(2,a))==1) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0; }