結果
| 問題 |
No.2804 Fixer And Ratism
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-12 21:43:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 580 bytes |
| コンパイル時間 | 624 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-12 21:43:21 |
| 合計ジャッジ時間 | 11,058 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 20 |
ソースコード
N, Q = map(int, input().split())
D = {}
L = []
for q in range(Q):
query = input().split()
if query[0] == '1':
s, r = query[1], int(query[2])
D[s] = [False, r, s]
L.append(D[s])
if (len(L) > N):
m = min(L)
print(m[-1])
L.remove(m)
elif query[0] == '2':
x = int(query[1])
N -= x
L.sort(reverse=True)
while len(L) > N:
m = L.pop()
print(m[-1])
elif query[0] == '3':
s, x = query[1], int(query[2])
N += x
D[s][0] = True