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 fanhqme at 2009-08-24 12:48:27 on Problem 3744
对于dp的优化,一般有以下几个思路:
 重新再想一个dp
 线段树
 单调队列
 滚动数组
 用平衡树搞增量法
 矩阵乘法
 数学trick
 生成函数/特征方程推公式
 ......各种大牛的方法

对于这种可以用矩阵乘法过的题,本人一般懒的推公式了:)

初始矩阵:A=(0.0,1.0)
设下一个雷在x步以后,则将A乘以
[0 1-p]
[1 p  ]
的x次方(一定要用平方加速)。设最后得到了
A=(a,b)
输出a*(1-p)+b*p即可!

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