#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105, MAXM = 1e5 + 5;
struct EDGE{
int next;//起始点
int to;//终止点
int dist;//边权
}edge[MAXM];//边集
int head[MAXN], num_edge, n, m, u, v, d;//head是干嘛的?
void add_edge(int from, int to, int dist){
edge[++num_edge].next = head[from];
edge[num_edge].to = to;
edge[num_edge].dist = dist;
//这三个是设置边的基本信息
head[from] = num_edge;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
while(m--){
cin >> u >> v >> d;
add_edge(u, v, d);
}
return 0;
}
head[MAXN] 是干啥的?本人啃信奥**通好久没看明白,求大佬指教!