結果

問題 No.135 とりあえず1次元の問題
ユーザー nbisconbisco
提出日時 2016-03-23 21:11:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 171 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 21,124 KB
最終ジャッジ日時 2023-09-02 00:20:42
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
21,048 KB
testcase_01 AC 15 ms
7,956 KB
testcase_02 AC 16 ms
7,852 KB
testcase_03 AC 16 ms
7,844 KB
testcase_04 AC 16 ms
7,860 KB
testcase_05 AC 16 ms
7,896 KB
testcase_06 AC 16 ms
7,852 KB
testcase_07 AC 15 ms
7,880 KB
testcase_08 AC 16 ms
7,920 KB
testcase_09 AC 16 ms
7,988 KB
testcase_10 AC 15 ms
7,768 KB
testcase_11 AC 16 ms
8,000 KB
testcase_12 AC 16 ms
7,944 KB
testcase_13 AC 16 ms
7,984 KB
testcase_14 AC 16 ms
8,272 KB
testcase_15 AC 16 ms
7,812 KB
testcase_16 AC 17 ms
8,268 KB
testcase_17 AC 17 ms
8,276 KB
testcase_18 AC 16 ms
7,960 KB
testcase_19 AC 17 ms
8,388 KB
testcase_20 AC 16 ms
7,796 KB
testcase_21 AC 49 ms
18,952 KB
testcase_22 AC 160 ms
21,124 KB
evil01.txt AC 194 ms
20,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#fileencoding: utf-8

N = int(input())
X = sorted(list(set([int(i) for i in input().strip().split(" ")])))
N = len(X)

dmin = 10e10
nocount = 0
for i in range(N-1):
    for j in range(i+1,N):
        if X[i] == X[j]:
            nocount += 1
            continue
        tmp = abs(X[i]-X[j])
        if tmp > dmin:
            break
        else:
            dmin = abs(X[i]-X[j])

if nocount == N*(N-1)//2:
    print(0)
else:
    print(dmin)
0