結果

問題 No.135 とりあえず1次元の問題
ユーザー alcheminalchemin
提出日時 2019-09-13 10:31:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 267 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 21,036 KB
最終ジャッジ日時 2023-09-17 06:41:35
合計ジャッジ時間 1,988 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
21,036 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 16 ms
8,064 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 16 ms
7,856 KB
testcase_05 AC 16 ms
8,016 KB
testcase_06 AC 16 ms
7,876 KB
testcase_07 AC 17 ms
7,976 KB
testcase_08 AC 17 ms
7,840 KB
testcase_09 AC 17 ms
7,820 KB
testcase_10 AC 16 ms
7,872 KB
testcase_11 AC 16 ms
7,836 KB
testcase_12 AC 16 ms
8,016 KB
testcase_13 AC 16 ms
7,900 KB
testcase_14 AC 17 ms
7,896 KB
testcase_15 AC 16 ms
7,904 KB
testcase_16 AC 17 ms
7,972 KB
testcase_17 AC 17 ms
7,876 KB
testcase_18 AC 16 ms
7,836 KB
testcase_19 AC 16 ms
7,916 KB
testcase_20 AC 16 ms
7,836 KB
testcase_21 AC 50 ms
19,040 KB
testcase_22 AC 129 ms
21,032 KB
evil01.txt AC 117 ms
21,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
points = list(set([int(i) for i in input().split()]));
points.sort();

dist = 1000010;
if len(points) == 1:
    dist = 0
else:
    for i in range(len(points) - 1):
        dist = min(dist, abs(points[i] - points[i + 1]))
    
print(dist)
0