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:判断任意N*M数码有解的结论

Posted by zgsxzdl at 2010-10-28 15:12:39 on Problem 2893
In Reply To:判断任意N*M数码有解的结论 Posted by:upwinder at 2010-09-07 11:06:30
> 首先将矩阵存入n*m的一维数组,求去掉0以后的逆序数。
> 1.左右移动一次不改变逆序数奇偶性,
> 2.上下移动一次时:
> (1) 如果列数为奇数,逆序数奇偶性不变
> (2) 如果列数为偶数,逆序数奇偶性改变一次,此时要统计始态和终态0的行数差的绝对值,若为偶数则始态和终态逆序数奇偶性相同,否则相反
reply:
感谢!!!原来就是按这个思路写的,WA。以为思路不对,看到你的结论后,check了一下,结果是有一个地方i,j写混了,囧!!!

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