結果

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

ソースコード

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