Submission #1289564

#TimeUsernameProblemLanguageResultExecution timeMemory
1289564ayemanDango Maker (JOI18_dango_maker)C++20
13 / 100
1 ms584 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<vector<char>> d(n, vector<char>(m)); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> d[i][j]; vector<vector<bool>> b(n, vector<bool>(m, false)); int cnt = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (d[i][j] == 'R') { if (j + 2 < m && d[i][j + 1] == 'G' && d[i][j + 2] == 'W') { if (!b[i][j] && !b[i][j + 1] && !b[i][j + 2]) { cnt++; b[i][j] = b[i][j + 1] = b[i][j + 2] = true; } } if (i + 2 < n && d[i + 1][j] == 'G' && d[i + 2][j] == 'W') { if (!b[i][j] && !b[i + 1][j] && !b[i + 2][j]) { cnt++; b[i][j] = b[i + 1][j] = b[i + 2][j] = true; } } } } } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...