結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー mkanenobu
提出日時 2018-03-24 23:18:59
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 3,007 ms / 5,000 ms
コード長 301 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,599 ms
コンパイル使用メモリ 68,296 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2026-04-13 15:34:47
合計ジャッジ時間 16,948 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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