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

这题方法好多啊。完全水过。O(n*m)也跑了282ms。

Posted by winsweet at 2008-08-26 11:49:15 on Problem 3067
开始没注意要用64位整型-,-

ans=0;
for (i=1;i<=n;i++) {
	tt=0;
	for (j=1;j<=m;j++) {
		if (mat[i][j]) {
			ans+=tt;
			t[j]--;//这里面存放的是西岸有多少点与东岸的J相连。
		}
		tt+=t[j];
	}
}

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