noipt1过前两个样例但是洛谷提交全wa还有救吗(悲
  • 板块灌水区
  • 楼主czz2008
  • 当前回复2
  • 已保存回复2
  • 发布时间2022/11/26 19:19
  • 上次更新2023/10/27 01:22:27
查看原帖
noipt1过前两个样例但是洛谷提交全wa还有救吗(悲
808220
czz2008楼主2022/11/26 19:19

rt

贴个代码,本人第一次参加NOIP,写的很烂(

#include<bits/stdc++.h>
using namespace std;
int t,id,n,m,c,f,a[1001][1001],i,j;
int p,p1,x1,y2,p0=0;
string b;
void zx1(int,int);
void hx1(int,int);
void hx2(int,int);
void zx(int,int);
int main(){
freopen("plant.in","r",stdin);
freopen("plant.out","w",stdout);
cin>>t>>id;
for(int o=1;o<=t;o++){
cin>>n>>m>>c>>f;	
for(i=1;i<=n;i++){
	cin>>b;
	for(j=1;j<=m;j++){
		a[i][j]=b[p0]-48;
		p0++;
	}	
	p0=0;
}
for(i=1;i<=n-2;i++){
	for(j=1;j<=m-1;j++){
		if(a[i][j]!=1){
			zx(i,j);
		}
	}
}
cout<<p%998244353*c<<" "<<p1%998244353*f<<endl;}
fclose(stdin);fclose(stdout);
return 0;
}
void hx1(int x,int y){
	if(a[x][y]==1||y>m){
		return ;
	}
	else{
		p++;
		zx1(x1+1,m);
		hx1(x,y+1);
	}
}
void hx2(int x,int y){
	if(a[x][y]==1||y>m){
		return ;
	}
	else{
		y2=y;
		hx1(i,j+1);
		hx2(x,y+1);
	}
}
void zx(int x,int y){
	if(a[x][y]==1||x>n){
		return ;
	}
	else if(x>=i+2){
		x1=x;
		hx2(x,y+1);
		zx(x+1,y);
	}
	else zx(x+1,y);
} 
void zx1(int x,int y){
	if(a[x][y]==1||x>n){
		return ;
	}
	else{
		p1++;
		zx1(x+1,y);
	}
}

我是**,如果可以的话可以帮忙看看哪里的问题吗(

2022/11/26 19:19
加载中...