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

做了将近一个小时 终于AC了

Posted by abilitytao at 2008-07-28 16:10:18 on Problem 3250
刚开始的时候还以为这道题很简单,但是不断的超时让我改变了这种看法;
由于n的最大值是80000所以O(n^2)的算法是行不通的,所以最好只用一遍扫描;
这道题给我们的启示是:我们应该善于保留前一次行为的有效信息,用到下一步的行为里,这样才能有效的节约时间,避免超时!

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