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 boys at 2006-07-23 11:24:00 on Problem 1088
In Reply To:你的做法是,先排序,然后按相邻关系找最长单调序列? Posted by:sunmoonstar_love at 2006-07-22 19:27:50
是的,就是先排序,再依次找从1.2....开头的最长单调序列,方法是:遍历排列判断排列中第-个与其在原距阵中邻相的元素,然后从这个元素开始重复前面的操作。。
并且在遍历我用了一个visted数组,只要某个元素包含于以其他元素开始的最长单调序列,那么以这个元素开始的最长单调序列就可以不计算了。。

方法应该没问题,希望帮忙找下缺陷。谢谢了

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