結果

問題 No.714 回転寿司屋のシミュレート
ユーザー O2MT
提出日時 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
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = 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,True
            for d in l:
                count += 1
                if not d:
                    continue
                if b in d:
                    d[b] -= 1
                    print(count)
                    flg = False
                    if d[b] == 0:
                        del d[b]
                    break
            if flg:
                print(-1)
        else:
            #データ2の処理
            c = int(u[1])
            l[c] = False
    else:
        #データ0の処理
        A,n = dict(Counter(u[3:])),int(u[1])
        l[n] = A
0