# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1057620 | manhlinh1501 | Dango Maker (JOI18_dango_maker) | C++17 | 0 ms | 348 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;
using i64 = long long;
const int MAXN = 3e3 + 5;
int N, M;
char a[MAXN][MAXN];
signed main() {
#define TASK "code"
if (fopen(TASK ".inp", "r")) {
freopen(TASK ".inp", "r", stdin);
freopen(TASK ".out", "w", stdout);
}
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.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 i = 1; i <= N; i++) {
for(int j = 1; j <= M; j++) {
if(a[i][j] == 'R') {
if(a[i + 1][j] == 'G' and a[i + 2][j] == 'W') {
// cout << i << " " << j << "\n";
ans++;
}
else if(a[i][j + 1] == 'G' and a[i][j + 2] == 'W') {
// cout << i << " " << j << "\n";
ans++;
}
}
}
}
cout << ans;
return (0 ^ 0);
}
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... |