ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211928 | #3815. 种树 | twc | 10 | 3ms | 1196kb | C++11 | 420b | 2024-10-13 08:52:29 | 2024-10-13 12:51:21 |
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a[20][20],n,m,k,ans;
void dfs(int x,int y,int l,int u,int cnt){
if(x==n+1&&y==1){
if(cnt==k) ans++;
return;
}
y=y%m+1,x=x+(y==1);
dfs(x,y,a[x][y-1],a[x-1][y],cnt);
if(a[x][y-1]==0&&a[x-1][y]==0){
a[x][y]=1;
dfs(x,y,0,0,cnt+1);
}
}
signed main(){
cin>>n>>m>>k;
dfs(1,1,0,0,0);
cout<<ans;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
2 2 1
output:
4
result:
ok 1 number(s): "4"
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
2 3 2
output:
4
result:
wrong answer 1st numbers differ - expected: '8', found: '4'
Test #3:
score: 0
Wrong Answer
time: 1ms
memory: 1192kb
input:
4 4 2
output:
12
result:
wrong answer 1st numbers differ - expected: '96', found: '12'
Test #4:
score: 0
Wrong Answer
time: 2ms
memory: 1192kb
input:
4 4 5
output:
0
result:
wrong answer 1st numbers differ - expected: '304', found: '0'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
3 4 3
output:
0
result:
wrong answer 1st numbers differ - expected: '84', found: '0'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
3 5 2
output:
12
result:
wrong answer 1st numbers differ - expected: '83', found: '12'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
3 5 3
output:
0
result:
wrong answer 1st numbers differ - expected: '215', found: '0'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 1192kb
input:
3 5 4
output:
0
result:
wrong answer 1st numbers differ - expected: '276', found: '0'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 1196kb
input:
3 5 5
output:
0
result:
wrong answer 1st numbers differ - expected: '174', found: '0'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 1196kb
input:
4 3 5
output:
0
result:
wrong answer 1st numbers differ - expected: '18', found: '0'