hdu-6705 path
题意:给你有向图,求第k短路的路径的长度(所有路径不限制使用次数)
思路:从多校群里搞到的。
#include <cstdio>
#include <queue>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iterator>
#include <vector>
#include <set>
#include <bitset>
#include <stack>
#define mems(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const int N=5e4+10;
struct node
{
ll to,len;
node() {}
node(ll a,ll b):to(a),len(b) {}
};
struct cmp
{
bool operator () (const node &x,const node &y) const
{
return x.len>y.len;
}
};
bool cmp1(node a,node b)
{
return a.len<b.len;
}
priority_queue<node,vector<node>,cmp> q0;
prio