답안 #77946

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
77946 2018-10-01T10:20:28 Z aquablitz11 Dango Maker (JOI18_dango_maker) C++14
13 / 100
2 ms 784 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 3010;

char S[N][N];

int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i)
        scanf(" %s", S[i]);
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (S[i][j] == 'R' && S[i][j+1] == 'G' && S[i][j+2] == 'W') {
                ++cnt;
                S[i][j] = S[i][j+1] = S[i][j+2] = '\0';
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (S[i][j] == 'R' && S[i+1][j] == 'G' && S[i+2][j] == 'W') {
                ++cnt;
                S[i][j] = S[i+1][j] = S[i+2][j] = '\0';
            }
        }
    }
    printf("%d\n", cnt);

    return 0;
}

Compilation message

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
dango_maker.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %s", S[i]);
         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 528 KB Output is correct
4 Correct 2 ms 528 KB Output is correct
5 Correct 2 ms 540 KB Output is correct
6 Correct 2 ms 656 KB Output is correct
7 Correct 2 ms 688 KB Output is correct
8 Correct 2 ms 688 KB Output is correct
9 Correct 2 ms 688 KB Output is correct
10 Correct 2 ms 688 KB Output is correct
11 Correct 2 ms 688 KB Output is correct
12 Correct 2 ms 688 KB Output is correct
13 Correct 2 ms 688 KB Output is correct
14 Correct 2 ms 688 KB Output is correct
15 Correct 2 ms 708 KB Output is correct
16 Correct 2 ms 728 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 528 KB Output is correct
4 Correct 2 ms 528 KB Output is correct
5 Correct 2 ms 540 KB Output is correct
6 Correct 2 ms 656 KB Output is correct
7 Correct 2 ms 688 KB Output is correct
8 Correct 2 ms 688 KB Output is correct
9 Correct 2 ms 688 KB Output is correct
10 Correct 2 ms 688 KB Output is correct
11 Correct 2 ms 688 KB Output is correct
12 Correct 2 ms 688 KB Output is correct
13 Correct 2 ms 688 KB Output is correct
14 Correct 2 ms 688 KB Output is correct
15 Correct 2 ms 708 KB Output is correct
16 Correct 2 ms 728 KB Output is correct
17 Correct 2 ms 732 KB Output is correct
18 Correct 2 ms 736 KB Output is correct
19 Incorrect 2 ms 784 KB Output isn't correct
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 528 KB Output is correct
4 Correct 2 ms 528 KB Output is correct
5 Correct 2 ms 540 KB Output is correct
6 Correct 2 ms 656 KB Output is correct
7 Correct 2 ms 688 KB Output is correct
8 Correct 2 ms 688 KB Output is correct
9 Correct 2 ms 688 KB Output is correct
10 Correct 2 ms 688 KB Output is correct
11 Correct 2 ms 688 KB Output is correct
12 Correct 2 ms 688 KB Output is correct
13 Correct 2 ms 688 KB Output is correct
14 Correct 2 ms 688 KB Output is correct
15 Correct 2 ms 708 KB Output is correct
16 Correct 2 ms 728 KB Output is correct
17 Correct 2 ms 732 KB Output is correct
18 Correct 2 ms 736 KB Output is correct
19 Incorrect 2 ms 784 KB Output isn't correct
20 Halted 0 ms 0 KB -