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:谁给帮帮忙,看看代码哪里错了。感激不尽In Reply To:Re:谁给帮帮忙,看看代码哪里错了。感激不尽 Posted by:xiaoyaowangchao at 2012-06-04 11:03:08 void dfs( int r, int counter ) { if ( r >= n ) return; /*if ( counter == k ) { res++; return; }*/ for ( int i = 0; i < n; i++ ) { if ( map[r][i] == '#' && col[i] == 0 ) { col[i]++; if (counter + 1 == k) { res++; } else dfs(r+1,counter+1); col[i]--; } } dfs(r+1,counter); } 函数终止条件写错了吧 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator