Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
while(n != 1){
if(n % 2 == 0){
n /= 2;
}
else{
cout<<"YES"<<endl;
break;
}
}
if(n == 1){
cout<<"NO"<<endl;
}
}
}
Copy The Code &
Try With Live Editor
Input
6
2
3
4
5
998244353
1099511627776
2
3
4
5
998244353
1099511627776
Output
NO
YES
NO
YES
YES
NO
YES
NO
YES
YES
NO
Demonstration
Codeforcess Solution 1475-A A. Odd Divisor ,C++, Java, Js and Python,1475-A,Codeforcess Solution