結果
| 問題 |
No.2372 既視感
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-07 21:34:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 954 bytes |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 69,376 KB |
| 最終ジャッジ日時 | 2024-07-21 17:18:08 |
| 合計ジャッジ時間 | 2,707 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 21 |
ソースコード
import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd
n,k,q = map(int,input().split())
a = deque()
d = defaultdict(int)
for i in range(q):
t = int(input())
if t == 1:
s = input().rstrip()
a.append(s)
d[s] += 1
while len(a) > n:
d[a.popleft()] -= 1
else:
now = 0
cnt = 0
sol = []
for i in range(6):
l = list(input().split())
t = int(l[1])
if d[l[0]] >= 1:
t = min(t, k)
if now + t <= 60:
now += t
cnt += 1
sol.append(l[0])
for pro in sol:
a.append(pro)
d[pro] += 1
while len(a) > n:
d[a.popleft()] -= 1
print(cnt)