板子(2) 链式前向星 blm_xxc · 2025-08-09 19:21:22 · 个人记录 链式前向星板子(感谢jca大佬) int cnt, head[N]; struct edge { int v, nxt, w; } e[M]; inline void add(int u, int v, int w) { e[++cnt] = {v, head[u], w}; head[u] = cnt; }