/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 22ms 2.898 MiB
#2 Accepted 22ms 3.125 MiB
#3 Time Exceeded ≥1044ms ≥3.004 MiB
#4 Time Exceeded ≥1029ms ≥3.02 MiB

Code

n = int(input())
for i in range(n):
    a,b = map(int,input().split())
    count = 0
    while (a != 0 and b != 0):
        s1 = max(a,b)
        if s1 == a:
            a = a - b
            count = count + 1
        elif s1 == b:
            b = b - a
            count = count + 1
    print(count)

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Contest
Brain booster #2
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-06 15:34:42
Judged At
2024-11-11 03:41:37
Judged By
Score
10
Total Time
≥1044ms
Peak Memory
≥3.125 MiB