UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#211956#3815. 种树sesame02ms1252kbC++11593b2024-10-13 09:08:412024-10-13 12:53:12

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,k,ans,f,mp[20][20];
bool check(int x,int y){
	if(mp[x-1][y]||mp[x][y-1])return false;
	return true;
}
void work(int x,int y,int k1){
//	cout<<x<<' '<<y<<' '<<k1<<endl;
	if(k1==0){
		ans++;
		return;
	}
	if((f&&x==0&&y==0)||x>=n&&y>=m)return;
	f=1;
	if(check(x,y)){
		mp[x][y]++;
		work((x+(y+1)/m)%n,(y+1)%m,k1-1);
		mp[x][y]--;
	}
	work((x+(y+1)/m)%n,(y+1)%m,k1);
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n>>m>>k;
	work(0,0,k);
	cout<<ans;
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 1244kb

input:

2 2 1

output:

3

result:

wrong answer 1st numbers differ - expected: '4', found: '3'

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 1244kb

input:

2 3 2

output:

3

result:

wrong answer 1st numbers differ - expected: '8', found: '3'

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

4 4 2

output:

60

result:

wrong answer 1st numbers differ - expected: '96', found: '60'

Test #4:

score: 0
Wrong Answer
time: 1ms
memory: 1248kb

input:

4 4 5

output:

61

result:

wrong answer 1st numbers differ - expected: '304', found: '61'

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 1248kb

input:

3 4 3

output:

26

result:

wrong answer 1st numbers differ - expected: '84', found: '26'

Test #6:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

3 5 2

output:

51

result:

wrong answer 1st numbers differ - expected: '83', found: '51'

Test #7:

score: 0
Wrong Answer
time: 0ms
memory: 1248kb

input:

3 5 3

output:

97

result:

wrong answer 1st numbers differ - expected: '215', found: '97'

Test #8:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

3 5 4

output:

89

result:

wrong answer 1st numbers differ - expected: '276', found: '89'

Test #9:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

3 5 5

output:

39

result:

wrong answer 1st numbers differ - expected: '174', found: '39'

Test #10:

score: 0
Wrong Answer
time: 0ms
memory: 1248kb

input:

4 3 5

output:

6

result:

wrong answer 1st numbers differ - expected: '18', found: '6'