結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-06-14 02:01:46 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 133 ms / 5,000 ms |
| コード長 | 216 bytes |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 18,688 KB |
| 最終ジャッジ日時 | 2024-06-11 06:49:59 |
| 合計ジャッジ時間 | 3,386 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n=STDIN.gets().to_i
as=STDIN.gets().split(" ")
as.size.times do |i|
as[i]=as[i].to_i
end
as.sort!()
ans=as[as.size-1]-as[0]
i=1
while i<as.size
d=as[i]-as[i-1]
if d>0 then
ans=[ans,d].min
end
i+=1
end
puts ans
horiesiniti