結果

問題 No.135 とりあえず1次元の問題
ユーザー brthyyjpbrthyyjp
提出日時 2020-12-05 15:39:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 213 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 106,956 KB
最終ジャッジ日時 2023-10-13 22:07:52
合計ジャッジ時間 3,551 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
106,956 KB
testcase_01 AC 70 ms
71,112 KB
testcase_02 AC 71 ms
71,360 KB
testcase_03 AC 71 ms
71,424 KB
testcase_04 AC 69 ms
71,264 KB
testcase_05 AC 71 ms
71,264 KB
testcase_06 AC 69 ms
71,244 KB
testcase_07 AC 70 ms
71,472 KB
testcase_08 AC 70 ms
71,240 KB
testcase_09 AC 69 ms
71,704 KB
testcase_10 AC 70 ms
71,452 KB
testcase_11 AC 69 ms
71,488 KB
testcase_12 AC 68 ms
71,308 KB
testcase_13 AC 70 ms
71,452 KB
testcase_14 AC 69 ms
71,676 KB
testcase_15 AC 70 ms
71,068 KB
testcase_16 AC 72 ms
71,572 KB
testcase_17 AC 71 ms
71,204 KB
testcase_18 AC 69 ms
71,328 KB
testcase_19 AC 71 ms
71,428 KB
testcase_20 AC 72 ms
71,440 KB
testcase_21 AC 93 ms
90,452 KB
testcase_22 AC 125 ms
106,616 KB
evil01.txt AC 114 ms
106,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
X = list(map(int, input().split()))
X = list(set(X))
if len(X) == 1:
    print(0)
    exit()
X.sort()
import math
ans = 10**18
for i in range(len(X)-1):
    ans = min(ans, X[i+1]-X[i])
print(ans)
0