Submission #1115733

#TimeUsernameProblemLanguageResultExecution timeMemory
1115733staszic_ojuzDango Maker (JOI18_dango_maker)C++17
0 / 100
1 ms592 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; char dum[n][m]; for(int i = 0; i < n; ++i) for(int j = 0; j < m; ++j) cin >> dum[i][j]; int odp = 0; for(int i = 0; i < n; ++i) for(int j = 0; 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...