Oil Deposits
摘要:
hdu1241:http://acm.hdu.edu.cn/showproblem.php?pid=1241题意:就是找出有多少块有石油的区域,就是数组中的@,这边相邻指的是是周围的八个位置。题解: dfs,从一块油田的位子开始,朝着与他相邻的8个方向收索,遇到油田就把它变成不是油田,并往下继续。遍历一下,就知道有多少了 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 char map[102][102]; 7 int m,n; 8 void dfs(int i,int j){ 9 if(im|... 阅读全文
posted @ 2013-10-13 11:51 天依蓝 阅读(159) 评论(0) 推荐(0) 编辑