Hello, codeforces! Could someone try to pass my solution in 299702131? The idea is to iterate over n, then k, then run Dial's algorithm (for widest path) over the graph, then skip an edge to make the initial distances for k+1.
I'm reasonably sure the approach is O(n^2m) (confirmed by a friend). The code runs in 600ms on a random case on my laptop. Can someone constant optimize it for me, or tell me why it doesn't pass? Thanks!