結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー kou_kkk
提出日時 2024-02-26 12:37:14
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 307 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,712 ms
コンパイル使用メモリ 69,656 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2026-04-15 20:49:56
合計ジャッジ時間 4,381 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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