今天解了杭电OJ1241题,题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 题目的大体意思就是找出不同的油田数量并输出,注意相邻的油井都属于同一块油田(ps:它的相邻也包括左上,左下,右上,右下,开始读题目半天都没搞懂这个,囧死了)。这题可以用搜索来解决,这里我分别用了深搜和广搜AC了一遍:深搜代码:#include<iostream>using namespace std;int map[105][105],m,n;int fx[8]={-1,-1,-1,0,0,1,1,1},fy[8]={-1,1,0,1,-1,1,-1, Read More
posted @ 2013-05-26 22:29 paradise in hell Views(158) Comments(0) Diggs(0) Edit