結果

問題 No.135 とりあえず1次元の問題
ユーザー trineutron
提出日時 2020-04-10 20:34:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 169 ms / 5,000 ms
コード長 234 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 20,840 KB
最終ジャッジ日時 2024-09-15 12:53:02
合計ジャッジ時間 2,329 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1000000000
for i in range(n - 1):
    if a[i + 1] - a[i] == 0:
        continue
    ans = min(ans, a[i + 1] - a[i])
if ans == 1000000000:
    ans = 0
print(ans)
0