제출 #1006343

#제출 시각아이디문제언어결과실행 시간메모리
1006343giorgi_pkhaladzeDango Maker (JOI18_dango_maker)C++14
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define pb push_back using namespace std; int n,m,k,i,j,ans,used[3005][3005]; char a[3005][3005]; int main() { cin>>n>>m; ans=0; for(i=0; i<n; i++)cin>>a[i]; for(i=0; i<n; i++){ for(j=0; j<m; j++){ if(a[i][j]!='R')continue; if(j<m-2){ if(!(used[i][j+1]+used[i][j+2]) && a[i][j+1]=='G' && a[i][j+2]=='W')ans++; } if(i<n-2){ if(a[i+1][j]=='G' && a[i+2][j]=='W'){ if(j>0 && j<m-1 && a[i+1][j-1]=='R' && a[i+1][j]=='G' && a[i+1][j+1]=='W')used[i+1][j]=1; else used[i+2][j]=1; ans++; } } } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...