Submission #1115737

#TimeUsernameProblemLanguageResultExecution timeMemory
1115737staszic_ojuzDango Maker (JOI18_dango_maker)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; char dum[3007][3007]; int main() { int n, m; cin >> n >> m; for(int i = 1; i <= n; ++i) { string s; cin >> s; for(int j = 1; j <= m; ++j) dum[i][j] = s[j]; } int odp = 0; for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) { if(dum[i][j] == 'R' && dum[i][j+1] == 'G' && dum[i][j+2] == 'W') { if(dum[i-1][j+1] == 'R' && dum[i+1][j+1] == 'W') { ++odp; dum[i-1][j+1] = '.'; dum[i][j+1] = '.'; dum[i][j+2] = '.'; } else { ++odp; dum[i][j] = '.'; dum[i][j+1] = '.'; dum[i][j+2] = '.'; } } if(dum[i-1][j] == 'R' && dum[i][j] == 'G' && dum[i+1][j] == 'W') { ++odp; dum[i-1][j] = '.'; dum[i][j] = '.'; dum[i+1][j] = '.'; } } cout << odp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...