提交时间:2024-08-20 13:30:40

运行 ID: 168734

#include <iostream> #include<cstring> using namespace std; bool mi(int a) { int p1=1,p2=1; for (int i = 0;i <= a; ++i) { p1=2*p1; if(i==0) { p1=1; } for(int j =0;j<= a; ++j) { p2 =2*p2; if(j==0) { p2=1; } if (p1 + p2 == a) { return true; } } } return false; } int main() { int n, a; cin >> n; for (int i = 0; i < n; ++i) { cin >> a; if (mi(a)) { cout<<"Yes"<<"\n"; } else { cout<<"no"<<"\n"; } } return 0; }