[Python][백준 25418] a를 k로 만들기

서윤·2023년 6월 2일

백준

목록 보기
2/23
post-thumbnail

https://www.acmicpc.net/problem/25418

나의 풀이

a,k=map(int,input().split())
count = 0

while True:
    if a == k:
        print(count)
        break
    if k % 2 == 0 and k >= a*2:
        k = int(k/2)
    else:
        k = k - 1
    count+=1
profile
UXUI Designer

0개의 댓글