UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#211969#3815. 种树chenchenCompile Error//C++668b2024-10-13 09:25:162024-10-13 12:53:52

answer

#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;
typedef long long LL;

const int N = 17;

int n, m, k;
int a[N][N];
bool st[N][N];
LL ans;

void dfs(int u)
{
	if (u == k + 1)
	{
		ans ++ ;
		return ;
	}
	for (int i = 1; i <= n; i ++ )
	{
		for (int j = 1; j <= m; j ++ )
		{
			if (st[i][j] == 0 && st[i - 1][j] == 0 && st[i][j - 1] == 0 && st[i + 1][j] == 0 && st[i][j + 1] == 0)
			{
				st[i][j] = 1;
				dfs(u + 1);
				st[i][j] = 0;
			}
		}
	}
}

int main()
{
	scanf("%d%d%d", &n, &m, &k);
	dfs(1);
	for (int i = 1; i <= k; i ++ )
	{
		ans /= i;
	}
	printf("%d\n", ans);
	return 0;
}

详细

answer.code: In function 'int main()':
answer.code:38:28: error: 'scanf' was not declared in this scope
  scanf("%d%d%d", &n, &m, &k);\x0d
                            ^
answer.code:44:20: error: 'printf' was not declared in this scope
  printf("%d\n", ans);\x0d
                    ^