結果

問題 No.135 とりあえず1次元の問題
ユーザー ryusukeryusuke
提出日時 2022-01-28 20:40:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 90,980 KB
最終ジャッジ日時 2023-08-28 18:08:37
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
90,856 KB
testcase_01 AC 69 ms
71,452 KB
testcase_02 AC 68 ms
71,460 KB
testcase_03 WA -
testcase_04 AC 67 ms
71,292 KB
testcase_05 AC 68 ms
71,488 KB
testcase_06 AC 66 ms
71,300 KB
testcase_07 AC 66 ms
71,240 KB
testcase_08 AC 67 ms
71,464 KB
testcase_09 AC 67 ms
71,500 KB
testcase_10 AC 66 ms
71,120 KB
testcase_11 AC 67 ms
71,492 KB
testcase_12 AC 66 ms
71,448 KB
testcase_13 AC 67 ms
71,408 KB
testcase_14 AC 67 ms
71,300 KB
testcase_15 AC 68 ms
71,292 KB
testcase_16 AC 68 ms
71,244 KB
testcase_17 AC 68 ms
71,460 KB
testcase_18 AC 68 ms
71,088 KB
testcase_19 AC 69 ms
71,328 KB
testcase_20 AC 67 ms
71,108 KB
testcase_21 AC 89 ms
90,772 KB
testcase_22 AC 108 ms
90,980 KB
evil01.txt AC 98 ms
91,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int, input().split()))

if n == 1:
    print(0)
else:
    ans = 10 ** 18
    x.sort()
    for i in range(n - 1):
        if x[i] == x[i + 1]: continue
        ans = min(ans, abs(x[i + 1] - x[i]))
    print(ans)
0