結果

問題 No.714 回転寿司屋のシミュレート
ユーザー O2MTO2MT
提出日時 2021-02-17 01:57:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 819 bytes
コンパイル時間 1,712 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 79,092 KB
最終ジャッジ日時 2023-10-11 15:00:47
合計ジャッジ時間 7,062 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,580 KB
testcase_01 AC 97 ms
71,276 KB
testcase_02 AC 103 ms
76,524 KB
testcase_03 AC 109 ms
76,792 KB
testcase_04 AC 122 ms
77,560 KB
testcase_05 AC 145 ms
77,948 KB
testcase_06 AC 148 ms
78,092 KB
testcase_07 AC 181 ms
78,692 KB
testcase_08 AC 190 ms
78,980 KB
testcase_09 AC 178 ms
78,540 KB
testcase_10 AC 172 ms
79,092 KB
testcase_11 AC 138 ms
78,532 KB
testcase_12 AC 147 ms
77,924 KB
testcase_13 AC 143 ms
78,156 KB
testcase_14 AC 151 ms
78,676 KB
testcase_15 AC 159 ms
78,648 KB
testcase_16 AC 140 ms
77,920 KB
testcase_17 AC 158 ms
78,284 KB
testcase_18 AC 155 ms
78,180 KB
testcase_19 AC 149 ms
78,688 KB
testcase_20 AC 155 ms
78,536 KB
testcase_21 AC 136 ms
77,708 KB
testcase_22 AC 133 ms
77,900 KB
testcase_23 AC 147 ms
78,588 KB
testcase_24 AC 132 ms
77,560 KB
testcase_25 AC 128 ms
77,608 KB
testcase_26 AC 139 ms
77,940 KB
testcase_27 AC 130 ms
77,584 KB
testcase_28 AC 130 ms
77,768 KB
testcase_29 AC 137 ms
77,832 KB
testcase_30 AC 96 ms
71,596 KB
testcase_31 AC 95 ms
71,400 KB
testcase_32 AC 97 ms
71,680 KB
testcase_33 AC 95 ms
71,648 KB
testcase_34 AC 94 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

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