結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-06 23:42:32 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 242 bytes |
| コンパイル時間 | 107 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-11-24 04:10:51 |
| 合計ジャッジ時間 | 3,504 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 20 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - test_case Syntax OK
ソースコード
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] distance = (list[i + 1] - list[i]).abs end end puts distance