题目大意:求点1到其他点最短距离全部相加,然后在求第n号点到其他点最短距离全部相加
题目思路:先正向建图,然后反向建图,求两次1号点到其他点的最短距离,注意输入用scanf就不会超时
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
using namespace std;
typedef long long ll;
const int N = 1e6+10;
const int INF = 0x3f3f3f3f;
int n,m;
int h[N],ne[N],w[N],idx=0,e[N];
int dist[N];
int rd[N];
int a1[N],b1[N],c1[N];
bool st[N];
typedef pair<int,int>PII