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

Re:感觉没卡啊,O(n^3)加小优化1A。。。

Posted by HJWAJ at 2012-07-22 19:59:22 on Problem 3318
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:
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