結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-06 23:40:00 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 266 bytes |
| 記録 | |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 21,872 KB |
| 最終ジャッジ日時 | 2026-05-18 01:28:35 |
| 合計ジャッジ時間 | 5,055 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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