結果

問題 No.135 とりあえず1次元の問題
ユーザー szkake
提出日時 2015-08-23 23:19:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 99 ms / 5,000 ms
コード長 272 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 25,132 KB
最終ジャッジ日時 2025-01-03 07:32:11
合計ジャッジ時間 2,147 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding:utf-8 -*-
calc_difference = lambda xi, xj: xj - xi
if __name__ == '__main__':
    n = int(input())
    xn = tuple(sorted(set(map(int, input().split()))))
    if len(xn) < 2:
        print(0)
    else:
        print(min(map(calc_difference, xn[:-1], xn[1:])))
0