I need to output: yes if N is a direct power of 2 and no otherwise, where 1 <= N <= 1e100
yes
N
2
no
1 <= N <= 1e100
Same in Python code:
n=int(input()) if(n!=0 and (n&(n-1)==0)): print("yes") else: print("no")
Aucun commentaire:
Enregistrer un commentaire