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

其实位运算可以做得更好的。。

Posted by hhb at 2009-04-25 16:20:41 on Problem 1321
In Reply To:用位运算判断这一列是否可以放 Posted by:chinaeli at 2008-10-04 20:19:15
for(int p=~(m|bk[n-1])&u;p;p^=p&(-p))
	dfs(n-1, m|p&(-p), k-1);
m为哪些列用过,bk[n-1]是当前行哪些位置不能放。u为(1<<n)-1。

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