Submission #366247

#TimeUsernameProblemLanguageResultExecution timeMemory
366247Tuk1352Dango Maker (JOI18_dango_maker)C++11
0 / 100
1 ms372 KiB
/* RGW G W */ #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; char C[n+1][m+1]; int D[n+1][m+1], M=0; for (int i = 0; i <= n; i++) { for (int y = 0; y <= m; y++) { D[i][y] = 0; } } for (int i = 1; i <= n; i++) { for (int y = 1; y <= m; y++) { cin >> C[i][y]; } } for (int i = 1; i <= n; i++) { for (int y = 1; y <= m; y++) { D[i][y] = D[i-1][y] + D[i][y-1] - D[i-1][y-1]; int st=0; if (C[i][y] == 'R') { if (m-y >= 2 && C[i][y+1] == 'G' && C[i][y+2] == 'W') { st = 1; } if (m-i >= 2 && C[i+1][y] == 'G' && C[i+2][y] == 'W') { st = 1; } } D[i][y] += st; M = max(M, D[i][y]); } } cout << M; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...