samedi 25 juillet 2020

How to store 1e100 number in java (like python example)?

I need to output: yes if N is a direct power of 2 and no otherwise, where 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