TAG 种子染色 flood fill 队列 数据结构
使用类似种子染色的方法,从起点开始染色,使用队列保证花费小的先染到。
//1.07 sec 1476 KB 2839 Bytes
#include <stdio.h>
#include <queue>
#include <memory.h>
using namespace std;
const int DY[]={0, 1, 0, -1};
const int DX[]={-1, 0, 1, 0};
struct point
{
int x,y;
bool operator==(const point &p) const
{
return x==p.x && y==p.y;
}
};
point start,end;
int row, col;
char map[500][501];
int order[500][500];
bool inR......
阅读全文