結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
apierce
|
| 提出日時 | 2022-11-03 20:04:42 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 162 ms / 5,000 ms |
| コード長 | 214 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 22,528 KB |
| 最終ジャッジ日時 | 2024-07-18 03:24:57 |
| 合計ジャッジ時間 | 3,129 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
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 || 0
apierce