제출 #200254

#제출 시각아이디문제언어결과실행 시간메모리
200254mdn2002Dango Maker (JOI18_dango_maker)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int mod=1e9+7; int n,m,tk[3030][3030],ans; char a[3030][3030]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //freopen("dec.in","r",stdin); //freopen("dec.out","w",stdout); cin>>n>>m; for(int i=0; i<n; i++)cin>>a[i]; for(int i=0; i<n; i++) { for(int j=0; j<m; j++) { if(a[i][j]=='R'&&a[i+1][j]=='G'&&a[i+2][j]=='W'&&tk[i][j]+tk[i+1][j]+tk[i+2][j]==0) { if(a[i+1][j-1]=='R'&&a[i+1][j+1]=='W'&&a[i+2][j-2]=='R'&&a[i+2][j-1]=='G')num++; else { ans++; tk[i][j]++; tk[i+1][j]++; tk[i+2][j]++; } } if(a[i][j]=='R'&&a[i][j+1]=='G'&&a[i][j+2]=='W'&&tk[i][j]+tk[i][j+1]+tk[i][j+2]==0) { ans++; tk[i][j]++; tk[i][j+1]++; tk[i][j+2]++; } } } cout<<ans; }

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

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:21:91: error: 'num' was not declared in this scope
                 if(a[i+1][j-1]=='R'&&a[i+1][j+1]=='W'&&a[i+2][j-2]=='R'&&a[i+2][j-1]=='G')num++;
                                                                                           ^~~
dango_maker.cpp:21:91: note: suggested alternative: 'enum'
                 if(a[i+1][j-1]=='R'&&a[i+1][j+1]=='W'&&a[i+2][j-2]=='R'&&a[i+2][j-1]=='G')num++;
                                                                                           ^~~
                                                                                           enum