結果

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

ソースコード

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.sort(cmp[int])
x_seq = x_seq.deduplicate()

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

echo(min_v)
0