Islands: Difference between revisions
Jump to navigation
Jump to search
imported>Kmk21 No edit summary |
imported>Kmk21 No edit summary |
||
Line 7: | Line 7: | ||
[[Category:ICPC Problems]] | [[Category:ICPC Problems]] | ||
[[Category:Midatl2016]] | [[Category:Midatl2016]] | ||
[[Category:Ser2016 | [[Category:Ser2016]] | ||
[[Category:Algorithm Easy]] | [[Category:Algorithm Easy]] | ||
[[Category:Implementation Easy]] | [[Category:Implementation Easy]] | ||
[[Category:Grid]] | [[Category:Grid]] | ||
[[Category:BFS]] | [[Category:BFS]] |
Latest revision as of 14:57, 2 November 2017
Given a map, with marked land, water, and ???, determine the minimum number of disjoint pieces of land.
Quite a simple flood fill. When you find a piece of land, flood fill everything around it, including clouds, assuming they are land, and count 1 island.
All other clouds (which don't touch land) are considered water.