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

蒟蒻请教(见内)

Posted by suncongbo at 2017-03-25 08:59:18 on Problem 1125
WA代码片段:
ans = INF;
pos = 1;
for(i=1; i<=n; i++)
{
	t = 0;
	for(j=1; j<=n; j++)
	{
		if(j == i)		continue;
		if(f[i][j] > t)	t = f[i][j];
	}
	if(t < ans)
	{
		ans = t;
		pos = i;
	}
}
if(ans == INF)	printf("disjoint\n");
else		printf("%d %d\n",pos,ans);

把上面pos = 1的语句改成pos = 0就AC了!
蒟蒻请教为什么。。
谢谢!

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