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 |
这题方法好多啊。完全水过。O(n*m)也跑了282ms。开始没注意要用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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator