Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define pb push_back
  5. #define f first
  6. #define s second
  7. #define mp make_pair
  8. #define ll long long
  9.  
  10. #define MAXN 200005
  11. #define INF 1000000009
  12. #define MOD 1000000007
  13.  
  14.  
  15. void solve(){
  16.     ll n;
  17.     cin >> n;
  18.  
  19.     set <ll> st;
  20.     ll s = 2;
  21.     while(s  < 1000000000000000000){
  22.         st.insert(s);
  23.         s*= 2;
  24.     }
  25.    
  26.     if(st.find(n) != st.end())
  27.         cout << "Yes\n";
  28.     else
  29.         cout << "No\n";
  30. }
  31.  
  32. int main(){
  33.     ios_base::sync_with_stdio(0);
  34.     cin.tie(0);
  35.     cout.tie(0);
  36.  
  37.     int tests = 1;
  38.  
  39. #ifdef LOCAL
  40.     bool a;
  41.     a = freopen("in.data", "r", stdin);
  42.     a = freopen("out.data", "w", stdout);
  43.     cin >> tests;
  44. #endif
  45.  
  46.     while(tests--)
  47.         solve();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement