제출 #1121216

#제출 시각아이디문제언어결과실행 시간메모리
1121216staszic_ojuzDango Maker (JOI18_dango_maker)C++17
13 / 100
1 ms400 KiB
#include <iostream> #include <unordered_map> #include <cmath> #include <string> #include <vector> #include <algorithm> #include <locale> #include <bitset> #include <climits> typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n, m; cin >> n >> m; vector<vector<bool>> vis(n, vector<bool>(m, false)); vector<vector<char>> board(n, vector<char>(m, 'A')); for(int x = 0; x < n; x++){ for(int y = 0; y < m; y++) { cin >> board[x][y]; } } ll il = 0; for(int x = 0; x < n; x++){ for(int y = 0; y < m; y++) { if(!vis[x][y]) { if(board[x][y] == 'G') { if(x > 0 && x < n - 1 && !vis[x - 1][y] && !vis[x + 1][y]) { if(board[x - 1][y] == 'R' && board[x + 1][y] == 'W') { vis[x][y] = true; vis[x - 1][y] = true; vis[x + 1][y] = true; il++; } } else if(y > 0 && y < m - 1 && !vis[x][y - 1] && !vis[x][y + 1]) { if(board[x][y - 1] == 'R' && board[x][y + 1] == 'W') { vis[x][y] = true; vis[x][y - 1] = true; vis[x][y + 1] = true; il++; } } } } } } cout << il << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...