提交时间:2024-06-01 15:56:50

运行 ID: 150144

#include <iostream> #include <cmath> using namespace std; bool man(int n) { if ((n & (n - 1)) == 0) { return true; } int i = 1; while (pow(2, i) <= n) { int j = i + 1; while (pow(2, j) <= n) { if (pow(2, i) + pow(2, j) == n) { return true; } j++; } i++; } return false; } int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (man(n)) { cout << "yes" << endl; } else { cout << "no" << endl; } } return 0; }