Submission #1050011

#TimeUsernameProblemLanguageResultExecution timeMemory
1050011vjudge1Dango Maker (JOI18_dango_maker)C++17
0 / 100
0 ms348 KiB
#include <iostream> #include <vector> #include <string> using namespace std; int countDangoSticks(const vector<string>& grid) { int rows = grid.size(); int cols = grid[0].size(); int count = 0; for (int i = 0; i < rows; ++i) { for (int j = 0; j < cols - 2; ++j) { if (grid[i][j] == 'R' && grid[i][j + 1] == 'G' && grid[i][j + 2] == 'W') { count++; } } } for (int i = 0; i < rows - 2; ++i) { for (int j = 0; j < cols; ++j) { if (grid[i][j] == 'R' && grid[i + 1][j] == 'G' && grid[i + 2][j] == 'W') { count++; } } } return count; } int main() { int n,m; cin>>n>>m; vector<string> grid(n); for(int i = 0;i<n;i++){ cin>>grid[i]; } int result = countDangoSticks(grid); cout << result << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...