Codeforces -> 1475A - Odd Divisor(Div-3)
1475A - Odd Divisor : https://codeforces.com/problemset/problem/1475/A
Explanation:
1) if the number itself is odd ,then this odd number is itself a odd divisor of its. like 9 is an odd divisor of 9
2) by dividing an even number by two we can get to know when we can't divide it by 2 ,then it must be multiplied by some odd numbers. Example : 500 is an even number 500/2 = 250 e. 250/2=125 odd.
so 125 is odd. so 500 has odd divisor.
Code:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lg long long
#define fi(i,L,R) for (ll i = L ; i <= R ; i++)
#define fd(i,R,L) for (ll i = R ; i >= L ; i--)
#define s1 string
#define p_b push_back
#define st(n) sort(a,a+n)
#define rev reverse(a,a+n)
#define revs(j) reverse((j).begin(),(j).end())
#define srt(k) sort((k).begin(),(k).end())
#define suni s.erase(unique(s.begin(),s.end()),s.end())
#define vuni v.erase(unique( v.begin(),v.end()),v.end())
#define puni v1.erase(unique(v1.begin(),v1.end()),v1.end())
#define yo cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define M 1000000007
#define pie acos(-1.0)
#define pp endl
#define sz 200000
typedef pair<int, int> pi;
void Solve()
{
ll i,j,k,c=0,flag=0,c1=0,c2=0;
ll n; cin >>n;
vector<ll>v;
ll p=n;
while(n>0){
if(n%2==1&&n>1){
flag=1;
break;
}
n/=2;
}
if(flag==1 || p%2==1) yo;
else no;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int tt=1;
cin>>tt;
while(tt--)
{
Solve();
}
return 0;
}
Comments
Post a Comment