---
id: ff
title: Flood Fill
author: Siyong Huang
prerequisites: 
 - Silver - Depth First Search
description: Finding connected components in a graph that is respresented by a grid.
---

## [Flood Fill](https://en.wikipedia.org/wiki/Flood_fill)

 - [CSES Counting Rooms](https://cses.fi/problemset/task/1192)
 - [CSES Labyrinth](https://cses.fi/problemset/task/1193)

### Tutorial

 - Recommended:
   - Intro to USACO Ch 10

### Problems

 - [Ice Perimeter (Easy)](http://usaco.org/index.php?page=viewproblem2&cpid=895)
 - [Switching on the Lights (Normal)](http://www.usaco.org/index.php?page=viewproblem2&cpid=570)
 - [Build Gates (Normal)](http://www.usaco.org/index.php?page=viewproblem2&cpid=596)
 - [Milk Pails (Normal)](http://usaco.org/index.php?page=viewproblem2&cpid=620)
 - [Where's Bessie?](http://usaco.org/index.php?page=viewproblem2&cpid=740)
 - [Why Did the Cow Cross the Road III, Silver (Normal)](http://usaco.org/index.php?page=viewproblem2&cpid=716)
 - [Multiplayer Moo (Hard)](http://usaco.org/index.php?page=viewproblem2&cpid=836)
 - [Snow Boots (Hard)](http://usaco.org/index.php?page=viewproblem2&cpid=811)
 - [Mooyo Mooyo](http://usaco.org/index.php?page=viewproblem2&cpid=860)