제출 #200259

#제출 시각아이디문제언어결과실행 시간메모리
200259mdn2002Dango Maker (JOI18_dango_maker)C++14
13 / 100
6 ms380 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(tk[i][j])continue; 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) { int num=0; if(a[i+1][j-1]=='R'&&a[i+1][j+1]=='W')num++; if(a[i+2][j-2]=='R'&&a[i+2][j-1]=='G')num++; if(num<=1) { 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...