結果

問題 No.135 とりあえず1次元の問題
ユーザー 👑 colognecologne
提出日時 2022-08-29 18:26:38
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 234 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 100,404 KB
最終ジャッジ日時 2023-08-06 12:31:30
合計ジャッジ時間 3,470 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
100,404 KB
testcase_01 AC 72 ms
71,148 KB
testcase_02 AC 73 ms
70,980 KB
testcase_03 AC 71 ms
71,104 KB
testcase_04 AC 72 ms
71,392 KB
testcase_05 AC 71 ms
70,848 KB
testcase_06 AC 70 ms
71,060 KB
testcase_07 AC 72 ms
71,168 KB
testcase_08 AC 71 ms
71,320 KB
testcase_09 AC 72 ms
71,380 KB
testcase_10 AC 70 ms
71,264 KB
testcase_11 AC 72 ms
70,988 KB
testcase_12 AC 73 ms
71,172 KB
testcase_13 AC 72 ms
71,248 KB
testcase_14 AC 71 ms
71,164 KB
testcase_15 AC 71 ms
71,144 KB
testcase_16 AC 71 ms
71,244 KB
testcase_17 AC 70 ms
71,336 KB
testcase_18 AC 70 ms
71,032 KB
testcase_19 AC 72 ms
70,960 KB
testcase_20 AC 72 ms
71,240 KB
testcase_21 AC 88 ms
83,680 KB
testcase_22 AC 118 ms
100,248 KB
evil01.txt AC 109 ms
100,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    input()  # N
    A = sorted(set(map(int, input().split())))
    x = float('inf') if len(A) != 1 else 0
    for i in range(len(A)-1):
        x = min(x, A[i+1]-A[i])
    print(x)


if __name__ == '__main__':
    main()
0