https://www.luogu.com.cn/problem/P1644
#include<bits/stdc++.h>
using namespace std;
int m,n,s;
void t(int x,int y){
if(x+2<m&&y+1<n&&y>=0){
s++;
t(x+2,y+1);
}
if(x+1<m&&y+2<n&&y>=0){
s++;
t(x+1,y+2);
}
if(x+2<m&&y-1<n&&y>=0){
s++;
t(x+2,y-1);
}
if(x+1<m&&y-2<n&&y>=0){
s++;
t(x+1,y-2);
}
}
int main(){
cin>>m>>n;
t(0,0);
cout<<s<<endl;
return 0;
}
帮助必关(可能有延迟,因为去过年不在线)