結果

問題 No.716 距離
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-07-28 07:28:00
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 3,958 ms
コンパイル使用メモリ 66,316 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 03:33:32
合計ジャッジ時間 5,351 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, algorithm

let
  N = parseInt readLine stdin
  a = map(split readLine stdin, parseInt).sorted(cmp)
var
  cnt: tuple[mn, mx: int] = (int.high, a[^1] - a[0])

for i in 1 ..< N:
  cnt.mn = min(cnt.mn, a[i] - a[i - 1])

echo cnt.mn
echo cnt.mx
0