定义


邻接表

为每个节点维护一个列表,列表中存储以该点为起点的边。

模版


int N;
struct edge
{
	int to, w; // 终点和边权
};
vector<edge> p[N];