/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 13ms 2.871 MiB
#2 Accepted 1007ms 5.164 MiB
#3 Time Exceeded ≥3099ms ≥4.52 MiB

Code

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

for _ in range(T):
    N, M = map(int, input().split())
    query.append([N, M])

for N, M in query:
    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:08:05
Judged At
2024-10-03 14:07:13
Judged By
Score
50
Total Time
≥3099ms
Peak Memory
≥5.164 MiB