結果

問題 No.2804 Fixer And Ratism
ユーザー hirayuu_yc
提出日時 2024-07-01 14:46:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 77,696 KB
最終ジャッジ日時 2024-07-11 23:10:10
合計ジャッジ時間 16,457 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
there=[]
for i in range(Q):
    t,*q=input().split()
    if t=="1":
        there.append((int(q[1]),q[0]))
    elif t=="2":
        N-=int(q[0])
    else:
        N+=int(q[1])
        for i in range(len(there)):
            if there[i][1]==q[0]:
                there[i]=(there[i][0]+998244353,q[0])
    there.sort(reverse=True)
    while len(there)>N:
        print(there[-1][1])
        there.pop()
0