結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー |
![]() |
提出日時 | 2015-08-03 11:58:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,771 ms / 5,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 52,140 KB |
最終ジャッジ日時 | 2024-07-18 00:59:11 |
合計ジャッジ時間 | 24,472 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import heapq def solve(): N = int(input()) L = list(map(int, input().split())) Q = int(input()) K = list(map(int, input().split())) h = [] for i in range(N): heapq.heappush(h, (-L[i], 1, i)) MAX = 500001 A = [0.0] * MAX for j in range(1, MAX): l, n, i = heapq.heappop(h) A[j] = L[i] / n heapq.heappush(h, (-L[i] / (n + 1), n + 1, i)) for k in K: print(A[k]) def main(): solve() if __name__ == '__main__': main()