結果

問題 No.716 距離
ユーザー iad_2889
提出日時 2019-04-27 14:49:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-27 22:15:15
合計ジャッジ時間 11,119 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
points = list({int(x) for x in input().split()})
if len(points) < N:
    min_distance = 0
else:
    min_distance = points[1] - points[0]

max_distance = points[1] - points[0]
for i in range(len(points) - 1):
    pi = points[i]
    for j in points[i + 1:]:
        temp = abs(j - pi)
        max_distance = max([max_distance,temp])
        min_distance = min(min_distance,temp)

print(min_distance)
print(max_distance)
0