結果
問題 | No.2372 既視感 |
ユーザー |
|
提出日時 | 2023-07-07 21:52:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 800 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 82,256 KB |
実行使用メモリ | 77,392 KB |
最終ジャッジ日時 | 2024-07-21 17:45:42 |
合計ジャッジ時間 | 2,682 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
from collections import defaultdictdef add_(a):global memory, mcnt, hist, i_histmemory[a] += 1mcnt += 1hist.append(a)if N < mcnt:memory[hist[i_hist]] -= 1mcnt -= 1i_hist += 1N, K, Q = map(int, input().split())memory = defaultdict(int)mcnt = 0hist = []i_hist = 0for _ in range(Q):a = int(input())if a == 1:s = input()add_(s)else:time = 0solve = []for _ in range(6):t, d = input().split()d = int(d)if t in memory and 0 < memory[t]:time += min(d, K)else:time += dif time <= 60:solve.append(t)print(len(solve))for t in solve:add_(t)