Search found 1 match
- Tue Aug 02, 2005 7:54 am
- Forum: Volume 7 (700-799)
- Topic: 785 - Grid Colouring
- Replies: 27
- Views: 18719
785
#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
char map[100][100];
int m,n;
void dfs(int x,int y,char c)
{
map[x][y] = c;
if(x-1 >=0 && map[x-1][y] !='X' && map[x-1][y] !=c)
dfs(x-1,y,c);
if(y-1>=0 && map[x][y-1] !='X' && map[x][y-1] !=c)
dfs(x,y-1,c);
if(x ...