| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
无限WA,偶然换了种形式,发现这TM数据有问题啊,这里面绝对存在类似(0,0)、(1,1)的边!for(i=1;i<=N;i++)
addedge(i+N,i,1);
for(i=1;i<=N;i++)
for(j=1;j<=N;j++)
if(MAP[i][j])
addedge(i,j+N,INF);
for(i=0;i<M;i++){
scanf(" (%d,%d)",&x,&y);
++x,++y;
//if(x==y)
// continue;
MAP[x][y]=MAP[y][x]=true;
}
图中注释的地方如果不加,绝对无限WA,这就是因为,一个点到自己有边,导致了拆点失败!尼玛题目中这句话“Follow m data pairs (u,v), u < v”是什么鬼!逗我呢,基本网络流算法都试过了,最后发现时数据有问题,无语了!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator