提交时间:2024-08-19 21:21:17

运行 ID: 167960

#include <iostream> using namespace std; bool mi(int a) { for (int i = 0; (1 << i) <= a; ++i) { for (int j = i + 1; (1 << j) <= a; ++j) { if ((1 << i) + (1 << j) == 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; }