제출 #1006334

#제출 시각아이디문제언어결과실행 시간메모리
1006334giorgi_pkhaladzeDango Maker (JOI18_dango_maker)C++14
0 / 100
1 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=1; i<=n; i++) for(j=1; j<=m; j++)cin>>a[i][j]; for(i=1; i<=n; i++){ for(j=1; j<=m; j++){ if(a[i][j]!='R')continue; if(j<=m-2){ if(used[i][j+1]==0 && used[i][j+2]==0 && 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>1 && j<n && 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...