80分!!!求求大佬帮助!!!
查看原帖
80分!!!求求大佬帮助!!!
838434
hlwxhjq楼主2023/2/24 22:08

就差测试点4和5!!!!求求了!!!


#include<iostream>
#include<cstdio>
using namespace std;
int main() {
	int a,b,c,zh=0;
	cin>>a>>b>>c;
	bool sf[a+1000][b+1000]={false};
	char dx[a+2][b+2];
	for(int x=1; x<=a; x++){
		for(int y=1; y<=b; y++){
			cin>>dx[x][y];
			if(dx[x][y]=='.')
				sf[x][y]=true;
		}
	}
	for(int x=1; x<=a; x++){
		for(int y=1; y<=b; y++){
			int hg=0,sg=0;
			while(sf[x][y+hg]==true&&hg<=c) hg++;
			if(hg>=c) zh++;
			while(sf[x+sg][y]==true&&sg<=c) sg++;
			if(sg>=c) zh++;
		}
	}
	cout<<zh;
	return 0;
}
2023/2/24 22:08
加载中...