Language: C++

#include <bits/stdc++.h>

#define rep(i, N) for (ll i = 0; i < N; i++)
#define repr(i, N) for (ll i = N-1; i >= 0; i--)

using namespace std;

typedef vector<int> vi;

int main() {
    int ans = 0;
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i, H) cin >> S[i];
    vector<vi> chm(H,vi(W,0));
    vector<vi> cha(H,vi(W,0));

    //(W方向の)障害物に当たらない長さを求める
    rep(i, H) {
        rep(j, W) {
            if(S[i][j] == '.') {
                chm[i][j]++;
                if(j > 0) chm[i][j] += chm[i][j-1];
            }
        }
        repr(j, W-1) {
            if(chm[i][j] > 0) chm[i][j] = max(chm[i][j], chm[i][j+1]);
        }
    }

    //(H方向の)障害物に当たらない長さを求める
    rep(j, W) {
        rep(i, H) {
            if(S[i][j] == '.') {
                cha[i][j]++;
                if(i > 0) cha[i][j] += cha[i-1][j];
            }
        }
        repr(i, H-1) {
            if(cha[i][j] > 0) cha[i][j] = max(cha[i][j], cha[i+1][j]);
        }
    }

    //W方向とH方向の障害物に当たらない長さを足す
    rep(i, H) {
        rep(j, W) {
            cha[i][j] += chm[i][j] - 1;
        }
    }

    //一番長いのが答え
    rep(i, H) {
        rep(j, W) {
            ans = max(ans, cha[i][j]);
        }
    }

    cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                        ^~
a.cc:15:5: note: in expansion of macro 'rep'
   15 |     rep(i, H) cin >> S[i];
      |     ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     rep(i, H) cin >> S[i];
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                        ^~
a.cc:20:5: note: in expansion of macro 'rep'
   20 |     rep(i, H) {
      |     ^~~
a.cc:20:9: error: 'i' was not declared in this scope
   20 |     rep(i, H) {
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:21:13: error: expected ';' before 'j'
   21 |         rep(j, W) {
      |             ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                           ^
a.cc:21:13: error: 'j' was not declared in this scope
   21 |         rep(j, W) {
      |             ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:27:14: error: expected ';' before 'j'
   27 |         repr(j, W-1) {
      |              ^
a.cc:4:28: note: in definition of macro 'repr'
    4 | #define repr(i, N) for (ll i = N-1; i >= 0; i--)
      |                            ^
a.cc:27:14: error: 'j' was not declared in this scope
   27 |         repr(j, W-1) {
      |              ^
a.cc:4:37: note: in definition of macro 'repr'
    4 | #define repr(i, N) for (ll i = N-1; i >= 0; i--)
      |                                     ^
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                        ^~
a.cc:33:5: note: in expansion of macro 'rep'
   33 |     rep(j, W) {
      |     ^~~
a.cc:33:9: error: 'j' was not declared in this scope
   33 |     rep(j, W) {
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:34:13: error: expected ';' before 'i'
   34 |         rep(i, H) {
      |             ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                           ^
a.cc:34:13: error: 'i' was not declared in this scope
   34 |         rep(i, H) {
      |             ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:40:14: error: expected ';' before 'i'
   40 |         repr(i, H-1) {
      |              ^
a.cc:4:28: note: in definition of macro 'repr'
    4 | #define repr(i, N) for (ll i = N-1; i >= 0; i--)
      |                            ^
a.cc:40:14: error: 'i' was not declared in this scope
   40 |         repr(i, H-1) {
      |              ^
a.cc:4:37: note: in definition of macro 'repr'
    4 | #define repr(i, N) for (ll i = N-1; i >= 0; i--)
      |                                     ^
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                        ^~
a.cc:46:5: note: in expansion of macro 'rep'
   46 |     rep(i, H) {
      |     ^~~
a.cc:46:9: error: 'i' was not declared in this scope
   46 |     rep(i, H) {
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:47:13: error: expected ';' before 'j'
   47 |         rep(j, W) {
      |             ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                           ^
a.cc:47:13: error: 'j' was not declared in this scope
   47 |         rep(j, W) {
      |             ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                        ^~
a.cc:53:5: note: in expansion of macro 'rep'
   53 |     rep(i, H) {
      |     ^~~
a.cc:53:9: error: 'i' was not declared in this scope
   53 |     rep(i, H) {
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^
a.cc:54:13: error: expected ';' before 'j'
   54 |         rep(j, W) {
      |             ^
a.cc:3:27: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                           ^
a.cc:54:13: error: 'j' was not declared in this scope
   54 |         rep(j, W) {
      |             ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i, N) for (ll i = 0; i < N; i++)
      |                                  ^