結果
| 問題 | No.649 ここでちょっとQK! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-26 11:54:39 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 93,924 KB |
| 最終ジャッジ日時 | 2026-07-18 17:20:20 |
| 合計ジャッジ時間 | 8,721 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 32 |
ソースコード
#yuki649 import heapq q,k=map(int,raw_input().split()) que1=[] que2=[] print '--------------' for i in xrange(q): s=map(int,raw_input().split()) if len(s)==2: v=s[1] if len(que1)<k: heapq.heappush(que1,-v) elif v<-que1[0]: heapq.heappush(que2,-heapq.heappushpop(que1,-v)) else: heapq.heappush(que2,v) else: if len(que1)<k: print '-1' elif que2: print -heapq.heapreplace(que1,-heapq.heappop(que2)) else: print -heapq.heappop(que1)