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 freeacmer2 at 2008-08-01 17:11:29 on Problem 1321 and last updated at 2008-08-07 21:25:01
这个是我的放車的函数
void putrook(int n,int k)//n是棋盘宽度,k是放車的个数
{
	if(k==0)
	{
		count++;
		return;
	}
	int i,j;
	for(i=1;i<=n;i++)
	{
		if(row[i]==false)continue;
		for(j=1;j<=n;j++)
		{
			if(col[j]==false||chessboard[i][j]==0)continue;
			row[i]=col[j]=false;
			putrook(n,k-1);
			row[i]=col[j]=true;
		}
	}
}

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