結果

問題 No.2372 既視感
ユーザー Kanten4205Kanten4205
提出日時 2023-06-21 17:01:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 84,804 KB
最終ジャッジ日時 2023-09-14 08:40:29
合計ジャッジ時間 7,279 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
80,868 KB
testcase_01 AC 172 ms
80,680 KB
testcase_02 AC 169 ms
80,860 KB
testcase_03 AC 175 ms
80,692 KB
testcase_04 AC 169 ms
80,584 KB
testcase_05 AC 168 ms
80,848 KB
testcase_06 AC 169 ms
80,740 KB
testcase_07 AC 167 ms
80,696 KB
testcase_08 AC 204 ms
83,016 KB
testcase_09 AC 182 ms
82,048 KB
testcase_10 AC 219 ms
83,076 KB
testcase_11 AC 212 ms
82,704 KB
testcase_12 AC 173 ms
80,892 KB
testcase_13 AC 214 ms
82,792 KB
testcase_14 AC 180 ms
82,024 KB
testcase_15 AC 196 ms
82,476 KB
testcase_16 AC 192 ms
82,324 KB
testcase_17 AC 182 ms
82,016 KB
testcase_18 AC 179 ms
81,976 KB
testcase_19 AC 177 ms
80,860 KB
testcase_20 AC 179 ms
80,864 KB
testcase_21 AC 178 ms
80,868 KB
testcase_22 AC 180 ms
81,716 KB
testcase_23 AC 219 ms
83,500 KB
testcase_24 AC 233 ms
83,700 KB
testcase_25 AC 214 ms
83,488 KB
testcase_26 AC 214 ms
83,132 KB
testcase_27 AC 213 ms
83,152 KB
testcase_28 AC 258 ms
84,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import queue
N, K, Q = map(int, input().split())
q = []
for _ in range(Q):
    t = int(input())
    if t == 1:
        s = input()
        q.append(s)
        if len(q) > N: q.pop(0)
    else:
        s = set()
        for i in q:
            s.add(i)
        sum = 0;ans = 0
        for i in range(6):
            p = input().split()
            if p[0] in s:
                sum = sum + min(int(p[1]), K)
            else:
                sum = sum + int(p[1])
            if sum <= 60:
                ans = ans + 1
                q.append(p[0])
                if len(q) > N: q.pop(0)
        print(ans)
0