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 |
Re:判断任意N*M数码有解的结论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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator