제출 #1276524

#제출 시각아이디문제언어결과실행 시간메모리
1276524tm.khoa.tmDango Maker (JOI18_dango_maker)C++20
0 / 100
1 ms576 KiB
//I love ManchesterUnited
#include<bits/stdc++.h>
using namespace std;

#define love ManchesterUnited
#define int long long
#define pb push_back
#define FOR(i,a,b) for (int i=(a); i<=(b); i++)
#define FORD(i,b,a) for (int i=(b); i>=(a); i--)
#define REP(i, n) for(int i=0; i<(n); ++i)
#define RED(i, n) for(int i=(n)-1; i>=0; --i)
#define time() cerr << endl << "-------------Time:" << 1000.0 * clock() / CLOCKS_PER_SEC << "ms.";
#define ALL(a) (a).begin(),(a).end()
#define ii  pair<int,int>
#define iii pair<int,ii>
#define fi first
#define se second
#define endl '\n'
#define MASK(x) (1 << (x))
#define BIT(mask,i) ((mask >> i) & 1)
typedef long long ll;

template<class X, class Y>
    bool minimize(X &x, const Y &y) {
        if (x > y) {
            x = y;
            return true;
        } else return false;
    }
template<class X, class Y>
    bool maximize(X &x, const Y &y) {
        if (x < y) {
            x = y;
            return true;
        } else return false;
    }
template<class T>
    T Abs(const T &x) {
        return (x < 0 ? -x : x);
    }

//___________________________________________________________________________________________________________________________________________________________
// CODE:
const int N = 3005;
const int MOD = 1e9 + 7;
int n,m;
char a[N][N];

int32_t main()
{
//    freopen("test.inp","r",stdin);
//    freopen("test.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    FOR(i,1,n) FOR(j,1,m) cin >> a[i][j];

    vector <ii> vec;

    FOR(i,1,n) FOR(j,1,m) {
        if (a[i][j] == 'R') {
            if (a[i][j + 1] == 'G' && a[i][j + 2] == 'W') vec.pb({i,j});
            else if (a[i + 1][j] == 'G' && a[i + 2][j] == 'W') vec.pb({i,j});
        }
    }
//    for (ii x : vec) cout << x.fi << " " << x.se << endl;
    cout << vec.size();

}


#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...