Submission #733835

# Submission time Handle Problem Language Result Execution time Memory
733835 2023-05-01T10:57:12 Z vjudge1 Collecting Mushrooms (NOI18_collectmushrooms) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;

char ch[500001][500001];
long d,k,p=0;
long long h[500001][500001];

void range(int a , int b){
	int i,j;
	for( i=a-d ; i<a+d ; i++){
		for(j=b-d ; j<b+d ; j++){
			if(ch[i][j] == 'M'){
				h[i][j]+=1;
			}
		}
	}
return;
}




int main(){
	long long r, c ,i,j;
	cin>>r>>c>>d>>k;
	for(i=1 ; i<=r ; i++){
		for(j=1 ; j<=c ; j++){
			cin>>ch[i][j];
		}
	}
	for(i=1 ; i<=r ; i++){
		for(j=1 ; j<=c ;j++){
			if(ch[i][j] == 'S'){
				range( i , j );
			}
		}
	}
	
	for(i=1 ; i<=r ; i++){
		for(j=1 ; j<=c ;j++){
			if(ch[i][j] == 'S'){
				range( i , j );
			}
		}
	}
	
	
	for(i=1 ; i<=r ; i++){
		for(j=1 ; j<=c ; j++){
			if(h[i][j] >= k){
				p++;
			}
		}
	}
	cout<<p;

return 0;
}

Compilation message

/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status