結果
| 問題 |
No.649 ここでちょっとQK!
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2018-11-22 17:49:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,099 ms / 3,000 ms |
| コード長 | 345 bytes |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 18,560 KB |
| 最終ジャッジ日時 | 2024-12-24 17:43:42 |
| 合計ジャッジ時間 | 16,869 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 32 |
ソースコード
import heapq
Q, K = map(int, input().split())
s = []
low = []
high = []
for q in range(Q):
line = input().strip()
if line[0] == '1':
_, val = map(int, line.split())
heapq.heappush(low, -val)
if len(low) == K:
heapq.heappush(high, -heapq.heappop(low))
if line[0] == '2':
print(-1 if not high else heapq.heappop(high))
💕💖💞