結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー |
![]() |
提出日時 | 2022-11-03 20:03:45 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 209 bytes |
コンパイル時間 | 131 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 22,400 KB |
最終ジャッジ日時 | 2024-07-18 03:24:13 |
合計ジャッジ時間 | 3,598 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i a = gets.split.map(&:to_i).sort ans = [] n.times do |i| next if i == 0 || i == n-1 b = a[i] - a[i-1] c = a[i+1] - a[i] ans << b if b != 0 ans << c if c != 0 end puts ans.min