結果

問題 No.135 とりあえず1次元の問題
ユーザー ThetaTheta
提出日時 2022-10-28 16:25:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 40,976 KB
最終ジャッジ日時 2023-09-19 08:39:49
合計ジャッジ時間 8,419 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
40,800 KB
testcase_01 AC 143 ms
29,500 KB
testcase_02 AC 141 ms
29,396 KB
testcase_03 WA -
testcase_04 AC 142 ms
29,512 KB
testcase_05 AC 141 ms
29,664 KB
testcase_06 AC 143 ms
29,620 KB
testcase_07 AC 145 ms
29,560 KB
testcase_08 AC 143 ms
29,528 KB
testcase_09 AC 143 ms
29,608 KB
testcase_10 AC 140 ms
29,608 KB
testcase_11 AC 144 ms
29,668 KB
testcase_12 AC 141 ms
29,556 KB
testcase_13 AC 140 ms
29,596 KB
testcase_14 AC 145 ms
29,472 KB
testcase_15 AC 145 ms
29,560 KB
testcase_16 AC 145 ms
29,664 KB
testcase_17 AC 145 ms
29,676 KB
testcase_18 AC 143 ms
29,588 KB
testcase_19 AC 145 ms
29,600 KB
testcase_20 AC 143 ms
29,668 KB
testcase_21 AC 195 ms
40,976 KB
testcase_22 AC 219 ms
40,832 KB
evil01.txt AC 204 ms
40,820 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(-1)
    else:
        print(min(X_diff_positive))


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