結果

問題 No.714 回転寿司屋のシミュレート
コンテスト
ユーザー titia
提出日時 2024-12-28 01:16:28
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 36 ms / 2,000 ms
+ 272µs
コード長 528 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 54 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2026-10-08 20:09:20
合計ジャッジ時間 3,214 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

from collections import Counter

LIST=[Counter() for i in range(25)]

N=int(input())

for tests in range(N):
    L=input().split()

    if L[0]=="1":
        x=L[1]
        for i in range(25):
            if x in LIST[i] and LIST[i][x]>0:
                print(i)
                LIST[i][x]-=1
                break
        else:
            print(-1)
    elif L[0]=="0":
        C=Counter(L[3:])

        LIST[int(L[1])]=C
    else:
        x=int(L[1])
        LIST[x]=Counter()
        
0