Language: Java

#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  rep(i, h) cin >> s[i];
  vector<vector<int>> a(h, vector<int>(w));

  for (int i = 0; i < h; i++) {
    int cur = 0;
    for (int j = 0; j < w; j++) {
      if (s[i][j] == '#') {
        cur = 0;
      } else {
        cur++;
      }
      a[i][j] = cur;
    }
  }
  vector<vector<int>> b(h, vector<int>(w));
  for (int i = 0; i < w; i++) {
    int cur = 0;
    for (int j = 0; j < h; j++) {
      if (s[j][i] == '#') {
        cur = 0;
      } else {
        cur++;
      }
      b[j][i] = cur;
    }
  }
  vector<vector<int>> c(h, vector<int>(w));
  for (int i = 0; i < h; i++) {
    int cur = 0;
    for (int j = w - 1; j >= 0; j--) {
      if (s[i][j] == '#') {
        cur = 0;
      } else {
        cur++;
      }
      c[i][j] = cur;
    }
  }
  vector<vector<int>> d(h, vector<int>(w));
  for (int i = 0; i < w; i++) {
    int cur = 0;
    for (int j = h - 1; j >= 0; j--) {
      if (s[j][i] == '#') {
        cur = 0;
      } else {
        cur++;
      }
      d[j][i] = cur;
    }
  }
  int res = 0;
  rep(i, h) {
    rep(j, w) {
      if (s[i][j] == '#') continue;

      res = max(res, a[i][j] + b[i][j] + c[i][j] + d[i][j] - 3);
    }
  }
  cout << res << endl;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: illegal character: '#'
#define SORT(a) sort((a).begin(), (a).end())
^
Main.java:3: error: class, interface, enum, or record expected
#define SORT(a) sort((a).begin(), (a).end())
        ^
Main.java:4: error: illegal character: '#'
#define RSORT(a) reverse((a).begin(), (a).end())
^
Main.java:5: error: illegal character: '#'
#define rep(i, n) for (int i = 0; i < n; i++)
^
Main.java:5: error: class, interface, enum, or record expected
#define rep(i, n) for (int i = 0; i < n; i++)
                                  ^
Main.java:5: error: class, interface, enum, or record expected
#define rep(i, n) for (int i = 0; i < n; i++)
                                         ^
Main.java:7: error: class, interface, enum, or record expected
const long long INF = 1LL << 60;
^
Main.java:11: error: not a statement
  cin >> h >> w;
           ^
Main.java:12: error: not a statement
  vector<string> s(h);
                   ^
Main.java:13: error: not a statement
  rep(i, h) cin >> s[i];
                ^
Main.java:14: error: not a statement
  vector<vector<int>> a(h, vector<int>(w));
                        ^
Main.java:14: error: not a statement
  vector<vector<int>> a(h, vector<int>(w));
                                 ^
Main.java:14: error: not a statement
  vector<vector<int>> a(h, vector<int>(w));
                                       ^
Main.java:27: error: not a statement
  vector<vector<int>> b(h, vector<int>(w));
                        ^
Main.java:27: error: not a statement
  vector<vector<int>> b(h, vector<int>(w));
                                 ^
Main.java:27: error: not a statement
  vector<vector<int>> b(h, vector<int>(w));
                                       ^
Main.java:39: error: not a statement
  vector<vector<int>> c(h, vector<int>(w));
                        ^
Main.java:39: error: not a statement
  vector<vector<int>> c(h, vector<int>(w));
                                 ^
Main.java:39: error: not a statement
  vector<vector<int>> c(h, vector<int>(w));
                                       ^
Main.java:51: error: not a statement
  vector<vector<int>> d(h, vector<int>(w));
                        ^
Main.java:51: error: not a statement
  vector<vector<int>> d(h, vector<int>(w));
                                 ^
Main.java:51: error: not a statement
  vector<vector<int>> d(h, vector<int>(w));
                                       ^
Main.java:71: error: not a statement
  cout << res << endl;
              ^
Main.java:9: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: ';' expected
  vector<string> s(h);
                  ^
Main.java:12: error: ';' expected
  vector<string> s(h);
                    ^
Main.java:13: error: ';' expected
  rep(i, h) cin >> s[i];
           ^
Main.java:14: error: ';' expected
  vector<vector<int>> a(h, vector<int>(w));
                       ^
Main.java:14: error: ';' expected
  vector<vector<int>> a(h, vector<int>(w));
                         ^
Main.java:14: error: ';' expected
  vector<vector<int>> a(h, vector<int>(w));
                                      ^
Main.java:14: error: ';' expected
  vector<vector<int>> a(h, vector<int>(w));
                                        ^
Main.java:27: error: ';' expected
  vector<vector<int>> b(h, vector<int>(w));
                       ^
Main.java:27: error: ';' expected
  vector<vector<int>> b(h, vector<int>(w));
                         ^
Main.java:27: error: ';' expected
  vector<vector<int>> b(h, vector<int>(w));
                                      ^
Main.java:27: error: ';' expected
  vector<vector<int>> b(h, vector<int>(w));
                                        ^
Main.java:39: error: ';' expected
  vector<vector<int>> c(h, vector<int>(w));
                       ^
Main.java:39: error: ';' expected
  vector<vector<int>> c(h, vector<int>(w));
                         ^
Main.java:39: error: ';' expected
  vector<vector<int>> c(h, vector<int>(w));
                                      ^
Main.java:39: error: ';' expected
  vector<vector<int>> c(h, vector<int>(w));
                                        ^
Main.java:51: error: ';' expected
  vector<vector<int>> d(h, vector<int>(w));
                       ^
Main.java:51: error: ';' expected
  vector<vector<int>> d(h, vector<int>(w));
                         ^
Main.java:51: error: ';' expected
  vector<vector<int>> d(h, vector<int>(w));
                                      ^
Main.java:51: error: ';' expected
  vector<vector<int>> d(h, vector<int>(w));
                                        ^
Main.java:64: error: ';' expected
  rep(i, h) {
           ^
Main.java:65: error: ';' expected
    rep(j, w) {
             ^
47 errors