提交时间:2024-08-20 13:22:05

运行 ID: 168705

#include <iostream> #include<cstring> using namespace std; bool mi(int a) { for (int i = 0;i <= a; ++i) { int p1=2*p1; if(i==0) { p1=1; } for (int j =0;j<= a; ++j) { int p2 =2*p2; if(j==0) { p2=1; } if (p1 + p2 == a) { return true; } } } return false; } int main() { int n, a; cin >> n; const int MAX_N = 100; char r[MAX_N][4]; for (int i = 0; i < n; ++i) { cin >> a; if (mi(a)) { strcpy(r[i], "Yes"); } else { strcpy(r[i], "No"); } } for (int i = 0; i < n; ++i) { cout << r[i] << "\n"; } return 0; }