답안 #166904

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166904 2019-12-04T14:01:18 Z Lawliet Dango Maker (JOI18_dango_maker) C++17
0 / 100
2 ms 376 KB
#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

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:14:8: 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:18:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf(" %c",&v[i][j]);
       ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Halted 0 ms 0 KB -