标题
A*算法
模板:
#include<bits/stdc++.h>
using namespace std;
//变量
struct node{
int st;//状态
double f;//状态对应估价函数值
node(int s){//构造函数
//计算估值函数
}
//重载运算符
friend bool operator <(node y,node x){
return x.f<y.f;//估值函数小的优先
}
};
void Astar(){
priority_queue<node> q;
//初始化及放入起点
while(!q.empty()){
//...BFS
}
}
int main(){
//输入
Astar();
//输出
return 0;
}

