結果

問題 No.135 とりあえず1次元の問題
ユーザー MaxMellonMaxMellon
提出日時 2015-08-13 05:14:11
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 154 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 8,064 KB
実行使用メモリ 21,120 KB
最終ジャッジ日時 2025-01-03 07:22:23
合計ジャッジ時間 3,485 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.reverse!
puts ans[0]
0