結果

問題 No.135 とりあえず1次元の問題
ユーザー ThetaTheta
提出日時 2022-10-28 16:25:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 226 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 41,020 KB
最終ジャッジ日時 2023-09-19 08:40:14
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 226 ms
40,764 KB
testcase_01 AC 140 ms
29,492 KB
testcase_02 AC 141 ms
29,644 KB
testcase_03 AC 142 ms
29,592 KB
testcase_04 AC 143 ms
29,608 KB
testcase_05 AC 139 ms
29,556 KB
testcase_06 AC 141 ms
29,576 KB
testcase_07 AC 141 ms
29,624 KB
testcase_08 AC 142 ms
29,468 KB
testcase_09 AC 139 ms
29,540 KB
testcase_10 AC 137 ms
29,548 KB
testcase_11 AC 140 ms
29,492 KB
testcase_12 AC 139 ms
29,492 KB
testcase_13 AC 135 ms
29,460 KB
testcase_14 AC 138 ms
29,652 KB
testcase_15 AC 135 ms
29,616 KB
testcase_16 AC 139 ms
29,572 KB
testcase_17 AC 140 ms
29,616 KB
testcase_18 AC 139 ms
29,580 KB
testcase_19 AC 140 ms
29,584 KB
testcase_20 AC 141 ms
29,640 KB
testcase_21 AC 191 ms
41,020 KB
testcase_22 AC 218 ms
40,800 KB
evil01.txt AC 205 ms
40,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from numpy import diff


def main():
    N = int(input())
    X = list(map(int, input().split()))
    X.sort()

    X_diff = diff(X)
    X_diff_positive = list(filter(lambda num: num > 0, X_diff))
    if not X_diff_positive:
        print(0)
    else:
        print(min(X_diff_positive))


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