結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
|
提出日時 | 2021-02-17 01:57:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 137 ms / 2,000 ms |
コード長 | 819 bytes |
コンパイル時間 | 629 ms |
コンパイル使用メモリ | 82,208 KB |
実行使用メモリ | 78,240 KB |
最終ジャッジ日時 | 2024-09-13 13:52:29 |
合計ジャッジ時間 | 4,737 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
from collections import CounterN = int(input())l = [False for _ in range(21)]for _ in range(N):u = list(map(str,input().split()))if len(u) == 2:if u[0] == '1':#データ1の処理b,count,flg = u[1],-1,Truefor d in l:count += 1if not d:continueif b in d:d[b] -= 1print(count)flg = Falseif d[b] == 0:del d[b]breakif flg:print(-1)else:#データ2の処理c = int(u[1])l[c] = Falseelse:#データ0の処理A,n = dict(Counter(u[3:])),int(u[1])l[n] = A