結果

問題 No.714 回転寿司屋のシミュレート
ユーザー maspy
提出日時 2020-02-02 20:32:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-09-18 21:23:56
合計ジャッジ時間 2,586 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
query = readlines()

hope = [[] for _ in range(21)]

def query_0(q):
    n,m,*A = q
    hope[int(n)] = A

def query_1(q):
    B = q[0]
    for i in range(1,21):
        if B in hope[i]:
            hope[i].remove(B)
            print(i)
            return
    print(-1)

def query_2(q):
    C = q[0]
    hope[int(C)] = []

for q in query:
    t,*q = q.split()
    t = int(t)
    if t == 0:
        query_0(q)
    elif t == 1:
        query_1(q)
    elif t == 2:
        query_2(q)
0