| ||||||||||
| 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 | |||||||||
超时 请大虾指点这个是我的放車的函数
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator