Wrong Answer
Code
import math
for _ in range(int(input())):
x, y = map(int, input().split())
a = min(x,y)
if x == 1 or y == 1:
print("-1")
flag = 0
for i in range(2, int(math.sqrt(a) + 1)):
if x % i == 0 and y % i == 0:
flag = 1
break
if flag:
print(i)
else:
if max(x,y)%a == 0 and a != 1:
print(a)
Information
- Submit By
- Type
- Submission
- Problem
- P1011 LCD
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-01-06 20:01:36
- Judged At
- 2024-11-11 03:43:46
- Judged By
- Score
- 50
- Total Time
- 1166ms
- Peak Memory
- 3.168 MiB