제출 #967323

#제출 시각아이디문제언어결과실행 시간메모리
967323m0vlanDango Maker (JOI18_dango_maker)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; // author: Movlan #define ll long long //#define int long long #define br "\n" #define sp " " #define pb push_back #define pf push_front typedef pair<ll,int> pii; #define vi vector<int>; #define vpii vector<pair<int,int>> #define all(x) x.begin(),x.end() #define sync ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) struct edge{ //int u; int v; ll w;bool operator<(edge const& other){return w<other.w;} }; const int INF=1e9+7,MAXN=100007; void solve(){ int n,m; cin>>n>>m; string arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } int res=0; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(j<m-1 &&(arr[i][j]=='R' && arr[i][j+1]=='G' && arr[i][j+2]=='W')){ res++; arr[i][j]='A'; arr[i][j+1]='A'; arr[i][j+2]='A'; } if(i<n-1 &&(arr[i][j]=='R' && arr[i+1][j]=='G' && arr[i+2][j]=='W')){ res++; arr[i][j]='A'; arr[i+1][j]='A'; arr[i+2][j]='A'; } } } cout<<res; } signed main(){ sync; int t=1; //cin>>t; while(t--){ solve(); } } /** Get up and work hard. There are only a few days left until the final round. You need to win a medal for everything: for the days you cried, for the days you couldn't afford to attend an event, for the days when the one you loved the most left you, and for the days when you were at your lowest point with no friends. Show them what a "cheater" can achieve. Show them what a true ghost can do. You've done this many times before. One more time, and you're good to go. O N L Y T H E D E A D S E E **/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...