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 Python (3.4.3)
Score 0
Code Size 327 Byte
Status
Exec Time 18 ms
Memory 2940 KB

Judge Result

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 18 ms 2940 KB
sample_02 18 ms 2940 KB
sample_03 17 ms 2940 KB
testcase0 17 ms 2940 KB
testcase1 17 ms 2940 KB
testcase2 18 ms 2940 KB
testcase3 17 ms 2940 KB
testcase4 17 ms 2940 KB
testcase5 17 ms 2940 KB