結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 91 ms
12,288 KB
testcase_02 AC 96 ms
12,160 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 92 ms
12,032 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 95 ms
12,160 KB
testcase_20 WA -
testcase_21 AC 150 ms
19,200 KB
testcase_22 AC 144 ms
19,072 KB
evil01.txt AC 146 ms
19,328 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)
distance = 1000000

for i in 0...list.length - 1 do
	if distance > list[i + 1] - list[i] && list[i + 1] - list[i] > 0 && list[i + 1] != list[i]
		distance = list[i + 1] - list[i] 
	end
end
puts distance
0