Submission #1289589

#TimeUsernameProblemLanguageResultExecution timeMemory
1289589ctfoxDango Maker (JOI18_dango_maker)C++17
0 / 100
1 ms576 KiB
#include <bits/stdc++.h>

typedef enum{
    RED,
    GREEN,
    WHITE
} colors;

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    int n, m;
    std::cin >> n >> m;
    
    colors r[n][m];
    
    std::string k;
    
    for(int i = 0; i < n; i++){
        std::cin >> k;
        for(int y = 0; y < m; y++){
            switch(k[y]){
                case 'R':
                    r[i][y] = RED;
                    break;
                case 'G':
                    r[i][y] = GREEN;
                    break;
                case 'W':
                    r[i][y] = WHITE;
                    break;
            } 
            
        }
        k.clear();
    }
    
    int count = 0;
    
    for(int h = 0; h < m; h++){
        for(int o = 0; o < n; o++){
            if(r[o][h] == RED && o + 2 < n && r[o + 1][h] == GREEN && r[o + 2][h] == WHITE) count++;
        }
    }

    for(int h = 0; h < n; h++){
        for(int o = 0; o < m; o++){
            if(r[h][o] == RED && o + 2 < m && r[h][o + 1] == GREEN && r[h][o + 2] == WHITE) count++;
        }
    }
    
    std::cout << count << '\n';

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...