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 |
其实位运算可以做得更好的。。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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator