結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー | ytft |
提出日時 | 2022-11-07 09:58:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 3,226 ms / 5,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 916 ms |
コンパイル使用メモリ | 86,840 KB |
実行使用メモリ | 171,688 KB |
最終ジャッジ日時 | 2023-09-28 00:03:45 |
合計ジャッジ時間 | 42,878 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3,163 ms
164,564 KB |
testcase_01 | AC | 3,226 ms
169,184 KB |
testcase_02 | AC | 3,223 ms
167,868 KB |
testcase_03 | AC | 3,094 ms
170,844 KB |
testcase_04 | AC | 2,988 ms
171,008 KB |
testcase_05 | AC | 3,035 ms
171,560 KB |
testcase_06 | AC | 2,952 ms
160,544 KB |
testcase_07 | AC | 3,004 ms
163,720 KB |
testcase_08 | AC | 2,730 ms
169,572 KB |
testcase_09 | AC | 2,894 ms
171,688 KB |
ソースコード
import sys,heapq input=lambda:sys.stdin.readline().rstrip() N=int(input()) L=list(map(int,input().split())) Q=int(input()) K=list(map(int,input().split())) check=[] M=max(K) h=[] for i in range(N): heapq.heappush(h,[-L[i],1]) while len(check)<M: temp=heapq.heappop(h) check.append(-temp[0]) heapq.heappush(h,[temp[0]*temp[1]/(temp[1]+1),temp[1]+1]) for i in K: print(check[i-1])