結果

問題 No.135 とりあえず1次元の問題
ユーザー rkyrky
提出日時 2017-11-07 00:04:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 259 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 26,412 KB
最終ジャッジ日時 2023-08-15 19:42:45
合計ジャッジ時間 3,611 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
26,352 KB
testcase_01 AC 67 ms
15,116 KB
testcase_02 AC 68 ms
15,092 KB
testcase_03 AC 69 ms
15,000 KB
testcase_04 AC 68 ms
15,260 KB
testcase_05 AC 67 ms
14,996 KB
testcase_06 AC 68 ms
14,996 KB
testcase_07 AC 66 ms
15,144 KB
testcase_08 AC 68 ms
15,072 KB
testcase_09 AC 70 ms
15,304 KB
testcase_10 AC 67 ms
15,064 KB
testcase_11 AC 67 ms
15,268 KB
testcase_12 AC 66 ms
15,324 KB
testcase_13 AC 67 ms
15,064 KB
testcase_14 AC 70 ms
15,216 KB
testcase_15 AC 69 ms
15,076 KB
testcase_16 AC 68 ms
15,284 KB
testcase_17 AC 68 ms
15,068 KB
testcase_18 AC 69 ms
15,112 KB
testcase_19 AC 70 ms
14,996 KB
testcase_20 AC 71 ms
15,144 KB
testcase_21 AC 109 ms
23,588 KB
testcase_22 AC 134 ms
26,412 KB
evil01.txt AC 131 ms
26,352 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
distance = 0 if list.length == 1
puts distance
0