要加当前弧优化.
/* I will wait for you */
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#include<fstream>
#include<vector>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<string>
#define make make_pair
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
const int maxn=100010;
const int maxm=1010;
const int maxs=26;
const int INF=1<<29;
const int P=1000000007;
const double error=1e-9;
struct edge{ int v,a,next; }e[30*maxn];
int s,t,n,m,cnt=0,ans=0,head[maxn],dis[maxn],cur[maxn],q[maxn];
void addedge(int u,int v,int a)
{
e[cnt]=(edge){v,a,head[u]},head[u]=cnt++;
e[cnt]=(edge){u,0,head[v]},head[v]=cnt+