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

Re:谁给帮帮忙,看看代码哪里错了。感激不尽

Posted by xiaoyaowangchao at 2012-06-04 11:03:52 on Problem 1321
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:
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