fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define int long long
  5. #define yes cout << "YES\n";
  6. #define no cout << "NO\n";
  7.  
  8.  
  9. void FastIO() {
  10. ios_base::sync_with_stdio(false);
  11. cin.tie(nullptr);
  12. cout.tie(nullptr);
  13. }
  14.  
  15. void solve(){
  16. int n;
  17. cin >> n;
  18.  
  19. if(n%2 == 1){
  20. yes
  21. return;
  22. }
  23. int ans = n/2;
  24.  
  25. while(ans > 1){
  26. if(ans%2 == 1){
  27. yes
  28. return;
  29. }
  30. ans /= 2;
  31. }
  32. no;
  33. }
  34.  
  35.  
  36.  
  37. signed main(){
  38. FastIO();
  39.  
  40. int t = 1;
  41. cin >> t;
  42.  
  43. while (t--){
  44. solve();
  45. }
  46. return 0;
  47. }
Success #stdin #stdout 0.01s 5320KB
stdin
6
2
3
4
5
998244353
1099511627776
stdout
NO
YES
NO
YES
YES
NO