結果

問題 No.135 とりあえず1次元の問題
ユーザー SuburiSuburi
提出日時 2020-10-18 23:18:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 261 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 19,756 KB
最終ジャッジ日時 2023-09-28 12:09:16
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
19,660 KB
testcase_01 AC 16 ms
7,988 KB
testcase_02 AC 17 ms
8,000 KB
testcase_03 AC 16 ms
7,892 KB
testcase_04 AC 17 ms
7,808 KB
testcase_05 AC 16 ms
7,892 KB
testcase_06 AC 16 ms
7,784 KB
testcase_07 AC 16 ms
7,988 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 17 ms
7,816 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 16 ms
7,868 KB
testcase_12 AC 17 ms
7,856 KB
testcase_13 AC 17 ms
7,808 KB
testcase_14 AC 17 ms
8,356 KB
testcase_15 AC 17 ms
7,776 KB
testcase_16 AC 17 ms
8,240 KB
testcase_17 AC 16 ms
8,200 KB
testcase_18 AC 16 ms
7,852 KB
testcase_19 AC 17 ms
8,248 KB
testcase_20 AC 17 ms
7,816 KB
testcase_21 AC 65 ms
18,892 KB
testcase_22 AC 109 ms
19,756 KB
evil01.txt AC 76 ms
19,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = sorted(list(map(int,input().split(" "))))

a = list(set(sorted([abs(X[i] - X[i + 1]) for i in range(N) if i + 1 < N])))



if 0 in a: 
    a.remove(0)
    if a == []:
        print(0)
    else:
        print(min(a))
else:
    print(min(a))
0