結果

問題 No.2372 既視感
ユーザー rlangevinrlangevin
提出日時 2023-07-07 21:42:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 687 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 78,312 KB
最終ジャッジ日時 2023-09-28 22:45:06
合計ジャッジ時間 4,743 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
71,968 KB
testcase_01 AC 94 ms
71,720 KB
testcase_02 AC 91 ms
71,696 KB
testcase_03 AC 93 ms
72,008 KB
testcase_04 AC 93 ms
71,888 KB
testcase_05 AC 94 ms
71,876 KB
testcase_06 AC 92 ms
71,816 KB
testcase_07 AC 93 ms
71,768 KB
testcase_08 AC 108 ms
77,988 KB
testcase_09 AC 102 ms
76,240 KB
testcase_10 AC 109 ms
77,964 KB
testcase_11 AC 106 ms
77,884 KB
testcase_12 AC 98 ms
76,272 KB
testcase_13 AC 112 ms
77,584 KB
testcase_14 AC 104 ms
76,636 KB
testcase_15 AC 109 ms
77,576 KB
testcase_16 AC 103 ms
76,096 KB
testcase_17 AC 103 ms
76,264 KB
testcase_18 AC 103 ms
76,284 KB
testcase_19 AC 100 ms
76,308 KB
testcase_20 AC 109 ms
76,288 KB
testcase_21 AC 107 ms
76,276 KB
testcase_22 AC 101 ms
76,248 KB
testcase_23 AC 121 ms
77,752 KB
testcase_24 AC 122 ms
77,576 KB
testcase_25 AC 122 ms
77,856 KB
testcase_26 AC 114 ms
78,040 KB
testcase_27 AC 114 ms
78,048 KB
testcase_28 AC 121 ms
78,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, K, Q = map(int, input().split())
S = deque()
for _ in range(Q):
    flag = int(input())
    if flag == 1:
        S.append(input().rstrip())
    else:
        t, d = [0] * 6, [0] * 6
        for i in range(6):
            t[i], d[i] = input().split()
            
        ans = 0
        now = 0
        for i in range(6):
            if t[i] in S:
                now += min(int(d[i]), K)
            else:
                now += int(d[i])
            if now <= 60:
                ans += 1
                S.append(t[i])
            
        print(ans)
            
    while len(S) > N:
        S.popleft()
        
0