Submission #3159683


Source Code Expand

Copy
from fractions import gcd
from functools import reduce


def gcd_list(numbers):
    return reduce(gcd, numbers)


n, x = [int(_) for _ in input().split()]
x_list = [int(_) for _ in input().split()]

list = [abs(x_list[i] - x) for i in range(n)]

answer = gcd_list(list)
print(answer)

Submission Info

Submission Time
Task C - Skip
User nemunemu1112
Language Python3 (3.4.3)
Score 300
Code Size 299 Byte
Status
Exec Time 96 ms
Memory 16308 KB

Test Cases

Set Name Score / Max Score Test Cases
All 300 / 300 hand_1, large_1, large_2, large_3, large_4, large_5, large_6, large_7, large_8, max_1, max_2, max_3, min_1, min_2, sample_01, sample_02, sample_03, small_1, small_2, small_3, small_4, small_5
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_1 35 ms 5076 KB
large_1 44 ms 6724 KB
large_2 48 ms 7344 KB
large_3 45 ms 6824 KB
large_4 35 ms 5076 KB
large_5 35 ms 5076 KB
large_6 35 ms 5076 KB
large_7 35 ms 5076 KB
large_8 35 ms 5076 KB
max_1 95 ms 16308 KB
max_2 96 ms 16236 KB
max_3 96 ms 16308 KB
min_1 35 ms 5076 KB
min_2 35 ms 5076 KB
sample_01 35 ms 5076 KB
sample_02 35 ms 5076 KB
sample_03 35 ms 5076 KB
small_1 35 ms 5076 KB
small_2 35 ms 5076 KB
small_3 35 ms 5076 KB
small_4 35 ms 5076 KB
small_5 35 ms 5076 KB