ICPC Live Archive — 4627 Islands

Revision en1, by osvaldosantos823, 2020-08-06 22:39:49

Hi, I'm trying to solve this problem: Islands

I know this problem it can be solve with union find, but i don't know how use it. Because I'm doing a walk-through per year and for each year I do a walk-through per node, for that the complexity it would be quadratic.

I have thought to do it linear(O(nlogn)), flood all the island fully and then start decreasing the water level. But I don't know how to do it the walk-through for the array.

Thanks,

Tags #competitive-programming, #union-find, disjoint union, #graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English osvaldosantos823 2020-08-06 22:39:49 598 Initial revision (published)