結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
wonda_t_coffee
|
| 提出日時 | 2020-01-29 10:57:56 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 172 ms / 5,000 ms |
| コード長 | 188 bytes |
| コンパイル時間 | 77 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 24,832 KB |
| 最終ジャッジ日時 | 2024-09-16 00:45:08 |
| 合計ジャッジ時間 | 3,527 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n = gets.chomp.to_i x = gets.chomp.split.map(&:to_i).uniq.sort if x.size == 1 puts 0 exit end ans = 0xffffffff x.each_cons(2) do |x1, x2| ans = [ans, (x1-x2).abs].min end puts ans
wonda_t_coffee