제출 #916518

#제출 시각아이디문제언어결과실행 시간메모리
916518vjudge1Dango Maker (JOI18_dango_maker)C++17
13 / 100
1 ms2408 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pob pop_back #define pf push_front #define pof pop_front #define pii pair<int, int> #define pll pair<ll, ll> #define ld long double #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define elif else if #define x first #define y second ll n, m, ans; char dango[3001][3001]; bool vis[3001][3001]; int main(){ cin >> n >> m; for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ cin >> dango[i][j]; } } for(int i=1; i<=n; i++){ for(int j=1; j<=m-2; j++){ if(vis[i][j])continue; if(vis[i][j+1])continue; if(vis[i][j+2])continue; if(dango[i][j]=='R' && dango[i][j+1]=='G' && dango[i][j+2]=='W'){ ans++; vis[i][j]=true; vis[i][j+1]=true; vis[i][j+2]=true; } } } for(int i=1; i<=m; i++){ for(int j=1; j<=n-2; j++){ if(vis[j][i])continue; if(vis[j+1][i])continue; if(vis[j+2][i])continue; if(dango[j][i]=='R' && dango[j+1][i]=='G' && dango[j+2][i]=='W'){ ans++; vis[j][i]=true; vis[j+1][i]=true; vis[j+2][i]=true; } } } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...