I haven’t done atcoder contests for a while now, and I honestly didn’t do as well as I expected. A to D were pretty standard atcoder problems, so I’ll skip them.
E was a question about like probability expectation but weirdly, I still can’t understand the question even now.
F was is really good question that I wasn’t able to solve it in-contest but upsolved later. The statement is pretty clear so I’ll skip it.
The idea here is the matches form a tree with the probabilities as the edge’s weight.
We can then dfs to get the sum of probabilities which is the expectation for the nodes.
To build this tree, we can use DSU to maintain the status of belonged groups. (We can’t use union by rank though because the parent needs to be the biggest indexed one)
This was an pretty usual contest, and I got -25… sad. Im really not good at combating stress, so I got WA on pA unfortunately, and I didn’t solve pD in contest.
pC was not a really good question imo. I got a O(n4) that got TLE and is stumped me for a bit.
But I got another idea: I precomputed all the answers (as n was quite small), and actually AC’d it! amazing!
the pD from this contest was pretty nice, maybe I’ll make an editorial later on I guess (Im lazy haha)