Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 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.         st.insert(s+1);
  24.         s*= 2;
  25.     }
  26.    
  27.     if(st.find(n) != st.end())
  28.         cout << "Yes\n";
  29.     else
  30.         cout << "No\n";
  31. }
  32.  
  33. int main(){
  34.     ios_base::sync_with_stdio(0);
  35.     cin.tie(0);
  36.     cout.tie(0);
  37.  
  38.     int tests = 1;
  39.  
  40. #ifdef LOCAL
  41.     bool a;
  42.     a = freopen("in.data", "r", stdin);
  43.     a = freopen("out.data", "w", stdout);
  44.     cin >> tests;
  45. #endif
  46.  
  47.     while(tests--)
  48.         solve();
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement