# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166904 | Lawliet | Dango Maker (JOI18_dango_maker) | C++17 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3010;
int n, m;
int ans;
char v[MAXN][MAXN];
int main()
{
scanf("%d %d",&n,&m);
for(int i = 1 ; i <= n ; i++)
for(int j = 1 ; j <= m ; j++)
scanf(" %c",&v[i][j]);
for(int i = 1 ; i <= n ; i++)
{
for(int j = 1 ; j <= m ; j++)
{
if( v[i][j] != 'R' ) continue;
if( i + 2 <= n && v[i + 1][j] == 'G' && v[i + 2][j] == 'W' ) ans++;
else if( j + 2 <= m && v[i][j + 1] == 'G' && v[i][j + 2] == 'W' ) ans++;
}
}
printf("%d\n",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |