結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー toshiro_yanagi
提出日時 2018-06-03 15:52:55
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 3,008 ms / 5,000 ms
コード長 233 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,688 ms
コンパイル使用メモリ 70,136 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2026-03-20 05:49:32
合計ジャッジ時間 15,388 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import strutils, sequtils, algorithm

var
  N, X = stdin.readLine.split.map parseInt
  best = int.high

X = X.deduplicate.sorted(cmp)

for i in 0 ..< X.high:
  best = min(best, X[i + 1] - X[i])

[best, 0][int(best == int.high)].echo
0