为啥运行不出来……
查看原帖
为啥运行不出来……
338786
mushroom_knight楼主2020/6/26 08:50

RT

#include<bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
bool vis[52][52];
int f[52][52];
void init(int x,int y){
	vis[x+2][y+1]=true;
	vis[x+2][y-1]=true;
	vis[x-2][y+1]=true;
	vis[x-2][y-1]=true;
	vis[x-1][y-2]=true;
	vis[x+1][y+2]=true;
	vis[x+1][y-2]=true;
	vis[x-1][y+2]=true;
	vis[x][y]=true;
}
void dp_(int n,int m){
	for(register int i=0;i<=n;++i){
		for(register int j=0;j<=m;++j){
			if(vis[i][j]!=true){
				f[i+1][j]+=f[i][j];
				f[i][j+1]+=f[i][j];
			}		
	   }
	}
}
int n,m;
int ui,uj;
int main(){
	scanf("%d%d%d%d",&n,&m,ui,&uj);
	init(ui,uj);
	f[0][0]=1;
	dp_(n,m);
	cout<<f[n][m];
	return 0;
}


2020/6/26 08:50
加载中...