[백준 3711][Python] 학번

봉글렛·2023년 1월 17일

백준

목록 보기
37/55

문제 링크 https://www.acmicpc.net/problem/3711

중복을 제거하기만 하면 쉬움.

풀이

for _ in range(int(input())):
    n = int(input())
    numbers = [int(input()) for i in range(n)]
    result = 0
    while True:
        result += 1
        if len({i % result for i in numbers}) == n:
            print(result)
            break
profile
어쩌다 개발자 (할 수 있을 때까지!!!!)

0개의 댓글