提交时间:2024-08-19 22:06:15
运行 ID: 168057
#include <bits/stdc++.h> using namespace std; int a[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; int sum[200]; int main(){ int n; cin >> n; int k = 1; for(int i = 0; i <= 9; i++){ for(int j = 0; j <= 9; j++){ sum[k] = a[i] + a[j]; k++; } } for(int i = 1; i <= n; i++){ int t, b = 0; cin >> t; for(int i = 1; i <= sizeof(sum); i++){ if(t == sum[i]){ cout << "yes" << endl; b = 1; break; } } if(b == 0) cout << "no" << endl; } return 0; }