結果

問題 No.135 とりあえず1次元の問題
ユーザー nbisco
提出日時 2016-03-23 21:08:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 444 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 20,540 KB
最終ジャッジ日時 2025-01-03 14:28:54
合計ジャッジ時間 8,404 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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