怎么做到在devc++和洛谷测试上输出不一样的(相同代码)
查看原帖
怎么做到在devc++和洛谷测试上输出不一样的(相同代码)
1029452
hpealxel楼主2023/10/3 14:27

Wrong Answer.wrong answer On line 1 column 1, read 8, expected 1(洛谷给的)

8 6 0 4(第一个测试点输入)

1617(答案)

我的输出:1617

代码一毛一样求神犇救救蒻蒻


#include<bits/stdc++.h>
using namespace std;

int n,m,x,y,a[25][25],b[25][25]; 
int bx[10]={0,-2,-2,-1,1,2,2,1,-1},by[10]={0,-1,1,2,2,1,-1,-2,-2};
int main(){
	cin>>n>>m>>x>>y;
	a[0][0]=1;
	for(int i=0;i<9;i++){
		b[x+bx[i]][y+by[i]]=1;
	}
	for(int i=0;i<=n;i++){
		for(int j=0;j<=m;j++){
			if(i==0&&j==0)continue;
			a[i][j]=a[i-1][j]+a[i][j-1];
			if(b[i][j]==1){
				a[i][j]=0;
			}
		}
	}
	cout<<a[n][m];
	return 0;
}

2023/10/3 14:27
加载中...