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

判断任意N*M数码有解的结论

Posted by upwinder at 2010-09-07 11:06:30 on Problem 2893 and last updated at 2010-09-07 11:10:29
首先将矩阵存入n*m的一维数组,求去掉0以后的逆序数。
1.左右移动一次不改变逆序数奇偶性,
2.上下移动一次时:
(1) 如果列数为奇数,逆序数奇偶性不变
(2) 如果列数为偶数,逆序数奇偶性改变一次,此时要统计始态和终态0的行数差的绝对值,若为偶数则始态和终态逆序数奇偶性相同,否则相反

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