結果

問題 No.714 回転寿司屋のシミュレート
ユーザー tails1434tails1434
提出日時 2020-01-16 07:43:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 1,140 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 78,920 KB
最終ジャッジ日時 2023-09-05 11:17:40
合計ジャッジ時間 7,386 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,728 KB
testcase_01 AC 99 ms
71,640 KB
testcase_02 AC 105 ms
76,904 KB
testcase_03 AC 118 ms
78,080 KB
testcase_04 AC 119 ms
77,284 KB
testcase_05 AC 140 ms
78,424 KB
testcase_06 AC 137 ms
78,032 KB
testcase_07 AC 169 ms
78,532 KB
testcase_08 AC 168 ms
78,812 KB
testcase_09 AC 165 ms
78,864 KB
testcase_10 AC 169 ms
78,920 KB
testcase_11 AC 128 ms
77,932 KB
testcase_12 AC 159 ms
78,668 KB
testcase_13 AC 143 ms
78,244 KB
testcase_14 AC 140 ms
78,132 KB
testcase_15 AC 142 ms
78,344 KB
testcase_16 AC 140 ms
78,244 KB
testcase_17 AC 152 ms
78,472 KB
testcase_18 AC 143 ms
78,088 KB
testcase_19 AC 141 ms
78,132 KB
testcase_20 AC 141 ms
78,192 KB
testcase_21 AC 133 ms
78,032 KB
testcase_22 AC 132 ms
78,140 KB
testcase_23 AC 130 ms
78,228 KB
testcase_24 AC 138 ms
78,172 KB
testcase_25 AC 144 ms
78,128 KB
testcase_26 AC 132 ms
78,124 KB
testcase_27 AC 130 ms
78,060 KB
testcase_28 AC 129 ms
78,164 KB
testcase_29 AC 134 ms
77,808 KB
testcase_30 AC 101 ms
71,484 KB
testcase_31 AC 101 ms
71,760 KB
testcase_32 AC 102 ms
71,648 KB
testcase_33 AC 101 ms
71,968 KB
testcase_34 AC 102 ms
71,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

def main():
    N = int(input())
    d = defaultdict(list)
    for _ in range(N):
        i, *tmp = input().split()
        if i == '0':
            n, m, *A = tmp
            for a in A:
                d[int(n)].append(a)
        if i == '1':
            for j in range(1,21):
                if tmp[0] in d[j]:
                    d[j].remove(tmp[0])
                    print(j)
                    break
            else:
                print(-1)
        if i == '2':
            d[int(tmp[0])].clear()

if __name__ == "__main__":
    main()
0