結果

問題 No.135 とりあえず1次元の問題
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-16 14:40:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 1,104 ms
コンパイル使用メモリ 6,708 KB
実行使用メモリ 15,972 KB
最終ジャッジ日時 2023-09-01 03:17:40
合計ジャッジ時間 2,322 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
15,972 KB
testcase_01 AC 11 ms
6,012 KB
testcase_02 AC 11 ms
5,968 KB
testcase_03 AC 12 ms
5,936 KB
testcase_04 AC 12 ms
6,184 KB
testcase_05 AC 11 ms
6,132 KB
testcase_06 AC 11 ms
6,036 KB
testcase_07 AC 15 ms
6,200 KB
testcase_08 AC 12 ms
5,932 KB
testcase_09 AC 12 ms
5,972 KB
testcase_10 AC 12 ms
5,972 KB
testcase_11 AC 12 ms
6,192 KB
testcase_12 AC 13 ms
5,964 KB
testcase_13 AC 13 ms
5,936 KB
testcase_14 AC 12 ms
6,056 KB
testcase_15 AC 14 ms
6,068 KB
testcase_16 AC 12 ms
6,112 KB
testcase_17 AC 12 ms
6,164 KB
testcase_18 AC 13 ms
6,040 KB
testcase_19 AC 13 ms
6,020 KB
testcase_20 AC 12 ms
6,128 KB
testcase_21 AC 63 ms
14,500 KB
testcase_22 AC 124 ms
15,904 KB
evil01.txt AC 99 ms
16,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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