提交时间:2024-08-19 09:58:36
运行 ID: 166121
#include <bits/stdc++.h> using namespace std; long long a[100005]; int main() { a[0] = 1; for (int i = 1; i <= 100000; i++) { a[i] = a[i - 1] * 2; } int t; cin >> t; while (t--) { int n; cin >> n; bool flag = false; for (int i = 0; i <= 100000; i++) { for (int j = 0; j <= 100000; j++) { if (n == a[i] + a[j]) { flag = true; break; } if (a[i] + a[j] > n) j = 100000; } } if (flag) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }