P1002 过河卒

所谓年轻,就是意识不到自己的年轻

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
unsigned long long n,m;
unsigned long long x,y;
unsigned long long dp[30][30];
unsigned long long Miku[30][30];
signed main(){
	cin>>x>>y>>n>>m;
	x+=2;
	y+=2;
	n+=2;
	m+=2;
	Miku[n][m]=1;
	Miku[n-2][m+1]=1;
	Miku[n-2][m-1]=1;
	Miku[n+2][m+1]=1;
	Miku[n+2][m-1]=1;
	Miku[n+1][m+2]=1;
	Miku[n+1][m-2]=1;
	Miku[n-1][m-2]=1;
	Miku[n-1][m+2]=1;
	dp[2][2]=1;
	for(unsigned long long i=2;i<=x;++i){
		for(unsigned long long j=2;j<=y;++j){
			if(Miku[i][j])
			continue;
			dp[i][j]=max(dp[i][j],dp[i-1][j]+dp[i][j-1]);
		}
	}
	cout<<dp[x][y];
	return 0;
}
posted @ 2020-10-17 20:54  Simex  阅读(80)  评论(0编辑  收藏  举报