結果

問題 No.135 とりあえず1次元の問題
ユーザー R N
提出日時 2020-09-11 16:58:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 157 ms / 5,000 ms
コード長 399 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,192 KB
最終ジャッジ日時 2024-12-26 04:54:44
合計ジャッジ時間 2,115 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=UTF-8
# import statistics

n = int(input())
l = list(map(int, input().split()))
s_l = set(l)
num_l = list(s_l)
num_list = sorted(num_l)
pointA = list(num_list[:len(s_l)])
pointB = list(num_list[1:])
mile_list = list()
for i, j in zip(pointA, pointB):
    mile_list.append(abs(i-j))
ans_list = sorted(mile_list, reverse=False)
if len(ans_list) == 0:
    print(0)
else:
    print(ans_list[0])
0