add: boj/16953.py
This commit is contained in:
16
boj/16953.py
Normal file
16
boj/16953.py
Normal file
@@ -0,0 +1,16 @@
|
||||
a,b=map(int,input().split())
|
||||
count=0
|
||||
|
||||
while a<b:
|
||||
if b%2==0:
|
||||
b//=2
|
||||
elif b%10==1:
|
||||
b//=10
|
||||
else:
|
||||
break
|
||||
count+=1
|
||||
|
||||
if a==b:
|
||||
print(count+1)
|
||||
else:
|
||||
print(-1)
|
||||
Reference in New Issue
Block a user