結果

問題 No.135 とりあえず1次元の問題
ユーザー mkanenobumkanenobu
提出日時 2018-03-24 23:18:59
言語 Nim
(2.0.2)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 301 bytes
コンパイル時間 5,394 ms
コンパイル使用メモリ 65,860 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2023-11-29 09:52:43
合計ジャッジ時間 27,832 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 1 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 20 ms
8,960 KB
testcase_22 TLE -
evil01.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils, algorithm

var
    n = readLine(stdin).parseInt
    x:seq[int] = readLine(stdin).split.map(parseInt)
    res:seq[int] = @[]

x = sorted(deduplicate(x), cmp[int])

if x.len < 2:
    echo 0
else:
    for i in 1..<x.len:
        res.add(abs(x[i] - x[i - 1]))
    echo min(res)
0