結果

問題 No.135 とりあえず1次元の問題
ユーザー zazaboonzazaboon
提出日時 2016-05-02 15:45:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 230 ms / 5,000 ms
コード長 256 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,288 KB
実行使用メモリ 25,816 KB
最終ジャッジ日時 2023-09-02 00:23:56
合計ジャッジ時間 3,800 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 230 ms
25,668 KB
testcase_01 AC 84 ms
15,040 KB
testcase_02 AC 82 ms
15,140 KB
testcase_03 AC 82 ms
15,196 KB
testcase_04 AC 82 ms
15,152 KB
testcase_05 AC 83 ms
15,144 KB
testcase_06 AC 82 ms
15,040 KB
testcase_07 AC 81 ms
15,088 KB
testcase_08 AC 82 ms
15,360 KB
testcase_09 AC 82 ms
15,292 KB
testcase_10 AC 83 ms
15,276 KB
testcase_11 AC 82 ms
15,088 KB
testcase_12 AC 81 ms
15,296 KB
testcase_13 AC 82 ms
15,128 KB
testcase_14 AC 82 ms
15,184 KB
testcase_15 AC 82 ms
15,284 KB
testcase_16 AC 82 ms
15,196 KB
testcase_17 AC 81 ms
15,128 KB
testcase_18 AC 82 ms
15,352 KB
testcase_19 AC 82 ms
15,052 KB
testcase_20 AC 83 ms
15,360 KB
testcase_21 AC 128 ms
22,920 KB
testcase_22 AC 222 ms
25,816 KB
evil01.txt AC 201 ms
25,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
retsu = [n]
sa = [n]
retsu = gets.split(" ").map(&:to_s)
retsu=retsu.uniq
retsu.sort!
len = retsu.length
sa[len-1] = (retsu[len-1].to_i-retsu[0].to_i).abs
for i in 0..(len-2)
  sa[i] = (retsu[i+1].to_i-retsu[i].to_i).abs
end
sa.sort!
puts sa[0]
0