提交时间:2024-08-19 14:56:24

运行 ID: 166591

#include<bits/stdc++.h> using namespace std; long long int t,n,i=0,j=0,temp=1,temp2=0; int main(){ cin>>t; int tmp=0; for(int k=0;k<t;k++){ cin>>n; tmp=0; for(i=0;i+j<n;i++){ if(tmp==1){ break; } for(int j=0;i+j<n;j++){ temp=1; temp2=1; if(i!=0) for(int k=0;k<i;k++){ temp=temp*2; } if(j!=0) for(int k=0;k<j;k++){ temp2=temp2*2; } if(temp+temp2==n){ cout<<"yes"<<endl; tmp=1; break; } } } if(tmp==0){ cout<<"no"<<endl; } } }