/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 2.914 MiB
#2 Accepted 1124ms 3.164 MiB
#3 Time Exceeded ≥3091ms ≥3.023 MiB

Code

for _ in range(int(input())):
    x, y = map(int, input().split())

    if x == 1 or y == 1 or x == 0 or y == 0:
        print("-1")
    else:
        
        lcd = min(x, y)

        
        for i in range(2, lcd + 1):
            if x % i == 0 and y % i == 0:
                lcd = i
                break

        print(lcd)

Information

Submit By
Type
Submission
Problem
P1011 LCD
Contest
Brain booster - 1
Language
Python 3 (Python 3.12.3)
Submit At
2023-12-31 17:06:38
Judged At
2024-11-11 03:44:50
Judged By
Score
50
Total Time
≥3091ms
Peak Memory
≥3.164 MiB