제출 #410742

#제출 시각아이디문제언어결과실행 시간메모리
410742ngpin04Dango Maker (JOI18_dango_maker)C++14
13 / 100
1 ms332 KiB
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; const int N = 3e3 + 5; char a[N][N]; int n,m; bool vis[N][N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> a[i][j]; int ans = 0; for (int d = 1; d <= max(n, m); d++) { if (d <= m) { for (int i = 1; i <= n; i++) { if (!(vis[i][d] | vis[i + 1][d] | vis[i + 2][d]) && a[i][d] == 'R' && a[i + 1][d] == 'G' && a[i + 2][d] == 'W') { ans++; vis[i][d] = vis[i + 1][d] = vis[i + 2][d] = true; } } } if (d <= n) { for (int j = 1; j <= m; j++) { if (!(vis[d][j] | vis[d][j + 1] | vis[d][j + 2]) && a[d][j] == 'R' && a[d][j + 1] == 'G' && a[d][j + 2] == 'W') { ans++; vis[d][j] = vis[d][j + 1] = vis[d][j + 2] = true; } } } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...