一行一个正整数,
。
仅一行如果存在输出 Yes,否则输出 No。
注:如果你把握不住浮点数误差分析,可以使用函数,实现如下:
C/C++:
long long g(long long n)
{//It needs n>=3.
n--;
int res=0;
while(n!=1)res++,n/=2;
return 1ll<<res;
}
Python:
def g(n:int):
#It needs n>=3.
n-=1
res=0
while n!=1:res+=1;n>>=1
return 1<<res
Java:
public static long g(long n)
{
// It needs n>=3.
n--;
int res=0;
while(n!=1){res++;n=n>>1;}
return 1L<<res;
}