I have a problem: given a tree on N vertices, I need to answer requests with 2 types:
1)Delete I-th edge if it's in the graph (or vice versa).
2)Find a maximum matching in a component including vertex X.
I have a solution: dfs with DP on tree to count maximum matching on each request, but N and Q <= 1e5 and I've TL. Please tell, how I can improve this?
P.S. This is my first blog, please dont kill me for some possible mistakes:)