結果

問題 No.2372 既視感
ユーザー 21kazu1321kazu13
提出日時 2023-07-07 21:41:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 1,506 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 79,956 KB
最終ジャッジ日時 2023-09-28 22:42:48
合計ジャッジ時間 6,527 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
78,124 KB
testcase_01 AC 156 ms
78,120 KB
testcase_02 AC 157 ms
78,104 KB
testcase_03 AC 155 ms
78,132 KB
testcase_04 AC 155 ms
78,080 KB
testcase_05 AC 156 ms
78,152 KB
testcase_06 AC 158 ms
78,244 KB
testcase_07 AC 155 ms
78,252 KB
testcase_08 AC 170 ms
79,432 KB
testcase_09 AC 162 ms
78,128 KB
testcase_10 AC 169 ms
79,456 KB
testcase_11 AC 167 ms
79,452 KB
testcase_12 AC 155 ms
77,980 KB
testcase_13 AC 172 ms
79,728 KB
testcase_14 AC 156 ms
78,016 KB
testcase_15 AC 163 ms
79,168 KB
testcase_16 AC 158 ms
78,132 KB
testcase_17 AC 155 ms
78,428 KB
testcase_18 AC 156 ms
78,128 KB
testcase_19 AC 158 ms
78,280 KB
testcase_20 AC 155 ms
78,104 KB
testcase_21 AC 155 ms
78,048 KB
testcase_22 AC 156 ms
78,048 KB
testcase_23 AC 174 ms
79,512 KB
testcase_24 AC 171 ms
79,620 KB
testcase_25 AC 171 ms
79,512 KB
testcase_26 AC 176 ms
79,632 KB
testcase_27 AC 173 ms
79,508 KB
testcase_28 AC 188 ms
79,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
from bisect import bisect_left, bisect_right, insort_left, insort_right  # type: ignore
from collections import Counter, defaultdict, deque  # type: ignore
from math import gcd, sqrt, ceil  # type: ignore
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge  # type: ignore
from itertools import accumulate, combinations, permutations, product  # type: ignore
from string import ascii_lowercase, ascii_uppercase # type: ignore

def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode("utf-8").split()
def S(): return sys.stdin.buffer.readline().rstrip().decode("utf-8")
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def SRL(n): return [list(S()) for _ in range(n)]

N,K,Q = LI()
A = []
for _ in range(Q):
    t = I()
    if t==1:
        s = S()
        A.append(s)
    else:
        ps = LSR(6)
        g = set(A[-N:])
        for i in range(6):
            if ps[i][0] in g:
                ps[i][1] = min(int(ps[i][1]),K)
            else:
                ps[i][1] = int(ps[i][1])
        rem = 60
        cnt = 0
        for t,d in ps:
            if rem-d>=0:
                rem-=d
                A.append(t)
                cnt+=1
            else:
                break
        print(cnt)
0