Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define pb push_back
- #define f first
- #define s second
- #define mp make_pair
- #define ll long long
- #define MAXN 200005
- #define INF 1000000009
- #define MOD 1000000007
- void solve(){
- ll n;
- cin >> n;
- set <ll> st;
- ll s = 2;
- while(s < 1000000000000000000){
- st.insert(s);
- st.insert(s+1);
- s*= 2;
- }
- if(st.find(n) != st.end())
- cout << "Yes\n";
- else
- cout << "No\n";
- }
- int main(){
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- int tests = 1;
- #ifdef LOCAL
- bool a;
- a = freopen("in.data", "r", stdin);
- a = freopen("out.data", "w", stdout);
- cin >> tests;
- #endif
- while(tests--)
- solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement