80分过不去第四个测试点,求调
查看原帖
80分过不去第四个测试点,求调
1620984
Audentis楼主2024/12/18 12:49
#include<bits/stdc++.h>
using namespace std;
int main(){
unsigned long long a[30][30];
int n,m,x,y;cin>>n>>m>>x>>y;	
for(int i=0;i<=m;i++){
	for(int j=0;j<=n;j++){
		a[i][j]=1;		
	}
}
if(x>=2&&y>=1)a[y-1][x-2]=0;
if(x>=2)a[y+1][x-2]=0;
if(x>=1&&y>=2)a[y-2][x-1]=0;
if(y>=2)a[y-2][x+1]=0;
if(y>=1)a[y-1][x+2]=0;
a[y+1][x+2]=0;
a[y+2][x+1]=0;
if(x>=1)a[y+2][x-1]=0;
a[y][x]=0;
for(int i=1;i<=m;i++){
	a[i][0]=a[i-1][0];
	if(a[i+1][0]==0)i++;
}
for(int i=1;i<=n;i++){
	a[0][i]=a[0][i-1];
	if(a[0][i+1]==0)i++;
}
for(int i=1;i<=m;i++){
	for(int j=1;j<=n;j++){
		if(a[i][j]!=0){a[i][j]=a[i-1][j]+a[i][j-1];
		}
		}
}
/*
for(int i=0;i<=m;i++){
	for(int j=0;j<=n;j++){
printf("%-7lld",a[i][j]);		
	}
	cout<<"\n";
}*/
printf("%lld",a[m][n]);
return 0;
}
2024/12/18 12:49
加载中...