結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-07 00:04:12 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 105 ms / 5,000 ms |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 26,568 KB |
| 最終ジャッジ日時 | 2026-05-18 01:29:28 |
| 合計ジャッジ時間 | 3,301 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
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