Comments
0

All good — I understand your test. Looking at the submissions that seem to be passing for problem C, it seems like they used what I mentioned but adjusted it a bit for the edge cases :(

0

Fudge.

0

What is the counter-example? Like which ones belong to which list?

0

Div2 C I think I figured out... I was not sure though: is it just total — 2*(smallest + second_smallest) ? D was easier I thought...

I thought of this, but I did not have time to implement it and it seemed a bit hacky :(

Yeah I agree, but it shouldn't have to make a big difference since my complexity and approach were correct.

Here is my submission if anyone can take a look: https://atcoder.jp/contests/abc184/submissions/18338763

I think there is a mistake in problem E... I wrote a simple BFS that should never visit a node more than once (and never try to visit a node more than 5 times due to teleport — using the fact that the closest 'a' character to the start should be the one that uses all of the potential 'a' teleports); so my algorithm should be O(m) where m is the number of edges in the graph, but it does not work because of TLE.

I wrote my code in C++