Submission #3192412


Source Code Expand

Copy
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = x[0] - X
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, a - X)
print(t)

Submission Info

Submission Time
Task A - ABC333
User taku0728
Language Python3 (3.4.3)
Score 0
Code Size 327 Byte
Status

Test Cases

Set Name Score / Max Score Test Cases
All 0 / 100 sample_01, sample_02, sample_03, testcase0, testcase1, testcase2, testcase3, testcase4, testcase5
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
sample_01
sample_02
sample_03
testcase0
testcase1
testcase2
testcase3
testcase4
testcase5