結果

問題 No.714 回転寿司屋のシミュレート
ユーザー lloyzlloyz
提出日時 2022-06-20 23:26:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 82,972 KB
実行使用メモリ 77,736 KB
最終ジャッジ日時 2024-04-21 13:46:46
合計ジャッジ時間 4,050 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,000 KB
testcase_01 AC 38 ms
53,948 KB
testcase_02 AC 46 ms
61,576 KB
testcase_03 AC 58 ms
68,720 KB
testcase_04 AC 51 ms
64,760 KB
testcase_05 AC 86 ms
77,156 KB
testcase_06 AC 67 ms
71,728 KB
testcase_07 AC 96 ms
76,976 KB
testcase_08 AC 107 ms
77,132 KB
testcase_09 AC 111 ms
77,736 KB
testcase_10 AC 90 ms
77,148 KB
testcase_11 AC 70 ms
73,188 KB
testcase_12 AC 91 ms
76,760 KB
testcase_13 AC 74 ms
74,376 KB
testcase_14 AC 73 ms
74,200 KB
testcase_15 AC 72 ms
74,304 KB
testcase_16 AC 72 ms
74,596 KB
testcase_17 AC 91 ms
77,416 KB
testcase_18 AC 88 ms
77,304 KB
testcase_19 AC 75 ms
74,844 KB
testcase_20 AC 91 ms
76,956 KB
testcase_21 AC 77 ms
73,832 KB
testcase_22 AC 65 ms
72,000 KB
testcase_23 AC 74 ms
73,456 KB
testcase_24 AC 70 ms
72,832 KB
testcase_25 AC 66 ms
71,728 KB
testcase_26 AC 71 ms
74,092 KB
testcase_27 AC 62 ms
68,816 KB
testcase_28 AC 65 ms
70,988 KB
testcase_29 AC 87 ms
76,968 KB
testcase_30 AC 37 ms
54,816 KB
testcase_31 AC 39 ms
54,188 KB
testcase_32 AC 39 ms
55,508 KB
testcase_33 AC 37 ms
54,252 KB
testcase_34 AC 37 ms
55,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())
Cnt = defaultdict(lambda :[0 for _ in range(21)])
for _ in range(n):
    L = list(input().split())
    if L[0] == '0':
        j = int(L[1])
        m = int(L[2])
        L = L[3:]
        for i in range(m):
            Cnt[L[i]][j] += 1
    elif L[0] == '1':
        s = L[1]
        flag = False
        for i in range(1, 21):
            if Cnt[s][i] > 0:
                Cnt[s][i] -= 1
                print(i)
                flag = True
                break
        if not flag:
            print(-1)
    elif L[0] == '2':
        j = int(L[1])
        for s in Cnt.keys():
            Cnt[s][j] = 0
0