結果

問題 No.135 とりあえず1次元の問題
ユーザー HIROPON87069639
提出日時 2016-02-16 22:39:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 881 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 14,928 KB
最終ジャッジ日時 2025-01-03 14:06:14
合計ジャッジ時間 2,434 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
N = input()
inp = map(int, raw_input().split())
inp.sort()
minn = float("inf")
flag = 0
for i in range(0, N-1):
    tmp = inp[i+1] - inp[i]
    if tmp != 0 and tmp < minn:
        minn = tmp
        flag = 1
if flag:
    print minn
else:
    print 0
0