結果

問題 No.135 とりあえず1次元の問題
ユーザー komkomhkomkomh
提出日時 2019-05-30 20:43:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 300 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,744 KB
実行使用メモリ 21,524 KB
最終ジャッジ日時 2023-10-17 18:54:58
合計ジャッジ時間 2,136 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
21,524 KB
testcase_01 AC 29 ms
10,016 KB
testcase_02 AC 29 ms
10,016 KB
testcase_03 AC 30 ms
10,016 KB
testcase_04 AC 30 ms
10,020 KB
testcase_05 AC 29 ms
10,020 KB
testcase_06 AC 29 ms
10,020 KB
testcase_07 AC 29 ms
10,020 KB
testcase_08 AC 33 ms
10,020 KB
testcase_09 AC 28 ms
10,020 KB
testcase_10 AC 29 ms
10,020 KB
testcase_11 AC 28 ms
10,020 KB
testcase_12 AC 30 ms
10,044 KB
testcase_13 AC 28 ms
10,020 KB
testcase_14 AC 30 ms
10,108 KB
testcase_15 AC 30 ms
10,044 KB
testcase_16 AC 29 ms
10,116 KB
testcase_17 AC 30 ms
10,108 KB
testcase_18 AC 30 ms
10,028 KB
testcase_19 AC 30 ms
10,092 KB
testcase_20 AC 29 ms
10,072 KB
testcase_21 AC 87 ms
20,808 KB
testcase_22 AC 132 ms
21,524 KB
evil01.txt AC 107 ms
21,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N: int = int(input())
X = list(map(int, input().split()))

X.sort()

min_distance = 0
for i in range(1, len(X)):
    distance = abs(X[i] - X[i - 1])
    if distance == 0:
        continue

    if min_distance == 0 or distance < min_distance:
        min_distance = distance

print(str(min_distance))
0