Submission #1095572

#TimeUsernameProblemLanguageResultExecution timeMemory
1095572formidablechief27Dango Maker (JOI18_dango_maker)C++14
13 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; void solve() { int n, m; cin >> n >> m; vector<string> grid(n); for(int i=0;i<n;i++) cin >> grid[i]; int ans = 0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(j + 2 < m && grid[i][j] == 'R' && grid[i][j+1] == 'G' && grid[i][j+2] == 'W') { grid[i][j] = 'P'; grid[i][j+1] = 'P'; grid[i][j+2] = 'P'; ans++; } if(i + 2 < n && grid[i][j] == 'R' && grid[i+1][j] == 'G' && grid[i+2][j] == 'W') { grid[i][j] = 'P'; grid[i+1][j] = 'P'; grid[i+2][j] = 'P'; ans++; } } } cout << ans; } int main() { solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...