提交时间:2024-08-19 22:02:23

运行 ID: 168047

#include <bits/stdc++.h> using namespace std; bool check(int N) { return (N > 0) && ((N & (N - 1)) == 0); } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; if (check(n)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }