摘要:
最优比率生成树。CODE:#include<cstdio>#include<cstring>#include<cstdlib>#include<iostream>#include<cmath>usingnamespacestd;#defineeps1e-4constintINF=0x3f3f3f3f;constintMAXN=1010;doublew[MAXN][MAXN],d[MAXN];doubledis[MAXN][MAXN],cost[MAXN][MAXN];intn,m;structnode{doublex,y,z;}a[M 阅读全文
摘要:
SPFA+0/1分数规划。CODE:#include<iostream>#include<cstdlib>#include<cstdio>#include<cstring>#include<queue>usingnamespacestd;#defineMAXN1010#defineINF0X3F3F3F3F#defineeps1e-7structEdge{intv,next;doublew;}edge[MAXN*5];doubled[MAXN],num[MAXN];intfirst[MAXN];intn,m,cnt;voidinit( 阅读全文