Submission #946954

#TimeUsernameProblemLanguageResultExecution timeMemory
946954ezzzayDango Maker (JOI18_dango_maker)C++14
13 / 100
1 ms444 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define double long double const int N=3e3+5; char arr[N][N]; signed main(){ int n,m; cin>>n>>m; int cnt=0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>arr[i][j]; } } for(int i=1;i<=n;i++){ for(int j=1;j<=m-2;j++){ if(arr[i][j]=='R' and arr[i][j+1]=='G' and arr[i][j+2]=='W' ){ cnt++; arr[i][j]='X'; arr[i][j+1]='X'; arr[i][j+2]='X'; } } } for(int j=1;j<=m;j++){ for(int i=1;i<=n-2;i++){ if(arr[i][j]=='R' and arr[i+1][j]=='G' and arr[i+2][j]=='W' ){ cnt++; arr[i][j]='X'; arr[i+1][j]='X'; arr[i+2][j]='X'; } } } cout<<cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...