/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 21ms 3.035 MiB
#2 Accepted 2451ms 3.531 MiB
#3 Time Exceeded ≥3028ms ≥2.922 MiB

Code

T = int(input())
report = []

for _ in range(T):
    N, M = map(int, input().split())
    sign = True

    for i in range(2, max(N, M)+1):
        if N % i == 0 and M % i == 0:
            report.append(i)
            sign = False
            break
    if sign:
        report.append(-1)


[print(i) for i in report]

Information

Submit By
Type
Submission
Problem
P1011 LCD
Contest
Brain booster - 1
Language
Python 3 (Python 3.12.3)
Submit At
2023-12-31 15:02:13
Judged At
2024-10-03 14:05:51
Judged By
Score
50
Total Time
≥3028ms
Peak Memory
≥3.531 MiB