
并查集
sepNINE
it is written
展开
-
poj 3228 Gold Transportation 并查集
题意: 有n和城市和m条路,每个城市都有产生金量和收集金量,现在要把所有黄金收集,求经过的最短边是多少。 分析: 二分+最大流或用并查集合并等价类。 //poj 3228 //sep9 #include #include using namespace std; const int maxN=256; const int maxM=10024; int p[maxN],sum[maxN原创 2015-04-02 11:06:28 · 1004 阅读 · 0 评论 -
poj 1127 Jack Straws 并查集+线段规范相交的判断
//poj 1127 //sep9 #include using namespace std; struct P { int x,y; }p[128]; int f[32]; int det(P a,P b,P c) { int x1=b.x-a.x; int y1=b.y-a.y; int x2=c.x-a.x; i原创 2015-12-04 11:30:58 · 459 阅读 · 0 评论