#include
#include
#include
#include
#include
#include
#define MAXN 100010
#define INF (1LL<<62)
using namespace std;
typedef long long ll;
typedef pair<int, ll> P;
int N, M, S, T, K;
ll dist[MAXN];
ll tdist[MAXN];
int cnt[MAXN];
bool f[MAXN];
vector Adj[MAXN];
vector
Rev[MAXN];
struct Edge {
int to;
ll len;
Edge(){}
Edge(int t, ll l):to(t), len(l){}
};
priority_queue q;
bool operator<(const Edge &a, const Edge &b) {
return (a.len + dist[a.to]) > (b.len + dist[b.to]);
}
void dijkstra() {
memset(dist, 0, sizeof(dist));
fill(tdist, tdist+MAXN, INF);
tdist[T] = 0;
while(!q.empty()) q.pop();
q.push(Edge(T, 0));
while (!q.empty()) {
int x = q.top().to;
ll d = q.top().len;
q.pop();
if (tdist[x] continue