結果

問題 No.135 とりあえず1次元の問題
ユーザー kou_kkk
提出日時 2024-02-26 12:37:14
言語 Nim
(2.2.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 307 bytes
コンパイル時間 3,546 ms
コンパイル使用メモリ 65,960 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-09-29 11:37:44
合計ジャッジ時間 5,198 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import algorithm, sequtils, strutils

let
  n = readLine stdin
  xs = stdin.readLine
            .split
            .map(parseInt)
            .sorted
            .deduplicate(true)

if xs.len < 2:
  echo 0
  quit()

var
  d = xs[1].pred xs[0]

for i in 1..xs.high:
  d = d.min xs[i].pred xs[i.pred]

echo d
0