結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-07 00:04:12 |
| 言語 | Ruby (4.0.7 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 101 ms / 5,000 ms |
| + 101µs | |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 8 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 26,572 KB |
| 最終ジャッジ日時 | 2026-10-11 11:22:35 |
| 合計ジャッジ時間 | 2,939 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
コンパイルメッセージ
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).uniq.sort! distance = 1000000 for i in 0...list.length - 1 do distance = (list[i + 1] - list[i]).abs if distance > (list[i + 1] - list[i]).abs end distance = 0 if list.length == 1 puts distance