結果

問題 No.714 回転寿司屋のシミュレート
ユーザー toyuzukotoyuzuko
提出日時 2020-06-25 19:16:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 8,628 KB
最終ジャッジ日時 2023-09-16 22:54:12
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,516 KB
testcase_01 AC 17 ms
8,384 KB
testcase_02 AC 18 ms
8,536 KB
testcase_03 AC 19 ms
8,444 KB
testcase_04 AC 19 ms
8,448 KB
testcase_05 AC 22 ms
8,400 KB
testcase_06 AC 30 ms
8,464 KB
testcase_07 AC 35 ms
8,444 KB
testcase_08 AC 49 ms
8,392 KB
testcase_09 AC 27 ms
8,624 KB
testcase_10 AC 24 ms
8,456 KB
testcase_11 AC 27 ms
8,584 KB
testcase_12 AC 29 ms
8,608 KB
testcase_13 AC 26 ms
8,552 KB
testcase_14 AC 26 ms
8,420 KB
testcase_15 AC 26 ms
8,624 KB
testcase_16 AC 27 ms
8,536 KB
testcase_17 AC 27 ms
8,436 KB
testcase_18 AC 26 ms
8,392 KB
testcase_19 AC 26 ms
8,628 KB
testcase_20 AC 26 ms
8,592 KB
testcase_21 AC 26 ms
8,388 KB
testcase_22 AC 23 ms
8,476 KB
testcase_23 AC 22 ms
8,512 KB
testcase_24 AC 22 ms
8,388 KB
testcase_25 AC 22 ms
8,520 KB
testcase_26 AC 23 ms
8,488 KB
testcase_27 AC 21 ms
8,420 KB
testcase_28 AC 22 ms
8,592 KB
testcase_29 AC 23 ms
8,424 KB
testcase_30 AC 17 ms
8,624 KB
testcase_31 AC 17 ms
8,472 KB
testcase_32 AC 17 ms
8,576 KB
testcase_33 AC 17 ms
8,524 KB
testcase_34 AC 17 ms
8,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N = int(input())
S = [defaultdict(int) for _ in range(20)]

for _ in range(N):
    u = input()
    if u[0] == '0':
        _, n, m, *A = u.split()
        n = int(n) - 1
        m = int(m)
        for i in range(m):
            S[n][A[i]] += 1
    elif u[0] == '1':
        _, b = u.split()
        for i in range(20):
            if b in S[i] and S[i][b] > 0:
                S[i][b] -= 1
                print(i + 1)
                break
        else:
            print(-1)
    else:
        _, c = u.split()
        c = int(c) - 1
        S[c].clear()
0