結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー yuppe19 😺
提出日時 2015-04-16 14:40:53
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 319 bytes
記録
コンパイル時間 120 ms
コンパイル使用メモリ 77,432 KB
最終ジャッジ日時 2025-12-03 14:40:23
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/python
from itertools import izip, tee
def pairwise(iterable):
    "s -> (s0,s1), (s1,s2), (s2,s3), ..."
    a, b = tee(iterable)
    next(b, None)
    return izip(a, b)

N = int(raw_input())
X = map(int, raw_input().split())
srt = sorted(set(X))
difs = [y-x for x, y in pairwise(srt)] or [0]
print min(difs)
0