結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-06 23:40:00 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 266 bytes |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-11-24 04:10:45 |
| 合計ジャッジ時間 | 4,070 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 17 |
コンパイルメッセージ
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] > 0 && list[i + 1] != list[i] distance = list[i + 1] - list[i] end end puts distance