Submission #1115663

#TimeUsernameProblemLanguageResultExecution timeMemory
1115663staszic_ojuzDango Maker (JOI18_dango_maker)C++17
13 / 100
1 ms336 KiB
#include <iostream> #include <vector> using namespace std; int main() { int64_t n,m; cin >> n >> m; int64_t wyn=0; vector<string> v(n); for (int64_t i=0; i<n; i++) cin >> v[i]; for (int64_t i=0; i<n; i++){ for (int64_t j=0; j<m; j++){ //cout << i << ' ' << j << '\n'; if (v[i][j]=='R' and v[i][min(j+1,m-1)]=='G' and v[i][min(j+2,m-1)]=='W'){ if (v[i][min(j+1,m-1)]=='G' and v[max(i-1,int64_t(0))][min(j+1,m-1)]=='R' and v[min(i+1,n-1)][min(j+1,m-1)]=='W'){ v[i][j+1]=v[i][j+2]=v[i+1][j+1]='#'; wyn++; } else{ //cout << i << ' ' << j << '\n'; v[i][j]=v[i][j+1]=v[i][j+2]='#'; wyn++; } } else if (v[i][j]=='G' and v[max(i-1,int64_t(0))][j]=='R' and v[min(i+1,n-1)][j]=='W'){ //cout << i << ' ' << j << '\n'; v[i][j]=v[i-1][j]=v[i+1][j]='#'; wyn++; } } } cout << wyn; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...