結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー yoza
提出日時 2015-02-26 18:01:44
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,475 ms
コンパイル使用メモリ 70,192 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2026-03-18 03:20:52
合計ジャッジ時間 12,370 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 RE * 1
other AC * 10 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import strutils, sequtils, algorithm, math

var
  n = readLine(stdin).parseInt
  x_seq = split(readLine(stdin), ' ').map(parseInt)
  min_v = high(int)

x_seq = x_seq.deduplicate()
x_seq.sort(cmp[int])

for i in countup(0, n - 2):
  min_v = min(min_v, abs(x_seq[i] - x_seq[i + 1]))

echo(min_v)
0