結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
|
提出日時 | 2018-03-09 18:04:37 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 24,996 KB |
最終ジャッジ日時 | 2024-10-09 09:02:42 |
合計ジャッジ時間 | 4,537 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 22 |
コンパイルメッセージ
Syntax OK
ソースコード
gets p points = gets.split.map(&:to_i).uniq.sort if points.length < 2 puts 0 return end dist = (points[0] - points[1]).abs for i in 0...(points.length - 1) if dist > (points[i] - points[i + 1]).abs dist = (points[i] - points[i + 1]).abs end end puts dist