/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 16ms 2.926 MiB
#2 Accepted 15ms 3.117 MiB
#3 Accepted 478ms 3.141 MiB
#4 Accepted 477ms 3.137 MiB
#5 Accepted 28ms 3.133 MiB
#6 Time Exceeded ≥1089ms ≥2.961 MiB
#7 Time Exceeded ≥1092ms ≥3.066 MiB

Code

def min_operations_to_zero(A, B):
    count = 0
    while A > 0 and B > 0:
        if A > B:
            A -= B
        else:
            B -= A
        count += 1
    return count

def main():
    T = int(input())
    for _ in range(T):
        A, B = map(int, input().split())
        result = min_operations_to_zero(A, B)
        print(result)

if __name__ == "__main__":
    main()

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 16:41:04
Judged At
2024-11-11 03:41:12
Judged By
Score
40
Total Time
≥1092ms
Peak Memory
≥3.141 MiB