QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623026#5721. Dividing by TwoTheZachManWA 14ms10644kbPython3218b2024-10-09 09:40:112024-10-09 09:40:17

Judging History

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

  • [2024-10-09 09:40:17]
  • 评测
  • 测评结果:WA
  • 用时:14ms
  • 内存:10644kb
  • [2024-10-09 09:40:11]
  • 提交

answer

x, y = map(int,input().split())

def f(a, b):
    if a < b:
        return b - a
    else:
        if a%2 == 0:
            return 1 + f(a//2, b)
        else:
            return 1 + f(a+1, b)

print(f(x,y))

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 11ms
memory: 10620kb

input:

103 27

output:

4

result:

ok single line: '4'

Test #2:

score: 0
Accepted
time: 14ms
memory: 10644kb

input:

3 8

output:

5

result:

ok single line: '5'

Test #3:

score: -100
Wrong Answer
time: 12ms
memory: 10632kb

input:

1010 1010

output:

506

result:

wrong answer 1st lines differ - expected: '0', found: '506'