请判断该代码中数组head的作用:#include bitsstdc++husing namespace std;typedef long long LL;const int maxn = 1e4+10;const int maxm = 5e5+10;const LL INF = 1LL31-1;int headmaxm vismaxn;LL dixmaxn;int n m s tot=0;str
在该代码中,数组head的作用是存储图的邻接表。head数组的每个元素head[i]表示顶点i的第一条边在edge数组中的下标,通过遍历head数组,可以得到顶点i的所有出边。
原文地址: https://www.cveoy.top/t/topic/iaaO 著作权归作者所有。请勿转载和采集!