結果
問題 |
No.3298 K-th Slime
|
ユーザー |
|
提出日時 | 2025-10-05 15:49:41 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 556 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 92,416 KB |
最終ジャッジ日時 | 2025-10-05 15:50:06 |
合計ジャッジ時間 | 5,874 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 17 |
ソースコード
import heapq n,k,q=list(map(int,input().split())) a=list(map(int,input().split())) a.sort() front=a[:k-1] back=a[k-1:] if k==1: front.append(-1) for i in range(q): f,*x=list(map(int,input().split())) # print(front) # print(back) if f==1: if x[0]>=front[-1]: heapq.heappush(back,x[0]) else: y=front.pop() heapq.heappush(back,y) front.append(x[0]) if f==2: y=heapq.heappop(back) z=x[0]+y heapq.heappush(back,z) if f==3: print(back[0])