結果

問題 No.135 とりあえず1次元の問題
ユーザー akitsugu777akitsugu777
提出日時 2020-12-24 10:22:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 208 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 11,832 KB
実行使用メモリ 26,320 KB
最終ジャッジ日時 2023-10-21 15:36:35
合計ジャッジ時間 2,135 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
26,320 KB
testcase_01 AC 29 ms
10,124 KB
testcase_02 AC 29 ms
10,124 KB
testcase_03 AC 28 ms
10,124 KB
testcase_04 AC 29 ms
10,128 KB
testcase_05 AC 29 ms
10,128 KB
testcase_06 AC 29 ms
10,128 KB
testcase_07 AC 29 ms
10,128 KB
testcase_08 AC 28 ms
10,128 KB
testcase_09 AC 28 ms
10,128 KB
testcase_10 AC 29 ms
10,128 KB
testcase_11 AC 29 ms
10,128 KB
testcase_12 AC 29 ms
10,188 KB
testcase_13 AC 29 ms
10,132 KB
testcase_14 AC 30 ms
10,252 KB
testcase_15 AC 30 ms
10,188 KB
testcase_16 AC 29 ms
10,256 KB
testcase_17 AC 30 ms
10,252 KB
testcase_18 AC 29 ms
10,136 KB
testcase_19 AC 30 ms
10,236 KB
testcase_20 AC 29 ms
10,216 KB
testcase_21 AC 58 ms
17,748 KB
testcase_22 AC 140 ms
26,316 KB
evil01.txt AC 124 ms
26,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = sorted(set(map(int, input().split())))
x = len(X)

Ans = 0
if x != 1:
    Z = float('inf')
    for i in range(x-1):
        Y = X[i+1] - X[i]
        Z = min(Y, Z)
    Ans = Z

print(Ans)
0