2018-07-18 OI 【模板】前向星 建立: 123456789101112131415struct EDGE{ int next; int to; int weight;};EDGE graph[MAXM];int head[MAXN]={0},nume=-1;void adde(int f,int t,int w){ graph[++nume].next=head[f]; graph[nume].to=t; graph[nume].weight=w; head[f]=nume;}memset(head,-1,sizeof(head));//不能忘 遍历: 1234for(i=head[now];i!=-1;i=graph[i].next){ graph[i].weight... graph[i].to...} dinic中的反向弧操作:规定邻接表数组从0开始、两下标可以表示为(i,i^1) Neuer 【前缀和】k倍区间、前缀和相关 Älter 【模板】字符串hash