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 bingshen at 2011-09-14 15:33:06 on Problem 1207
水的原因在于n太小了,只有1w,试想,如果n有100w,我们还能暴力吗?
其实更快速的方法是:通过记忆优化搜索预处理一个dp数组,里面存每一个n的数链长度。
然后题目要求求解某一个区间的最大值,所以这里就应该用RMQ或者线段树进行求解

所以不要单单为了水题而水题。应该多想想其他更加高级的方法。

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