#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
char arr[n][m];
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
cin >> arr[i][j];
}
}
int count = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < m-2; j++) {
if(arr[i][j] == 'R' && arr[i][j+1] == 'G' && arr[i][j+2] == 'W') {
count++;
}
}
}
for(int i = 0; i < n-2; i++) {
for(int j = 0; j < m; j++) {
if(arr[i][j] == 'R' && arr[i+1][j] == 'G' && arr[i+2][j] == 'W') {
count++;
}
}
}
cout << count << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |