信息学奥赛:1359:围成面积
题目链接
思路:
这题对测试数据范围没有要求,题目已经规定好了10*10,我就建立一个12*12的数组,数组边缘都初始化为0,然后bfs直接从数组左上角暴力搜索,遇0置1。bfs完后对整个数组搜索。
#include<iostream>
#include<queue>
using namespace std;
const int N = 12;
int map[N][N];
struct Point {
int x, y;
};
int dir[4][2] = {
{
1,0},{
-1,0},{
0,1},{
0,-1