Islands: Difference between revisions

From programming_contest
Jump to navigation Jump to search
imported>Kmk21
Created page with "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 e..."
(No difference)

Revision as of 05:10, 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.