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:Output a shortest sorted sequence of moves (numbers),请问这题是求长度最短还是字典序最小的序列?

Posted by ymfoi at 2009-08-20 09:01:09 on Problem 1166
In Reply To:Output a shortest sorted sequence of moves (numbers),请问这题是求长度最短还是字典序最小的序列? Posted by:majia9 at 2009-08-08 11:35:05
> Output a shortest sorted sequence of moves (numbers)
> 请问这题是求长度最短还是字典序最小的序列?
> 
> 3 2 3 
> 1 0 2 
> 3 2 3
> 我以为是求长度最短的,
> 但这组数据,答案是1 1 1 2 2 2 3 3 4 4 4 5 5 7 7 7 8 8 8 9 9
> 我算出了更短的1 2 2 2 4 4 4 7 8 8 8
> 
> 题意到底是什么呀?

先满足长度。。再满足字典序
BFS肯定能找出最短。
至于字典序取决于扩展结点的顺序
有可能你的步驟有误

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