#include<iostream>
#include<cstring>
#include<cstdio>
#define inf 0x7fffffff
using namespace std;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
struct edge{
int to,next,v;
}e[500001];
int n,m,cnt=1,ans,T=8001,head[50001],h[50001],to[50001];
bool mark[50001];
void ins(int u,int v,int w){
e[++cnt]=(edge){v,head[u]......
阅读全文