Editorial for SCC25 Contest 1 P4 - Mike's Maze


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Qstrich

The intended solution of this problem involves precomputing the order of the edges using a sieve. With the order of the edges laid out simply preform cycle detection with dfs.

Time complexity: \(O(N \text{ loglog}N + M \text{ log}M)\)


Comments

There are no comments at the moment.