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:不就是矩阵乘法么...为什么TLE...谁贡献一个大数据吧In Reply To:不就是矩阵乘法么...为什么TLE...谁贡献一个大数据吧 Posted by:Ikki at 2009-05-17 14:18:46 乘法的时候 if(mata[i][k]&&matb[k][j]) matc[i][j]+=mata[i][k]*mat[k][j]; 加了就可以过了 至于原因,是因为构造出来的矩阵中0很多,这样可以避免乘法次数过多 还有就是构造系数的时候需要使用O(n^2)来构造.. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator