結果

問題 No.2372 既視感
ユーザー 21kazu1321kazu13
提出日時 2023-07-07 21:32:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,466 bytes
コンパイル時間 954 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 80,068 KB
最終ジャッジ日時 2023-09-28 22:31:03
合計ジャッジ時間 5,846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
78,264 KB
testcase_01 AC 142 ms
78,076 KB
testcase_02 AC 138 ms
78,212 KB
testcase_03 WA -
testcase_04 AC 135 ms
78,276 KB
testcase_05 AC 135 ms
78,304 KB
testcase_06 AC 139 ms
78,208 KB
testcase_07 AC 137 ms
78,228 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 169 ms
80,068 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
        print(cnt)
0