結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-16 14:40:53 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 109 ms / 5,000 ms |
| コード長 | 319 bytes |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 16,428 KB |
| 最終ジャッジ日時 | 2025-01-03 05:34:25 |
| 合計ジャッジ時間 | 2,345 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#!/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)