結果
| 問題 |
No.68 よくある棒を切る問題 (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-12 11:31:37 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 2,110 ms / 5,000 ms |
| コード長 | 360 bytes |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 55,740 KB |
| 最終ジャッジ日時 | 2024-12-21 15:46:43 |
| 合計ジャッジ時間 | 30,072 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#yuki68
from heapq import heappush, heappop
N=int(raw_input())
L=map(int,raw_input().split())
Q=int(raw_input())
K=map(int,raw_input().split())
res=[0.0 for i in xrange(max(K)+1)]
hp=[]
for l in L:
heappush(hp,(-l,l,1))
for i in range(1,max(K)+1):
(a,b,n)=heappop(hp)
res[i]=-a
heappush(hp,(-1.0*b/(n+1),b,n+1))
for k in K:
print res[k]