제출 #166904

#제출 시각아이디문제언어결과실행 시간메모리
166904LawlietDango Maker (JOI18_dango_maker)C++17
0 / 100
2 ms376 KiB
#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); }

컴파일 시 표준 에러 (stderr) 메시지

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]);
       ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...