晚上补嘻嘻嘻跑步去了
#include<iostream>
#include<cstdio>
using namespace std;
struct Edge{
int w;
int to;
int next;
};
const int maxn = 100010;
const int maxm = 200010;
int top,n,m;
int head[100010];
struct Edge edge[maxm];
int t1,t2,t3;
inline void add(int u,int v,int w){
edge[top].to = v;
edge[top].w = w;
edge[top].next = head[u];
head[u] = cnt++;
}
int main(){
while(scanf("%d%d",&n,&m) != EOF){
top = 0;
memset(head,-1,sizeof(head));
for(int i = 0;i < m;i++){
scanf("%d%d%d",t1,t2,t3);
add(t1,t2,t3);
}
}
return 0;
}