Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

无限WA,偶然换了种形式,发现这TM数据有问题啊,这里面绝对存在类似(0,0)、(1,1)的边!

Posted by _Belove_Test at 2016-08-04 09:46:26 on Problem 1966
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator