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:最长不下降……

Posted by Snow_storm at 2009-12-08 22:44:14 on Problem 3670
In Reply To:Re:最长不下降…… Posted by:yuech at 2009-09-10 13:32:26
> 按照最长不下降子序列做的。。莫名奇妙的AC。。。但是不知道原理。。。哪位大牛给说一下。。
反过来想,题目是要找出改正的次数最少,反过来就是说需要找出n-max(不降or不升 子序列)
因为如果把这n-max(不降or不升 子序列)个逆序数都改成顺序数即可。
如样例1 3 2 1 1  只需把第一个1改成3 即可

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