/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 14ms 2.984 MiB
#2 Accepted 1044ms 3.258 MiB
#3 Time Exceeded ≥3092ms ≥3.129 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-10-03 14:04:20
Judged By
Score
50
Total Time
≥3092ms
Peak Memory
≥3.258 MiB