Submission #733835

#TimeUsernameProblemLanguageResultExecution timeMemory
733835vjudge1Collecting Mushrooms (NOI18_collectmushrooms)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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