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

两种解法比较

Posted by bergkamp at 2010-02-19 15:48:16 on Problem 3233
解法一
Let B=   A I  
         0 I   

B^(k+1) =    A^k   I+A+...+A^k 
             0          I      

Accepted	2184K	250MS	G++

解法二
设f[n]=A^1+A^2+....A^n;
当n是偶数,f[n]=f[n/2]+f[n/2]*A^(n/2);
但n是奇数,f[n]=f[n-1]+A^(n);

Accepted	976K	1860MS	C++
G++可能会因递归深度问题导致栈溢出

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