ICPC Live Archive — 4627 Islands

Правка en1, от 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,

Теги #competitive-programming, #union-find, disjoint union, #graph

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский osvaldosantos823 2020-08-06 22:39:49 598 Initial revision (published)