結果

問題 No.135 とりあえず1次元の問題
ユーザー nanaenanae
提出日時 2017-03-17 02:01:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 204 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 21,000 KB
最終ジャッジ日時 2023-09-17 05:27:24
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
21,000 KB
testcase_01 AC 15 ms
7,768 KB
testcase_02 RE -
testcase_03 AC 15 ms
8,068 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 16 ms
7,796 KB
testcase_13 AC 16 ms
7,776 KB
testcase_14 AC 16 ms
7,884 KB
testcase_15 AC 16 ms
7,892 KB
testcase_16 RE -
testcase_17 AC 16 ms
7,736 KB
testcase_18 AC 16 ms
7,760 KB
testcase_19 AC 16 ms
7,808 KB
testcase_20 AC 16 ms
7,940 KB
testcase_21 RE -
testcase_22 RE -
evil01.txt AC 108 ms
20,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = sorted(set([int(i) for i in input().split()]))

if len(X) == 1:
    print(0)
    exit()

inf = 10**9
ans = inf

for i in range(N - 1):
    ans = min(ans, X[i + 1] - X[i])

print(ans)
0