結果

問題 No.714 回転寿司屋のシミュレート
ユーザー ああいいああいい
提出日時 2022-05-18 10:41:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 79,380 KB
最終ジャッジ日時 2023-10-14 17:14:31
合計ジャッジ時間 8,988 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
71,680 KB
testcase_01 AC 98 ms
71,700 KB
testcase_02 AC 104 ms
76,904 KB
testcase_03 AC 127 ms
78,628 KB
testcase_04 AC 117 ms
77,156 KB
testcase_05 AC 139 ms
78,048 KB
testcase_06 AC 136 ms
78,020 KB
testcase_07 AC 175 ms
78,516 KB
testcase_08 AC 180 ms
79,192 KB
testcase_09 AC 174 ms
79,380 KB
testcase_10 AC 157 ms
78,424 KB
testcase_11 AC 140 ms
78,164 KB
testcase_12 AC 169 ms
78,548 KB
testcase_13 AC 145 ms
78,152 KB
testcase_14 AC 149 ms
78,204 KB
testcase_15 AC 150 ms
78,180 KB
testcase_16 AC 142 ms
78,164 KB
testcase_17 AC 157 ms
77,784 KB
testcase_18 AC 146 ms
77,828 KB
testcase_19 AC 143 ms
78,040 KB
testcase_20 AC 146 ms
78,268 KB
testcase_21 AC 137 ms
78,120 KB
testcase_22 AC 138 ms
78,184 KB
testcase_23 AC 135 ms
77,988 KB
testcase_24 AC 146 ms
78,064 KB
testcase_25 AC 148 ms
77,908 KB
testcase_26 AC 137 ms
78,024 KB
testcase_27 AC 136 ms
77,772 KB
testcase_28 AC 135 ms
77,976 KB
testcase_29 AC 141 ms
77,824 KB
testcase_30 AC 101 ms
71,520 KB
testcase_31 AC 101 ms
71,876 KB
testcase_32 AC 104 ms
71,360 KB
testcase_33 AC 102 ms
71,688 KB
testcase_34 AC 101 ms
71,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

from collections import defaultdict
d = [defaultdict(int) for _ in range(20)]
for _ in range(N):
    l = input().split()
    l[0] = int(l[0])
    if l[0] == 0:
        n = int(l[1])
        m = int(l[2])
        n -= 1
        d[n] = defaultdict(int)
        for v in l[3:]:
            d[n][v] += 1
    elif l[0] == 1:
        b = l[1]
        flag = False
        for i in range(20):
            if b in d[i]:
                print(i + 1)
                d[i][b] -= 1
                if d[i][b] == 0:
                    del d[i][b]
                flag = True
                break
        if flag == False:
            print(-1)
    else:
        c = int(l[1])
        d[c-1] = defaultdict(int)
0