12345678910#include<cstdio>const int MAXn = 1e4;const int MAXm = 1e4 * 2;//无向图MAXM应开边数二倍int head[MAXn + 10], cntnex, nex[MAXm * 2 + 10], to[MAXm * 2 + 10];void Insert(int u, int v) { nex[++cntnex] = head[u]; head[u] = cntnex; to[cntnex] = v;}