結果

問題 No.135 とりあえず1次元の問題
ユーザー yozayoza
提出日時 2015-02-26 18:01:44
言語 Nim
(2.0.2)
結果
TLE  
実行時間 -
コード長 294 bytes
コンパイル時間 3,163 ms
コンパイル使用メモリ 68,868 KB
実行使用メモリ 16,540 KB
最終ジャッジ日時 2023-09-11 07:50:29
合計ジャッジ時間 26,772 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1 ms
4,376 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 RE -
testcase_17 AC 3 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 RE -
testcase_22 TLE -
evil01.txt TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 39) Warning: imported and not used: 'math' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, algorithm, math

var
  n = readLine(stdin).parseInt
  x_seq = split(readLine(stdin), ' ').map(parseInt)
  min_v = high(int)

x_seq = x_seq.deduplicate()
x_seq.sort(cmp[int])

for i in countup(0, n - 2):
  min_v = min(min_v, abs(x_seq[i] - x_seq[i + 1]))

echo(min_v)
0