Submission #3159055


Source Code Expand

Copy
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.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 0
Code Size 290 Byte
Status

Test Cases

Set Name Score / Max Score Test Cases
All 0 / 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
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