Constant factored on 2057E1 (Hello 2025 contest, E1 Another Exercise on Graphs Easy)

Revision en1, by jay_jayjay, 2025-01-05 05:02:04

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!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English jay_jayjay 2025-01-05 05:02:04 530 Initial revision (published)