結果
| 問題 |
No.1110 好きな歌
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-15 19:37:18 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 467 ms / 5,000 ms |
| コード長 | 228 bytes |
| コンパイル時間 | 77 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 37,376 KB |
| 最終ジャッジ日時 | 2024-07-18 03:25:31 |
| 合計ジャッジ時間 | 16,331 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - ans Syntax OK
ソースコード
n,d=gets.split(" ").map{|e| e.to_i}
xs=readlines.map{|e| e.to_i}
xs2=xs.sort
ans={}
p1=0
p2=0
c1=0
hs={}
while p1<n do
if xs2[p2]<=xs2[p1]-d then
c1+=1
p2+=1
else
hs[xs2[p1]]=c1
p1+=1
end
end
xs.each{|x|
puts hs[x]
}
horiesiniti