提交时间:2024-08-19 21:20:42

运行 ID: 167959

#include <bits/stdc++.h> using namespace std; int t; long long n, j = 1; bool flag; bool f(long long x){ long long k = 1; while(k < x) k *= 2; if(x == k) return true; return false; } int main(){ cin >> t; for(int i = 1; i <= t; i++){ j = 1; flag = false; cin >> n; while(j < n){ if(f(n - j)){ flag = true; cout << "yes" << endl; break; } j *= 2; } if(!flag) cout << "no" << endl; } return 0; }