QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623015#5721. Dividing by TwoyaffenatorWA 17ms10576kbPython3513b2024-10-09 09:35:322024-10-09 09:35:33

Judging History

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

  • [2024-10-09 09:35:33]
  • 评测
  • 测评结果:WA
  • 用时:17ms
  • 内存:10576kb
  • [2024-10-09 09:35:32]
  • 提交

answer

import sys
input = sys.stdin.readline

# For taking space seperated integer variable inputs.
def insep():
    return(map(int,input().split()))

def main():
    a = 3
    b = 8

    operations = 0

    while (a != b):
        if a < b:
            a += 1
            operations += 1
        else:
            if a % 2 == 0:
                a = a / 2
                operations += 1
            else:
                a += 1
                operations += 1

    print(operations)


main()

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 17ms
memory: 10576kb

input:

103 27

output:

5

result:

wrong answer 1st lines differ - expected: '4', found: '5'