void dijskra(){
priority_queue <pair<double, ll>> q;
for(re ll i = 0; i <= n; i++) h[i] = 0x7fffffff;
h[n] = 0;
q.push(make_pair(-0, n));
while(!q.empty()){
ll d = q.top().first, u = q.top().second;
q.pop();
if(-d != h[u]) continue;
for(auto i : revedge[u])
if(h[i.to] > h[u] + i.w){
h[i.to] = h[u] + i.w;
q.push(make_pair(-h[i.to], i.to));
}
}
}
将其中的
if(-d != h[u]) continue;
删去后,获得了原始数据的100分
删前的提交记录
删后的提交记录
算法为A*