結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-09 17:50:00 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 326 bytes |
| コンパイル時間 | 49 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 29,344 KB |
| 最終ジャッジ日時 | 2024-10-09 06:43:24 |
| 合計ジャッジ時間 | 12,459 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 21 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - loop Syntax OK
ソースコード
loop = gets.to_i
points = gets.split.map(&:to_i).uniq
if points.length < 2
puts 0
return
end
dist = (points[0] - points[1]).abs
for i in 0...(points.length - 1)
xi = points[i]
for j in (i+1)...(points.length)
xj = points[j]
dist = (xi - xj).abs if dist > (xi - xj).abs
end
end
puts dist