結果

問題 No.714 回転寿司屋のシミュレート
ユーザー nebukuro09nebukuro09
提出日時 2018-07-13 22:28:03
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 76,672 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2024-04-17 11:18:05
合計ジャッジ時間 5,331 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
77,356 KB
testcase_01 AC 84 ms
77,568 KB
testcase_02 AC 117 ms
78,464 KB
testcase_03 AC 132 ms
79,908 KB
testcase_04 AC 101 ms
79,872 KB
testcase_05 AC 114 ms
79,488 KB
testcase_06 AC 111 ms
79,512 KB
testcase_07 AC 132 ms
80,256 KB
testcase_08 AC 166 ms
80,396 KB
testcase_09 AC 140 ms
81,152 KB
testcase_10 AC 130 ms
80,572 KB
testcase_11 AC 121 ms
80,260 KB
testcase_12 AC 119 ms
79,900 KB
testcase_13 AC 116 ms
79,648 KB
testcase_14 AC 113 ms
79,744 KB
testcase_15 AC 115 ms
79,624 KB
testcase_16 AC 120 ms
80,512 KB
testcase_17 AC 127 ms
80,540 KB
testcase_18 AC 118 ms
79,616 KB
testcase_19 AC 113 ms
79,616 KB
testcase_20 AC 120 ms
79,884 KB
testcase_21 AC 111 ms
79,488 KB
testcase_22 AC 115 ms
80,896 KB
testcase_23 AC 115 ms
80,128 KB
testcase_24 AC 109 ms
79,488 KB
testcase_25 AC 104 ms
78,848 KB
testcase_26 AC 115 ms
79,872 KB
testcase_27 AC 107 ms
79,104 KB
testcase_28 AC 109 ms
79,744 KB
testcase_29 AC 111 ms
79,488 KB
testcase_30 AC 85 ms
77,440 KB
testcase_31 AC 84 ms
77,824 KB
testcase_32 AC 87 ms
77,692 KB
testcase_33 AC 83 ms
77,952 KB
testcase_34 AC 86 ms
77,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N = input()
S = [None for _ in xrange(21)]
for _ in xrange(N):
    Q = raw_input().split()
    if Q[0] == '0':
        n, m = map(int, Q[1:3])
        S[n] = Counter(Q[3:])
    elif Q[0] == '1':
        b = Q[1]
        ok = False
        for i in xrange(1, 21):
            if S[i] is None:
                continue
            if b in S[i] and S[i][b] > 0:
                print i
                S[i][b] -= 1
                ok = True
                break
        if not ok:
            print -1
    else:
        i = int(Q[1])
        S[i] = None
0