首页 > TAG信息列表 > EdgeCnt

[APIO 2013] 道路费用(暴力 + 最小生成树 + 优化)| 错题本

文章目录 题目分析代码 题目 [APIO 2013] 道路费用 分析 首先考虑暴力: 2 K 2^K 2K 枚举哪些边在最终的最小生成树里面,把和这些边冲突

P1144 最短路计数

  题目地址 注意点: 本题需要开双向边. #include<cstdio> #include<iostream> #include<queue> #include<cstring> #define int long long using namespace std; const int MAXN=2e6,MAXM=4e6,INF=2e9,MOD=100003; struct Edge{ int from,to,w,nxt; }e[MAXM];

T103440 【模板】缩点

题目地址 #include<cstdio>#include<iostream>using namespace std;const int MAXN=1e5,MAXM=1e6;struct Edge{ int from,to,nxt;}e[MAXM];int head[MAXN],edgeCnt=1;void addEdge(int u,int v){ e[++edgeCnt].from=u; e[edgeCnt].to=v; e[edgeCnt].nxt=head[u]; he