結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー |
![]() |
提出日時 | 2022-03-06 15:43:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 2,973 ms / 5,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 311 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 58,124 KB |
最終ジャッジ日時 | 2024-07-21 01:16:14 |
合計ジャッジ時間 | 37,600 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
from heapq import heappush, heappopN = int(input())L = list(map(int,input().split()))heap = []for i in range(N):heappush(heap, (-L[i], i))M = 500000ans = [0] * (M+1)cnt = [0] * Nfor i in range(1,M+1):A,P = heappop(heap)A *= -1ans[i] = Acnt[P] += 1heappush(heap, (-(L[P] / (cnt[P] + 1.0)), P))Q = int(input())K = list(map(int,input().split()))for i in range(Q):print(ans[K[i]])