Sheba’s Amoebas

From programming_contest
Jump to navigation Jump to search

walk the graph. flood fill when you find a box and +1 to your count.

Be sure to use the easy flood fill implementation when iterating: for (i = -1;i<2;i++)for(j=-1;j<2;j++)if(i!=j&&i*j!=0&&<in_bounds>&&<visited>)