結果
問題 | No.2372 既視感 |
ユーザー |
|
提出日時 | 2023-07-07 21:37:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 942 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 70,144 KB |
最終ジャッジ日時 | 2024-07-21 17:21:47 |
合計ジャッジ時間 | 2,855 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
import syssys.setrecursionlimit(5*10**5)input = sys.stdin.readlinefrom collections import defaultdict, deque, Counterfrom heapq import heappop, heappushfrom bisect import bisect_left, bisect_rightfrom math import gcdn,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] += 1while len(a) > n:d[a.popleft()] -= 1else:now = 0cnt = 0sol = []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:cnt += 1sol.append(l[0])now += tfor pro in sol:a.append(pro)d[pro] += 1while len(a) > n:d[a.popleft()] -= 1print(cnt)