0分蒟蒻求助!
查看原帖
0分蒟蒻求助!
701317
Luodian_Chen楼主2022/7/10 14:25
#include <iostream>
#include <cstdlib>
using namespace std;
#define N 30
long long  dp[N][N]={1},n,m,x,y;
int main()
{
	cin>>n>>m>>x>>y;
	for(int i=0;i<=n;i++)
		for(int j=0;j<=m;j++)
			if(!((i==x&&j==y)||((i==x-2||i==x+2)&&(j==y-1||j==y+1))||((i==x-1||i==x+1)&&(j==y-2||j==y+2))))
				dp[i][j]+=dp[i-1][j]+dp[i][j-1];
	cout<<dp[n][m];
	return 0;
}
2022/7/10 14:25
加载中...