結果

問題 No.714 回転寿司屋のシミュレート
ユーザー aporo_eeicaporo_eeic
提出日時 2018-07-13 23:03:52
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-07-30 09:59:00
合計ジャッジ時間 2,769 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,548 KB
testcase_01 AC 18 ms
8,520 KB
testcase_02 AC 20 ms
8,616 KB
testcase_03 AC 20 ms
8,512 KB
testcase_04 AC 24 ms
8,484 KB
testcase_05 AC 29 ms
8,648 KB
testcase_06 AC 38 ms
8,704 KB
testcase_07 AC 49 ms
8,560 KB
testcase_08 AC 67 ms
8,604 KB
testcase_09 AC 35 ms
8,688 KB
testcase_10 AC 32 ms
8,684 KB
testcase_11 AC 35 ms
8,560 KB
testcase_12 AC 32 ms
8,636 KB
testcase_13 AC 34 ms
8,556 KB
testcase_14 AC 34 ms
8,644 KB
testcase_15 AC 33 ms
8,684 KB
testcase_16 AC 33 ms
8,516 KB
testcase_17 AC 31 ms
8,620 KB
testcase_18 AC 32 ms
8,620 KB
testcase_19 AC 33 ms
8,628 KB
testcase_20 AC 32 ms
8,556 KB
testcase_21 AC 33 ms
8,520 KB
testcase_22 AC 27 ms
8,528 KB
testcase_23 AC 26 ms
8,696 KB
testcase_24 AC 27 ms
8,600 KB
testcase_25 AC 26 ms
8,624 KB
testcase_26 AC 27 ms
8,556 KB
testcase_27 AC 25 ms
8,600 KB
testcase_28 AC 27 ms
8,516 KB
testcase_29 AC 27 ms
8,484 KB
testcase_30 AC 18 ms
8,676 KB
testcase_31 AC 19 ms
8,476 KB
testcase_32 AC 19 ms
8,480 KB
testcase_33 AC 19 ms
8,616 KB
testcase_34 AC 19 ms
8,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

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

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(1,21):
        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