結果

問題 No.2372 既視感
ユーザー 21kazu1321kazu13
提出日時 2023-07-07 21:32:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,466 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-07-21 17:16:03
合計ジャッジ時間 2,887 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 21
権限があれば一括ダウンロードができます

ソースコード

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
        print(cnt)
0