struct P{
int d; //深度g(n)
int w; //不在位数h(n)
int id; //记录该节点的id,用于输出时找到该节点
string s; //状态
friend bool operator <(const P &a,const P &b){//按f(n)=g(n)+h(n)大小排序
return a.d+a.w>b.d+b.w; //最大堆
}
}p;
const int N=3; //棋盘大小
//const string t="123456780"; //目标状态
const string t="123804765";
string stack[1000000]; //记录搜索中的节点
string record[1000000]; //从起点开始记录解路径
int father[10000000]; //记录该节点的父节点
int top=0; //stack的指针
priority_queue<P> pq; //open表
map<string,bool> mp;