結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-13 05:33:22 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 216 bytes |
| コンパイル時間 | 347 ms |
| コンパイル使用メモリ | 8,192 KB |
| 実行使用メモリ | 22,320 KB |
| 最終ジャッジ日時 | 2025-01-03 07:25:13 |
| 合計ジャッジ時間 | 3,951 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 WA * 15 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - num Syntax OK
ソースコード
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 unless arr[i] - arr[i-1] == 0 end ans.push 0 if ans.length == 0 ans = ans.sort puts ans[0]