| ||||||||||
| 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 | |||||||||
Re:感觉没卡啊,O(n^3)加小优化1A。。。In Reply To:感觉没卡啊,O(n^3)加小优化1A。。。 Posted by:HJWAJ at 2012-07-22 19:58:35 > RT~
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(m1.a[i][j])//稀疏矩阵优化
for(k=0;k<n;k++)
ans.a[i][k]+=m1.a[i][j]*m2.a[j][k];
把所有0的忽视掉,能优多少是多少。。于是就过了
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator