結果

問題 No.714 回転寿司屋のシミュレート
ユーザー aporo_eeicaporo_eeic
提出日時 2018-07-13 22:46:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 749 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-17 11:19:42
合計ジャッジ時間 2,286 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,624 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 47 ms
10,880 KB
testcase_20 AC 45 ms
10,752 KB
testcase_21 AC 46 ms
10,752 KB
testcase_22 AC 39 ms
10,752 KB
testcase_23 AC 39 ms
10,624 KB
testcase_24 AC 40 ms
10,624 KB
testcase_25 AC 39 ms
10,752 KB
testcase_26 AC 40 ms
10,752 KB
testcase_27 AC 38 ms
10,752 KB
testcase_28 AC 40 ms
10,624 KB
testcase_29 AC 40 ms
10,752 KB
testcase_30 AC 30 ms
10,880 KB
testcase_31 RE -
testcase_32 AC 30 ms
10,752 KB
testcase_33 AC 29 ms
10,624 KB
testcase_34 AC 29 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

customers = [collections.Counter() for i in range(20)]

def set_costomer(row):
    customers[int(row[0])] = collections.Counter()
    for neta in row[2:]:
        customers[int(row[0])][neta] += 1

def remove_customer(row):
    customers[int(row[0])] = collections.Counter()

def roling_neta(neta):
    for i in range(20):
        if(customers[i][neta[0]] > 0):
            customers[i][neta[0]] -= 1
            return i
    return -1 

N = int(input().strip())
for n in range(N):
    row = list(input().strip().split(" "))
    if(int(row[0]) == 0):
        set_costomer(row[1:])
    if(int(row[0]) == 1):
        eaten_by = roling_neta(row[1:])
        print(eaten_by)
    if(int(row[0]) == 2):
        remove_customer(row[1:])
0