QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623013#5721. Dividing by TwoDaAsianCarsten#RE 0ms0kbPython3195b2024-10-09 09:34:312024-10-09 09:34:32

Judging History

你现在查看的是最新测评结果

  • [2024-10-09 09:34:32]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-09 09:34:31]
  • 提交

answer

a = int(input())
b = int(input())

count = 0

while a > b:
    if a%2==0:
        a = a/2
        count += 1
    else:
        a += 1
        count += 1

count += b-a

print(count)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

103 27

output:


result: