結果

問題 No.135 とりあえず1次元の問題
ユーザー rkyrky
提出日時 2017-11-07 00:01:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 24,192 KB
最終ジャッジ日時 2024-05-03 06:27:25
合計ジャッジ時間 3,546 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
24,192 KB
testcase_01 AC 88 ms
12,032 KB
testcase_02 AC 86 ms
12,160 KB
testcase_03 WA -
testcase_04 AC 87 ms
12,288 KB
testcase_05 AC 88 ms
12,160 KB
testcase_06 AC 92 ms
12,032 KB
testcase_07 AC 89 ms
12,160 KB
testcase_08 AC 89 ms
12,288 KB
testcase_09 AC 88 ms
12,288 KB
testcase_10 AC 91 ms
12,288 KB
testcase_11 AC 85 ms
12,160 KB
testcase_12 AC 85 ms
12,160 KB
testcase_13 AC 86 ms
12,032 KB
testcase_14 AC 88 ms
12,160 KB
testcase_15 AC 89 ms
12,160 KB
testcase_16 AC 104 ms
12,032 KB
testcase_17 AC 94 ms
12,032 KB
testcase_18 AC 94 ms
12,160 KB
testcase_19 AC 92 ms
12,160 KB
testcase_20 AC 95 ms
12,032 KB
testcase_21 AC 137 ms
20,352 KB
testcase_22 AC 169 ms
24,064 KB
evil01.txt AC 160 ms
24,192 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - test_case
Syntax OK

ソースコード

diff #

test_case = gets.chomp.to_i
list = gets.chomp.split.map(&:to_i).uniq.sort!
distance = 1000000

for i in 0...list.length - 1 do
	distance = (list[i + 1] - list[i]).abs if distance > (list[i + 1] - list[i]).abs
end
puts distance
0