結果

問題 No.714 回転寿司屋のシミュレート
ユーザー 👑 rin204rin204
提出日時 2022-01-19 20:37:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 78,088 KB
最終ジャッジ日時 2023-08-15 08:08:16
合計ジャッジ時間 6,401 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,012 KB
testcase_01 AC 64 ms
71,292 KB
testcase_02 AC 68 ms
75,728 KB
testcase_03 AC 82 ms
77,240 KB
testcase_04 AC 80 ms
76,084 KB
testcase_05 AC 94 ms
76,608 KB
testcase_06 AC 106 ms
78,012 KB
testcase_07 AC 134 ms
77,604 KB
testcase_08 AC 123 ms
77,268 KB
testcase_09 AC 124 ms
78,088 KB
testcase_10 AC 117 ms
77,656 KB
testcase_11 AC 104 ms
76,960 KB
testcase_12 AC 119 ms
77,500 KB
testcase_13 AC 106 ms
77,904 KB
testcase_14 AC 102 ms
77,276 KB
testcase_15 AC 106 ms
77,860 KB
testcase_16 AC 92 ms
76,508 KB
testcase_17 AC 114 ms
77,656 KB
testcase_18 AC 107 ms
77,176 KB
testcase_19 AC 99 ms
77,520 KB
testcase_20 AC 104 ms
77,836 KB
testcase_21 AC 95 ms
76,512 KB
testcase_22 AC 92 ms
76,688 KB
testcase_23 AC 92 ms
76,548 KB
testcase_24 AC 95 ms
76,680 KB
testcase_25 AC 103 ms
77,912 KB
testcase_26 AC 100 ms
77,324 KB
testcase_27 AC 91 ms
76,496 KB
testcase_28 AC 91 ms
76,544 KB
testcase_29 AC 95 ms
76,584 KB
testcase_30 AC 68 ms
71,292 KB
testcase_31 AC 68 ms
71,160 KB
testcase_32 AC 64 ms
70,820 KB
testcase_33 AC 61 ms
71,156 KB
testcase_34 AC 65 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

pos = [{} for _ in range(21)]
for _ in range(n):
    t, *Q = input().split()
    if t == "0":
        n, m, *A = Q
        n = int(n)
        for a in A:
            pos[n][a] = pos[n].get(a, 0) + 1
    elif t == "1":
        ng = True
        b = Q[0]
        for i in range(1, 21):
            if pos[i].get(b, 0) > 0:
                print(i)
                pos[i][b] -= 1
                ng = False
                break
        if ng:
            print(-1)
    else:
        c = int(Q[0])
        pos[c] = {}
0