提交时间:2024-08-19 21:47:17
运行 ID: 168005
#include <iostream> #include<cstring> using namespace std; bool mi(int a) { for (int i = 0; (1 << i) <= a; ++i) { int p1=2*i; if(i==0) { p1=1; } for (int j =0; (1 << j) <= a; ++j) { int p2 =2*j; 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; }