結果
問題 | No.649 ここでちょっとQK! |
ユーザー |
![]() |
提出日時 | 2018-03-03 21:28:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,015 ms / 3,000 ms |
コード長 | 328 bytes |
コンパイル時間 | 217 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 18,688 KB |
最終ジャッジ日時 | 2024-07-04 15:34:08 |
合計ジャッジ時間 | 15,060 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 32 |
ソースコード
import heapqQ, K = map(int, input().split())low = []high = []for _ in range(Q):s = input()if s[0] == '1':n = int(s.split()[1])heapq.heappush(low, -n)if len(low) == K:heapq.heappush(high, -heapq.heappop(low))else:print(-1 if not high else heapq.heappop(high))