Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
当我没说,我现在头脑混乱,听dynamic老大的In Reply To:哦! 想到了, 起始状态到目标状态应该是一个偶置换, 因为每一步移动是一个偶置换! 所以只需要判断起始->目标这个置换的奇偶性就可以了,不用求逆序数 :> O(N)即可! Posted by:rruucc at 2003-11-13 19:48:37 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator