結果

問題 No.135 とりあえず1次元の問題
ユーザー MaxMellon
提出日時 2015-08-13 05:26:56
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 156 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 7,936 KB
実行使用メモリ 22,400 KB
最終ジャッジ日時 2025-01-03 07:23:25
合計ジャッジ時間 4,275 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 6 WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - num
Syntax OK

ソースコード

diff #

num = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i)
ans = []
for i in 1...arr.length
  ans.push (arr[i] - arr[i-1]).abs
end
ans = ans.sort
puts ans[0]
0