結果
問題 |
No.2804 Fixer And Ratism
|
ユーザー |
|
提出日時 | 2024-07-12 21:43:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 616 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-12 21:43:15 |
合計ジャッジ時間 | 2,752 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | WA * 1 RE * 30 |
ソースコード
N,Q = map(int,input().split()) num = 0 people = [] def delete(people): MIN = [4001,-1] for i in range(len(people)): if people[i][1] < MIN[0]: MIN = [people[i][1],i] print(people.pop(MIN[1])[0]) return people for i in range(Q): am = input().split() if am[0] == "1": people.append([am[1],int(am[2])]) num += 1 if num > N: people = delete(people) elif am[0]=="2": N -= int(am[1]) for i in range(N-num): people = delete(people) if N > num: num = N else: N += int(am[2])