criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int H, W;
vector<string> fi;
int Left[2100][2100], Right[2100][2100], Up[2100][2100], Down[2100][2100];

int main(){
  cin >> H >> W;
  fi.resize(H);
  for(int i=0; i<H; i++) cin >> fi[i];
  
  for(int i=0; i<H; i++){
    int cur =0;
    for(int j=0; j<W; j++){
      if(fi[i][j] == "#") cur = 0;
      else cur++;
      Left[i][j] = cur;
    }
  }
 
  for(int i=0; i<H; i++){
    int cur = 0;
    for(int j=W-1; j>=0; j--){
      if(fi[i][j] == "#") cur = 0;
      else cur++;
      Right[i][j] = cur;
    }
  }
  
  for(int i=0; i<W; i++){
    int cur =0;
    for(int j=0; j<H; j++){
      if(fi[j][i] == "#") cur = 0;
      else cur++;
      Down[j][i] = cur;
    }
  }
  
  for(int i=0; i<W; i++){
    int cur = 0;
    for(int j=H-1; j>=0; j--){
      if(fi[j][i] == "#") cur == 0;
      else cur++;
      Up[j][i] = cur;
    }
  }
  
  int res = 0;
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      if(fi[i][j] == "#") continue;
      res = max(res, Right[i][j]+Left[i][j]+Down[j][i]+Up[j][i]-3);
    }
  }
  
  cout << res << enfl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |       if(fi[i][j] == "#") cur = 0;
a.cc:27:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |       if(fi[i][j] == "#") cur = 0;
a.cc:36:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   36 |       if(fi[j][i] == "#") cur = 0;
a.cc:45:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |       if(fi[j][i] == "#") cur == 0;
a.cc:54:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   54 |       if(fi[i][j] == "#") continue;
a.cc:59:18: error: 'enfl' was not declared in this scope
   59 |   cout << res << enfl;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
string field[2160];
int l[2160][2160];
int r[2160][2160];
int u[2160][2160];
int d[2160][2160];


int main(){
  cin >> h >> w;
  for(int i = 0;i < h;i++){
    cin >> field[i];
  }
  for(int i = 0;i<h;i++){
    for(int j = 0; j<w;j++){
      if(field[i][j] == '#'){
        l[i][j] = 0;
        u[i][j] = 0;
      }
      else{
        u[i][j] = (i == 0)?1:u[i-1][j]+1;
        l[i][j] = (j == 0)?1:l[i][j - 1] + 1;
      }
    }
  }
  for(int i = h-1;i >= 0;i--){
    for(int j = w-1; j >= 0;j--){
      if(field[i][j] == '#'){
        r[i][j] = 0;
        d[i][j] = 0;
      }
      else{
        d[i][j] = (i == h-1)?1:d[i+1][j]+1;
        r[i][j] = (j == w-1)?1:r[i][j + 1] + 1;
      }
    }
  }
  int res = 0;
  for(int i = 0;i<h;i++){
    for(int j = 0;j < w;j++){
      if(field[i][j] == '#')continue;
      res = max(res, r[i][j] + l[i][j] + d[i][j] + u[i][j] - 3)
    }
  }
  cout << res << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'h' was not declared in this scope
   11 |   cin >> h >> w;
      |          ^
a.cc:11:15: error: 'w' was not declared in this scope
   11 |   cin >> h >> w;
      |               ^
a.cc:43:64: error: expected ';' before '}' token
   43 |       res = max(res, r[i][j] + l[i][j] + d[i][j] + u[i][j] - 3)
      |                                                                ^
      |                                                                ;
   44 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;

int main(){
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  rep(i,h) cin >> s[i];
  vector<vector<int>> cnt(h, vector<int>(w));
  rep(i,h) {
    vector<int> done(w);
    rep(i,w) {
      if (s[i][j] == '#') continue;
      if (done[j]) continue;
      int l = 0;
      while (j+l < w) {
        if (s[i][j+l] == '#') break;
        l++;
      }
      rep(k,l) {
        cnt[i][j+k] += l;
        done[j+k] = 1;
      }
    }
  }
  rep(j,w) {
    vector<int> done(h);
    rep(i,h) {
      if (s[i][j] == '#') continue;
      if (done[i]) continue;
      int l = 0;
      while (i+l < w) {
        if (s[i+1][j] == '#') break;
        l++;
      }
      rep(k,l) {
        cnt[i+k][j] += l;
        done[i+k] = 1;
      }
    }
  }
  int ans = 0;
  rep(i,h)rep(j,w) ans = max(ans, cnt[i][j]-1);
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'j' was not declared in this scope
   14 |       if (s[i][j] == '#') continue;
      |                ^
a.cc:15:16: error: 'j' was not declared in this scope
   15 |       if (done[j]) continue;
      |                ^
a.cc:17:14: error: 'j' was not declared in this scope
   17 |       while (j+l < w) {
      |              ^
a.cc:22:16: error: 'j' was not declared in this scope
   22 |         cnt[i][j+k] += l;
      |                ^
Language: Java

package abc129;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class D {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] tmpArray = br.readLine().split(" ");
		int h = Integer.parseInt(tmpArray[0]);
		int w = Integer.parseInt(tmpArray[1]);

		char[][] board = new char[h][w];

		DisjointSet ufVertical = new DisjointSet(h*w);
		DisjointSet ufHorizontal = new DisjointSet(h*w);


		for(int i = 0; i < h; i++){
			board[i] = br.readLine().toCharArray();
		}

		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				if(board[i][j] == '#'){
					continue;
				}

				if(i >= 1 && board[i][j] == board[i - 1][j]){
					ufVertical.union(i*w + j, (i - 1)*w + j);
				}

				if(j >= 1 && board[i][j] == board[i][j - 1]){
					ufHorizontal.union(i*w + j, i*w + j - 1);
				}
			}
		}

		//各グループの数を数えておく（後で比較的高速に参照可）
		int[] groupCountV = new int[h*w];
		int[] groupCountH = new int[h*w];
		for(int i = 0; i < h*w; i++){
			groupCountV[ufVertical.findSet(i)]++;
			groupCountH[ufHorizontal.findSet(i)]++;

		}

		int result = 0;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				if(board[i][j] == '#'){
					continue;
				}

				int tmp = groupCountV[ufVertical.findSet(i*w + j)] + groupCountH[ufHorizontal.findSet(i*w + j)] - 1;

				result = Math.max(tmp, result);
			}

		}

		System.out.println(result);
	}

}

class DisjointSet {
	private int n;
	private int[] p;
	private int[] rank;

	public DisjointSet(int n){
		this.n = n;

		p = new int[n + 1];
		rank = new int[n + 1];

		for(int i = 1; i <= n; i++){
			makeSet(i);
		}
	}

	private void makeSet(int x){
		p[x] = x;
		rank[x] = 0;
	}

	public void union(int x, int y){
		link (findSet(x), findSet(y));
	}

	//今回の問題では特別にpublic
	public int findSet(int x){
		if(x != p[x]){
			p[x] = findSet( p[x]);
		}
		return p[x];
	}

	public boolean isSameSet(int x, int y){
		return findSet(x) == findSet(y);
	}

	private void link(int x, int y){
		if(rank[x] > rank[y]){
			p[y] = x;
		}
		else {
			p[x] = y;
			if(rank[x] == rank[y]){
				rank[y]++;
			}
		}
	}
}

Compiler output:
Main.java:7: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<math.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repp(i,n) for(int i=(int)(n);i>0;i--)
#define long long ll
using namespace std;
int main() {
	int h, w;
	cin >> h >> w;
	char field[h][w];
	rep(i, w) {
		rep(j, h) {
			cin >> field[j][i];
		}
	}

	int L[h][w], R[h][w], D[h][w], U[h][w];

	rep(i, h) {
		rep(j, w) {
			if (field[i][j] == '#') {
				L[i][j] = 0;
				U[i][j] = 0;
			}
			else {
				if (j == 0) {
					L[i][j] = 1;
				}
				else if (j > 0) {
					L[i][j] = L[i][j - 1] + 1;
				}
				if (i == 0) {
					U[i][j] = 1;
				}
				else if (i > 0) {
					U[i][j] = U[i - 1][j] + 1;
				}
			}
		}
	}
	repp(i, h) {
		repp(j, w) {
			if (field[i][j] == '#') {
				R[i][j] = 0;
				D[i][j] = 0;
			}
			else {
				if (j == w - 1) {
					R[i][j] = 1;
				}
				else if (j < w - 1) {
					R[i][j] = R[i][j + 1] + 1;
				}
				if (i == h - 1) {
					D[i][j] = 1;
				}
				else if (i < h - 1) {
					D[i][j] = D[i + 1][j] + 1;
				}
			}
		}
	}
	int ans = -1;
	rep(i, h) {
		rep(j, w) {
			ans = max(ans,L[i][j]+R[i][j]+D[i][j]+U[i][j]-3)
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:73: error: expected ';' before '}' token
   70 |                         ans = max(ans,L[i][j]+R[i][j]+D[i][j]+U[i][j]-3)
      |                                                                         ^
      |                                                                         ;
   71 |                 }
      |                 ~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<math.h>
#difine rep(i,n) for(int i=0;i<(int)(n);i++)
#difine repp(i,n) for(int i=(int)(n);i>0;i--)
#difine long long ll
using namespace std;
int main() {
	int h, w;
	cin >> h >> w;
	char field[h][w];
	rep(i, w) {
		rep(j, h) {
			cin >> field[j][i];
		}
	}

	int L[h][w], R[h][w], D[h][w], U[h][w];

	rep(i, h) {
		rep(j, w) {
			if (field[i][j] == '#') {
				L[i][j] = 0;
				U[i][j] = 0;
			}
			else {
				if (j == 0) {
					L[i][j] = 1;
				}
				else if (j > 0) {
					L[i][j] = L[i][j - 1] + 1;
				}
				if (i == 0) {
					U[i][j] = 1;
				}
				else if (i > 0) {
					U[i][j] = U[i - 1][j] + 1;
				}
			}
		}
	}
	repp(i, h) {
		repp(j, w) {
			if (field[i][j] == '#') {
				R[i][j] = 0;
				D[i][j] = 0;
			}
			else {
				if (j == w - 1) {
					R[i][j] = 1;
				}
				else if (j < w - 1) {
					R[i][j] = R[i][j + 1] + 1;
				}
				if (i == h - 1) {
					D[i][j] = 1;
				}
				else if (i < h - 1) {
					D[i][j] = D[i + 1][j] + 1;
				}
			}
		}
	}
	int ans = -1;
	rep(i, h) {
		rep(j, w) {
			ans = max(ans,L[i][j]+R[i][j]+D[i][j]+U[i][j]-3)
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:7:2: error: invalid preprocessing directive #difine; did you mean #define?
    7 | #difine rep(i,n) for(int i=0;i<(int)(n);i++)
      |  ^~~~~~
      |  define
a.cc:8:2: error: invalid preprocessing directive #difine; did you mean #define?
    8 | #difine repp(i,n) for(int i=(int)(n);i>0;i--)
      |  ^~~~~~
      |  define
a.cc:9:2: error: invalid preprocessing directive #difine; did you mean #define?
    9 | #difine long long ll
      |  ^~~~~~
      |  define
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         rep(i, w) {
      |             ^
a.cc:15:9: error: 'rep' was not declared in this scope; did you mean 'frexp'?
   15 |         rep(i, w) {
      |         ^~~
      |         frexp
a.cc:45:9: error: 'repp' was not declared in this scope
   45 |         repp(i, h) {
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int h, w, total = 0, max = -1;
    vector<char>grid;
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        for (int i = 0; i < w; i++) {
            cin >> grid[i];
        }
    }
    for (int i = 0; i < grid.size(); i++) {
        if (grid[i] == ".") {
            while (grid[i+w] == ".") {
                total += 1;
            }
            while (grid[i-w] == ".") {
                total += 1;
            }
            while (grid[i+1] == ".") {
                total += 1;
            }
            while (grid[i-1] == ".") {
                total += 1;
            }
        }
        else {
            int r = 0;
        }
        if (total > max) {
            max = total;
        }
        total = 0;
    }
    cout << max;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if (grid[i] == ".") {
a.cc:14:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |             while (grid[i+w] == ".") {
a.cc:17:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |             while (grid[i-w] == ".") {
a.cc:20:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |             while (grid[i+1] == ".") {
a.cc:23:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |             while (grid[i-1] == ".") {
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

template<typename T>
T MatMaximum(vector<vector<T>> &mat){
    vector<T> max_array;
    for(auto itr = mat.begin(); itr != mat.end(); ++itr) {
        T maximum = *max_element((*itr).begin(), (*itr).end());
        max_array.push_back(maximum);
    }
    return *max_element(max_array.begin(),max_array.end());
}



void process_vec(vector<int> &array, string hoge){
    int size_array = array.size();
    int count = 0;
    hoge.push_back('#');
    for (int i= 0;i<size_array+1;i++){
        if (hoge[i] == '.'){
            count+=1;
        }else{
            for (int k=0;k<count;k++){
                array[i-k-1] = count;
            }
            count=0;
        }
    }
}

string get_vec_col(vector<string> &S,int col_idx){
    int row_len = S.size();
    string ret;
    for (int i= 0;i<row_len;i++){
        ret.push_back(S[i][col_idx]);
    }
    return ret ;
}

//末尾に注意しないといけない
void solve(long long H, long long W, std::vector<std::string> &S){
    vector<vector <int>> horizontal_count(H,vector<int>(W,0));
    vector<vector <int>> vertical_count(W,vector<int>(H,0));
    for (int i=0;i<H;i++){
        process_vec(horizontal_count[i],S[i]);
    }
    for (int i=0;i<W;i++){
        process_vec(vertical_count[i],get_vec_col(S,i));
    }

    vector<vector <int> > count(H,vector<int>(W,0));
    for (int i=0;i<H;i++){
        for (int j=0;j<W;j++){
            count[i][j] = horizontal_count[i][j] + vertical_count[j][i];
        }
    }
    printf("%d\n",MatMaximum(count)-1);

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    std::vector<std::string> S(H);
    for(int i = 0 ; i < H ; i++){
        std::cin >> S[i];
    }
    solve(H, W, std::move(S));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:26: error: cannot bind non-const lvalue reference of type 'std::vector<std::__cxx11::basic_string<char> >&' to an rvalue of type 'std::remove_reference<std::vector<std::__cxx11::basic_string<char> >&>::type' {aka 'std::vector<std::__cxx11::basic_string<char> >'}
   75 |     solve(H, W, std::move(S));
      |                 ~~~~~~~~~^~~
a.cc:45:64: note:   initializing argument 3 of 'void solve(long long int, long long int, std::vector<std::__cxx11::basic_string<char> >&)'
   45 | void solve(long long H, long long W, std::vector<std::string> &S){
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~^
Language: C

#include<stdio.h>
char a[2005][2005];
int n,m;
bool check(int i,int j)
{
    if(a[i][j]=='.'&&i>=0&&j>=0&&i<n&&j<m) return true;
    else return false;
}
int ac(int i,int j)
{
    if(check(i+1,j)) return 1+ac(i+1,j);
    else return 0;
}
int b(int i,int j)
{
    if(check(i-1,j)) return 1+b(i-1,j);
    else return 0;
}
int c(int i,int j)
{
    if(check(i,j+1)) return 1+c(i,j+1);
    else return 0;
}
int d(int i,int j)
{
    if(check(i,j-1)) return 1+d(i,j-1);
    else return 0;
}
int f(int i,int j)
{
    if(check(i,j))
    {
        int x=1+ac(i,j)+b(i,j)+c(i,j)+d(i,j);
        return x;
    }
    else return 0;
}
int main()
{
    int i,j;
    int ans=0;
    scanf("%d%d",&n,&m);
    for(i=0; i<n; i++) scanf("%s",a[i]);
    for(i=0; i<n; i++)
    {
        for(j=0; j<m; j++)
        {
            if(f(i,j)>ans)
            {
                ans=f(i,j);
              //  printf("%d %d\n",i,j);
            }
        }
    }
    printf("%d\n",ans);
}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool check(int i,int j)
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | char a[2005][2005];
main.c: In function 'check':
main.c:6:51: error: 'true' undeclared (first use in this function)
    6 |     if(a[i][j]=='.'&&i>=0&&j>=0&&i<n&&j<m) return true;
      |                                                   ^~~~
main.c:6:51: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:6:51: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:17: error: 'false' undeclared (first use in this function)
    7 |     else return false;
      |                 ^~~~~
main.c:7:17: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;
const in INF=1<<30;
using vec = vector<vector<int>>;
#define ans(i,j) U[i][j]+S[i][j]+R[i][j]+L[i][j]-3

int main(){
int h,w;
  cin>>h>>w;
  vector<vector<char>> a(w,vector<char>(h));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
       cin>>a[i][j];
    }
  }
  
  vec U(a(w,vector<int>(h));
  vec S(a(w,vector<int>(h));
  vec R(a(w,vector<int>(h));
  vec L(a(w,vector<int>(h));
        
  for(int i=0;i<w;i++){
    if(a[0][i]=='.') U[0][i]=1;
    else U[0][i]=0;
  }
  for(int i=1;i<h;i++){
    for(int j=0;j<w;j++){
       if(a[i][j]=='#'){ U[i][j]=0;continue;}
       U[i][j]=U[i-1][j]+1;
    }
  }
        
  for(int i=0;i<w;i++){
    if(a[h-1][i]=='.') S[h-1][i]=1;
    else U[h-1][i]=0;
  }
  for(int i=h-2;i>=0;i++){
    for(int j=0;j<w;j++){
       if(a[i][j]=='#'){ U[i][j]=0;continue;}
       U[i][j]=U[i+1][j]+1;
    }
  }
        
  for(int i=0;i<w;i++){
    if(a[i][w-1]=='.') L[i][w-1]=1;
    else L[i][w-1]=0;
  }
  for(int i=0;i<h;i++){
    for(int j=w-2;j>=0;j++){
       if(a[i][j]=='#'){ L[i][j]=0;continue;}
       L[i][j]=L[i][j+1]+1;
    }
  }
        
  for(int i=0;i<w;i++){
    if(a[i][0]=='.') R[i][0]=1;
    else R[i][0]=0;
  }
  for(int i=0;i<h;i++){
    for(int j=1;j<w;j++){
       if(a[i][j]=='#'){ R[i][j]=0;continue;}
       R[i][j]=R[i][j-1]+1;
    }
  } 
        
        int ret = ans(0,0);
        
        for(int i=0;i<h;i++){
           for(int j=0;j<w;j++){
              ret = max(ret,ans(i,j));
           }
        }
        
        cout<<ret<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: no match for call to '(std::vector<std::vector<char> >) (int&, std::vector<int>)'
   23 |   vec U(a(w,vector<int>(h));
      |         ~^~~~~~~~~~~~~~~~~~
a.cc:24:10: error: no match for call to '(std::vector<std::vector<char> >) (int&, std::vector<int>)'
   24 |   vec S(a(w,vector<int>(h));
      |         ~^~~~~~~~~~~~~~~~~~
a.cc:25:10: error: no match for call to '(std::vector<std::vector<char> >) (int&, std::vector<int>)'
   25 |   vec R(a(w,vector<int>(h));
      |         ~^~~~~~~~~~~~~~~~~~
a.cc:26:10: error: no match for call to '(std::vector<std::vector<char> >) (int&, std::vector<int>)'
   26 |   vec L(a(w,vector<int>(h));
      |         ~^~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int H,W;
  cin>>H>>W;
  vector<string> S(H);
  vii A(H),B(W);
  rep(i,0,H){
    cin>>S[i];
    A[i].push_back(0);
    rep(j,0,W){
      if(S[i][j]=='#')
        A[i].push_back(j);
      }
    A[i].push_back(W-1);
    }
  rep(i,0,W){
    B[i].push_back(0);
    rep(j,0,H){
      if(S[j][i]=='#')
        B[i].push_back(j);
      }
    B[i].push_back(H-1);
    }
  int ans=0;
  rep(i,0,H){
    rep(j,0,W){
      if(S[i][j]=='.'){
        int sum=0;
        if(i==H-1)
          sum+=H-B[j][B.size()-2];
        else{
          int X=disup(B[j],i);
          sum+=B[j][X]-B[j][X-1];
          }
        if(j==W-1)
          sum+=W-A[i][A.size()-2];
        else{
          int X=disup(A[i],j);
          sum+=A[i][X]-A[i][X-1];
          }
        }
      ans=max(ans,sum);
      }
    }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:54:19: error: 'sum' was not declared in this scope
   54 |       ans=max(ans,sum);
      |                   ^~~
Language: C++

/#include<bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rep1(i,n) for(int i = n-1; i >= 0; i--)

bool check(char a){
    if(a == '#'){
        return false;
    }else{
        return true;
    }
}

int main (void){

    int  H, W;
    cin >> H>> W;
    char c[H][W];
    
    rep(i, H){
        rep(j, W){
            cin >> c[i][j];
        }
    }
    
    int Up[H][W];
    int Down[H][W];
    int L[H][W];
    int R[H][W];
    int max = 0;

    rep(i, H){
        rep(j, W){
            if(i == 0 && check(c[i][j])){
                Up[i][j] = 1;
            }else if(!check(c[i][j])){
                Up[i][j] = 0;
            }else {
                Up[i][j] = Up[i-1][j] +1;
            }

            if(j == 0 && check(c[i][j])){
                L[i][j] = 1;
            }else if(!check(c[i][j])){
                L[i][j] = 0;
            }else {
                L[i][j] = L[i][j-1] +1;
            }
        }
    }


    rep1(i , H){
        rep1(j, W){
             if(i == H-1 && check(c[i][j])){
                Down[i][j] = 1;
            }else if(!check(c[i][j])){
                Down[i][j] = 0;
            }else {
                Down[i][j] = Down[i+1][j] +1;
            }

            if(j == W-1 && check(c[i][j])){
                R[i][j] = 1;
            }else if(!check(c[i][j])){
                R[i][j] = 0;
            }else {
                R[i][j] = R[i][j+1] +1;
            }
        }
    }
    int tem;
    int a, b;
   /*  rep(i, H){
        rep(j, W){
            tem = Up[i][j] + Down[i][j] + L[i][j] + R[i][j] -3;
            if(max < tem){
                max = tem;
                a = i; b = j;
            }
        }
    }

    rep(i, H){
        rep(j, W){
            cout << L[i][j] << " " ;
        }
        cout << endl;
    }
    */

   cout << max;


}
    


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | /#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '/' token
    1 | /#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:19:5: error: 'cin' was not declared in this scope
   19 |     cin >> H>> W;
      |     ^~~
a.cc:94:4: error: 'cout' was not declared in this scope
   94 |    cout << max;
      |    ^~~~
Language: C++

package main

import (
	"fmt"
)

func main() {
	var h,w int
	fmt.Scan(&h,&w)

	s := make([]string,h)
	for i := 0; i < h; i++ {
		fmt.Scan(&s[i])
	}

	lco := make([][]int, h)
	rco := make([][]int, h)
	uco := make([][]int, h)
	dco := make([][]int, h)
	for i := 0; i < h; i++ {
		lco[i] = append(lco[i],make([]int, w)...)
		rco[i] = append(rco[i],make([]int, w)...)
		uco[i] = append(uco[i],make([]int, w)...)
		dco[i] = append(dco[i],make([]int, w)...)
	}

	for i := 0; i < h; i++ {
		co := 0
		for j := 0; j < w; j++ {
			co++
			if string(s[i][j]) == "#" {
				co = 0
			}
			lco[i][j] = co
		}
	}

	for i := 0; i < h; i++ {
		co := 0
		for j := 0; j < w; j++ {
			co++
			if string(s[i][w-j-1]) == "#" {
				co = 0
			}
			rco[i][w-j-1] = co
		}
	}

	for i := 0; i < w; i++ {
		co := 0
		for j := 0; j < h; j++ {
			co++
			if string(s[j][i]) == "#" {
				co = 0
			}
			uco[j][i] = co
		}
	}

	for i := 0; i < w; i++ {
		co := 0
		for j := 0; j < h; j++ {
			co++
			if string(s[h-j-1][i]) == "#" {
				co = 0
			}
			dco[h-j-1][i] = co
		}
	}

	ans := 0
	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			light := lco[i][j]+rco[i][j]+uco[i][j]+dco[i][j]-3
			if ans < light {
				ans = light
			}
		}
	}

	fmt.Println(ans)

}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int h,w;
  cin>>h>>w;
  vector<string> s(h);
  for(int i=0;i<h;i++){
    cin>>s[i];
  }
  vector<vector<int>> t(h,vector<int> (w,0));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]=='#') continue;
      int a=i;
      int b=j;
      while(s[i][b]=='.' && b<h){
        t[i][j]++;
        b++;
      }
      while(s[a][j]=='.' && a<w){
      
        

Compiler output:
a.cc: In function 'int main()':
a.cc:21:34: error: expected '}' at end of input
   21 |       while(s[a][j]=='.' && a<w){
      |                                 ~^
a.cc:21:34: error: expected '}' at end of input
a.cc:13:25: note: to match this '{'
   13 |     for(int j=0;j<w;j++){
      |                         ^
a.cc:21:34: error: expected '}' at end of input
   21 |       while(s[a][j]=='.' && a<w){
      |                                  ^
a.cc:12:23: note: to match this '{'
   12 |   for(int i=0;i<h;i++){
      |                       ^
a.cc:21:34: error: expected '}' at end of input
   21 |       while(s[a][j]=='.' && a<w){
      |                                  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

H, W = map(int, input().split())
S = []
for h in range(H):
  S.append(list(map(lambda s:0 if s=='#' else 1, input())))

l,r,u,d = [[[0 for w in range(W)] for h in range(H)] for _ in range(4)]


for h in range(H):
  for w in range(W):
    s = S[h][w]
    l[h][w] = (l[h][w-1]+1)*S[h][w]
    r[h][-w-1] = (r[h][-w]+1)*S[h][-w-1]
    u[h][w] = (u[h-1][w]+1)*S[h][w]
    d[-h-1][w] = (d[-h][w]+1)*S[-h-1][w]
  
ans = 0
for h in range(H):
  for w in range(W):
    tmp =(l[h][w]+r[h][w]+u[h][w]+d[h][w]-3)*S[h][w]
    ans = max(ans, tmp)
    
print(ans)
    




Compiler output:
a.cc:1:1: error: 'H' does not name a type
    1 | H, W = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
/* ちゃんと考えて実装して問題なくACできた時嬉しいよ！！ */

int main(void){
    ll h,w;
    cin >> h >> w;
    vector<string> s;
    for(ll i=0; i<h; i++){
        string tmp_s;
        cin >> tmp_s;
        s.push_back(tmp_s);
    }

    vector<pair <ll, pair<ll,ll> > > gyo(h);
    for(ll i=0; i<h; i++){
        gyo[i].first = 0;
    }
    vector<pair<ll, ll> > retsu(w);
    for(ll i=0; i<w; i++){
        retsu[i].first = 0;
        retsu[i].second = i;
    }

    for(ll i=0; i<h; i++){
        if(s[i][0]=='.') ll tmp_c = 1;
        else ll tmp_c = 0;
        ll l = 0;
        ll r = 0;
        for(ll j=0; j<w; j++){
            if(s[i][j]=='.'){
                tmp_c += 1;
                r += 1;
                if(j==w-1){
                    if(gyo[i].first < tmp_c){
                        gyo[i].first = tmp_c;
                        gyo[i].second.first = l;
                        gyo[i].second.second = r;
                    }
                }
            }
            else{
                if(gyo[i].first < tmp_c){
                    gyo[i].first = tmp_c;
                    gyo[i].second.first = l;
                    gyo[i].second.second = r;
                }
                l = j+1;
                r = j+1;
                tmp_c = 0;
            }
        }
    }

    for(ll j=0; j<w; j++){
        if(s[0][j]=='.') ll tmp_c = 1;
        else ll tmp_c = 0;
        for(ll i=0; i<h; i++){
            if(s[i][j]=='.'){
                tmp_c += 1;
                if(i==h-1){
                    if(retsu[j].first < tmp_c){
                        retsu[j].first = tmp_c;
                    }
                }
            }
            else{
                if(retsu[j].first < tmp_c){
                    retsu[j].first = tmp_c;
                }
                tmp_c = 0;
            }
        }
    }
    ll ans = 0;
    for(ll i=0; i<h; i++){
        for(ll j=0; j<w; j++){
            if(gyo[i].second.first <= retsu[j].second 
                && retsu[j].second <= gyo[i].second.second){
                if(ans < gyo[i].first + retsu[j].first - 1){
                    ans = gyo[i].first + retsu[j].first - 1;
                }
            }
        }
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: 'tmp_c' was not declared in this scope
   35 |                 tmp_c += 1;
      |                 ^~~~~
a.cc:46:35: error: 'tmp_c' was not declared in this scope
   46 |                 if(gyo[i].first < tmp_c){
      |                                   ^~~~~
a.cc:53:17: error: 'tmp_c' was not declared in this scope
   53 |                 tmp_c = 0;
      |                 ^~~~~
a.cc:63:17: error: 'tmp_c' was not declared in this scope
   63 |                 tmp_c += 1;
      |                 ^~~~~
a.cc:71:37: error: 'tmp_c' was not declared in this scope
   71 |                 if(retsu[j].first < tmp_c){
      |                                     ^~~~~
a.cc:74:17: error: 'tmp_c' was not declared in this scope
   74 |                 tmp_c = 0;
      |                 ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<char>> s(h+2, vector<char>(w+2));
    rep(i, h+2){
        s[i][0] = '#';
        s[i][w+1] = "#";
    }
    rep(j, w+2){
        s[0][j] = '#';
        s[h+1][j] = '#';
    }
    rep(i, h)rep(j, w){
        cin >> s[i+1][j+1];
    }
    vector<vector<int>> L(h+2, vector<int>(w+2, 0));
    vector<vector<int>> R(h+2, vector<int>(w+2, 0));
    vector<vector<int>> U(h+2, vector<int>(w+2, 0));
    vector<vector<int>> D(h+2, vector<int>(w+2, 0));
    rep(i, h+1)rep(j, w+1){
        if(i==0 or j==0) continue;
        if(s[i][j] == '#'){
            L[i][j] = 0;
            R[i][j] = 0;
            U[i][j] = 0;
            D[i][j] = 0;
            continue;
        }
        L[i][j] = L[i][j-1]+1;
        U[i][j] = U[i-1][j]+1;
    }

    for(int i=h+1; i>0; i--)for(int j=w+1; j>0; j--){
        if(s[i][j] == '.'){
            R[i][j] = R[i][j+1]+1;
            D[i][j] = D[i+1][j]+1;
        }
    }
    int ans = 0;
    rep(i, h+1)rep(j, w+1){
        if(i==0 or j==0) continue;
        chmax(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   19 |         s[i][w+1] = "#";
      |                     ^~~
      |                     |
      |                     const char*
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
typedef lonf long ll;
using namespace std;

int main(){
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  vector<vector<int>> cnt(h,vector<int>(w));
  rep(i,h) cin >> s[i];
  
  rep(i,h){
    vector<int> done(w);
    rep(j,w){
      if(s[i][j]=='#')continue;
      if(done[j])continue;
      int l = 0;
      
      while(j+l<w){
        if(s[i][j+l]=='#')break;
        l++;
      }
      
      rep(k,l){
        cnt[i][j+k] += l;
        done[j+k] = 1;
      }
    }
  }
  
  rep(i,w){
    vector<int> done(h);
    rep(j,h){
      if(s[j][i]=='#')continue;
      if(done[j])continue;
      int l = 0;
      
      while(j+l<h){
        if(s[j+l][i]=='#')break;
        l++;
      }
      
      rep(k,l){
        cnt[j+k][i] += l;
        done[j+k] = 1;
      }
    }
  }
  int ans = 0;
  rep(i,h){
    rep(j,w){
      ans = max(ans,cnt[i][j]-1);
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc:3:9: error: 'lonf' does not name a type; did you mean 'long'?
    3 | typedef lonf long ll;
      |         ^~~~
      |         long
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W;
  cin>>H>>W;
  vector<string>fi;
  int Left[2100][2100],Right[2100][2100],Up[2100][2100],Down[2100][2100];
  fi.resize(H);
  for (int i=0;i<H;++i)  cin>>fi[i];
  for (int i=0;i<H;++i){
    int cur=0;
    for (int j=0;j<W;++j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Left[i][j]=cur;
    }
  }
  for (int i=0;i<H;++i){
    int cur=0;
    for (int j=W-1;j>0;--j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Right[i][j]=cur;
    }
  }
  for (int j=0;j<W;++i){
    int cur=0;
    for (int i=0;i<H;++j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Down[i][j]=cur;
    }
  }
  for (int j=0;j<W;++i){
    int cur=0;
    for (int i=H-1;i>0;--j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Up[i][j]=cur;
    }
  }
  
  int res=0;
  for (int i=0;i<H;++i){
    for (int j=0;j<W;++j){
      if(fi[i][j]=='#')continue;
      res=max(res,Left[i][j]+Right[i][j]+Down[i][j]+Up[i][j]-3);
    }
  }
  cout<<res<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'i' was not declared in this scope
   26 |   for (int j=0;j<W;++i){
      |                      ^
a.cc:34:22: error: 'i' was not declared in this scope
   34 |   for (int j=0;j<W;++i){
      |                      ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
const int INF=1001001001;
int main(){
  int H,W;
  cin>>H>>W;
  vector<string>fi;
  int Left[2100][2100],Right[2100][2100],Up[2100][2100],Down[2100][2100];
  fi.resize(H);
  for (int i=0;i<H;++i)  cin>>fi[i];
  for (int i=0;i<H;++i){
    int cur=0;
    for (int j=0;j<W;++j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Left[i][j]=cur;
    }
  }
  for (int i=0;i<H;++i){
    int cur=0;
    for (int j=W-1;j>0;--j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Right[i][j]=cur;
    }
  }
  for (int j=0;i<W;++i){
    int cur=0;
    for (int i=0;j<H;++j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Down[i][j]=cur;
    }
  }
  for (int j=0;i<W;++i){
    int cur=0;
    for (int i=W-1;j>0;--j){
      if(fi[i][j]=='#')cur=0;
      else ++cur;
      Up[i][j]=cur;
    }
  }
  
  int res=0;
  for (int i=0;i<H;++i){
    for (int j=0;j<W;++j){
      if(fi[i][j]=='#')continue;
      res=max(res,Left[i][j]+Right[i][j]+Down[i][j]+Up[i][j]-3;
    }
  }
  cout<<res<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: error: 'i' was not declared in this scope
   29 |   for (int j=0;i<W;++i){
      |                ^
a.cc:37:16: error: 'i' was not declared in this scope
   37 |   for (int j=0;i<W;++i){
      |                ^
a.cc:50:63: error: expected ')' before ';' token
   50 |       res=max(res,Left[i][j]+Right[i][j]+Down[i][j]+Up[i][j]-3;
      |              ~                                                ^
      |                                                               )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int H,W;
  cin >> H >> W;
  vector<string> grid(H);
  for(int i=0; i<H; i++) cin >> grid[i];
  
  vector<vector<int>> L(H, vector<int>(W));
  vector<vector<int>> U(H, vector<int>(W));
  for(int y=0; y<H; y++){
    for(int x=0; x<W; x++){
      if(grid[y][x]=='#'){
        L[y][x]=0; U[y][x]=0;
      }else if(y==0 && x==0){
        U[y][x]=1; L[y][x]=1;
      }else if(y==0){
        U[y][x]=1;
      }else if(x==0){
        L[y][x]=1;
      }else{
        L[y][x]=L[y][x-1]+1;
        U[y][x]=U[y-1][x]+1;
      }
    }
  }
  
  vector<vector<int>> R(H, vector<int>(W));
  vector<vector<int>> D(H, vector<int>(W));
  for(int yy=H-1; yy>=0; yy--){
    for(int xx=W-1; xx>=0; xx--){
      if(grid[yy][xx]=='#'){
        R[yy][xx]=0; D[yy][xx]=0;
      }else if(yy==H-1 && xx=W-1){
        D[yy][xx]=1; R[yy][xx]=1;
      }else if(yy==H-1){
        D[yy][xx]=1;
      }else if(xx==W-1){
        R[yy][xx]=1;
      }else{
        R[yy][xx]=R[yy][xx+1]+1;
        D[yy][xx]=D[yy+1][xx]+1;
      }
    }
  }   
  
  int max=1;
  for(int j=0; j<H; j++){
    for(int k=0; k<W; k++){
      int tmp = L[j][k]+U[j][k]+R[j][k]+D[j][k]-3;
      if(tmp>max) max=tmp;
    }
  }
  cout << max;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:24: error: lvalue required as left operand of assignment
   35 |       }else if(yy==H-1 && xx=W-1){
      |                ~~~~~~~~^~~~~
Language: C++

#define _GLIBCXX_DEBUG
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;

int P[10010];
void init(int n){
    for(int i=0;i<n;++i)P[i]=i;
}
int root(int a) {
    if(P[a]==a)return a;
    return (P[a]=root(P[a]));
}
bool is_same_set(int a,int b){
    return root(a) == root(b);//代表元を求める
}
void unite(int a,int b){
    P[root(a)]=root(b);
}//対set,グラフ？

double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); }//内積
double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }//外積
xy_t projection(xy_t p, xy_t b) { return b*dot_product(p,b)/norm(b); }//投影
//対図形

#define mod 1000000007
ll f[2001];
//int n,k とかしておく

ll pw(ll x, ll y){//euclidの互除法より
    ll a= 1;
    while(y){
        if(y&1){//奇数なら
            a = a*x%mod;
        }
        x = x*x%mod;
        y /= 2;
    }
    return a;
}

ll modinv(ll x){//逆元を求める
    return pw(x, mod - 2 );
}

ll comb(int n,int r){
    if(n<r){
        return 0;
    }
    return f[n] * modinv(f[r])%mod*modinv(f[n-r])%mod;
}//対combination

int main(){
    int h , w;
    cin >> h>>w;
    char mx[h];
    int L[h][w],R[h][w],D[h][w],U[h][w],A[h][w];
    rep(i,h){
        cin>>mx[i];
    }
    rep(i,h){
        rep(j,w){
            if(mx[i][j]=='#'){
                L[i][j]=0;
                R[i][j]=0;
                D[i][j]=0;
                U[i][j]=0;
            }else if(j==0){
                L[i][j]=1;
            }else if(i==0){
                U[i][j]=1;
            }else if(j==w-1){
                R[i][j]=1;
            }else if(i==h-1){
                D[i][j]=1;
            }else{
                L[i][j]=L[i][j-1]+1;
                R[i][j]=R[i][j+1]+1;
                D[i][j]=D[i-1][j]+1;
                U[i][j]=U[i+1][j]+1;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:21: error: invalid types 'char[int]' for array subscript
   75 |             if(mx[i][j]=='#'){
      |                     ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main()
{
  int H, W;
  cin >> H >> W;
  string S[2005];
  for (int i = 0; i < H; i ++)
    cin >> S[i];
  
  int L[2005][2005], U[2005][2005];
  for (int h = 0; h < H; h++)
  {
    for (int w = 0; w < W; w++)
    {
      if (S[h][w] == '#')
      {
        L[h][w] = 0;
        U[h][w] = 0;
      }
      else
      {
        if (h == 0)
          U[h][w] = 1;
        if (w == 0)
          L[h][w] = 1;
        else
        {
          L[h][w] = L[h][w - 1] + 1;
          U[h][w] = U[h - 1][w] + 1;
        }
      }
    }
  }
  
  int R[2005][2005], D[2005][2005];
  for (int h = H - 1; h >= 0; h--)
  {
    for (int w = W - 1; w >= 0; w--)
    {
      if (S[h][w] == '#')
      {
        R[h][w] = 0;
        D[h][w] = 0;
      }
      else
      {
        if (h == H - 1)
          D[h][w] = 1;
        if (w == W - 1)
          R[h][w] = 1;
        else
        {
          R[h][w] = R[h][w + 1] + 1;
          D[h][w] = D[h + 1][w] + 1;
        }
      }
    }
  }
  
  int ans = 0;
  for (int h = 0; h < H; h++)
  {
    for (int w = 0; w < W; w++)
    {
      if (S[h][w] == ".")
      {
        ans = max(ans, L[h][w] + R[h][w] + U[h][w] + D[h][w] - 3);
      }
    }
  }
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   68 |       if (S[h][w] == ".")
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll MOD = 1e9 + 7;
ll H, W;
vector<vector<bool>> Map;
vector<vector<ll>> Num;
ll R;

int main() {
  cin >> H >> W;
  Map.resize(W);
  for (auto &map : Map) map.resize(H);
  for (ll y = 0; y < H; ++y) {
    for (ll x = 0; x < W; ++x) {
      char c;
      cin >> c;
      Map[x][y] = c == '.';
    }
    Num.resize(W);
    for (auto &num : Num) num.resize(H, H + W - 1);
    for (ll y = 0; y < H; ++y) {
      ll lx = 0;
      for (ll x = 0; x < W; ++x) {
        if (!Map[x][y]) lx = x + 1;
        Num[x][y] -= lx;
      }
      ll rx = 0;
      for (ll x = W - 1; x >= 0; --x) {
        if (!Map[x][y]) rx = W - x;
        Num[x][y] -= rx;
      }
    }
    for (ll x = 0; x < W; ++x) {
      ll uy = 0;
      for (ll y = 0; y < H; ++y) {
        if (!Map[x][y]) uy = y + 1;
        Num[x][y] -= uy;
      }
      ll dy = 0;
      for (ll y = H - 1; y >= 0; --y) {
        if (!Map[x][y]) dy = H - y;
        Num[x][y] -= dy;
      }
    }
    for (ll x = 0; x < W; ++x) {
      for (ll y = 0; y < H; ++y) {
        if (Map[x][y]) R = max(R, Num[x][y]);
      }
    }
    cout << R << endl;
    return 0;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:55:4: error: expected '}' at end of input
   55 |   }
      |    ^
a.cc:12:12: note: to match this '{'
   12 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<string>
#include <vector>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
using vll = vector<ll>;
using Graph = vii;
const ll MOD = 1e9 + 7;

int main() {
	int h, w;
	cin >> h >> w;
	vs s(h);
	rep(i, h) cin >> s[i];
	vii u(h, vi(w)), d(h, vi(w)), l(h, vi(w)), r(h, vi(w));
	rep(i, h) {
		rep(j, w) {
			if (s[i][j] == '#') {
				r[i][j] = 0;
			}
			else {
				if (j == 0) r[i][j] = 1;
				else r[i][j] = r[i][j - 1] + 1;
			}
			if (s[i][w - 1 - j] == '#') {
				l[i][w - 1 - j] = 0;
			}
			else {
				if (j == 0) r[i][w - 1 - j] = 1;
				else l[i][w - 1 - j] = l[i][w - j] + 1;
			}
		}
	}
	rep(j, w) {
		rep(i, h) {
			if (s[i][j] == '#') {
				d[i][j] = 0;
			}
			else {
				if (i == 0) d[i][j] = 1;
				else d[i][j] = d[i - 1][j] + 1;
			}
			if (s[h - 1 - i][j] == '#') {
				u[h - 1 - i][j] = 0;
			}
			else {
				if (i == 0) u[h - 1 - i][j] = 1;
				else u[h - 1 - i][j] = l[h - i][j] + 1;
			}
		}
	}
	ll ret=-1;
	rep(i, h) {
		rep(j, w) {
			ll k = u[i][j] + d[i][j] + r[i][j] + l[i][j] - 3);
			if (ret < k) ret = k;
		}
	}
	cout << ret << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:73: error: expected ',' or ';' before ')' token
   69 |                         ll k = u[i][j] + d[i][j] + r[i][j] + l[i][j] - 3);
      |                                                                         ^
Language: C++

import numpy as np
H, W = map(int, input().split())

grid = [[] for h in range(H)]
for h in range(H):
    grid[h] = [-1 if _ == '#' else 0 for _ in input()]
    grid[h] = [-1] + grid[h] + [-1]
    #print(grid[h])
    count = 0
    for w in range(W + 1):
        if grid[h][w] == -1 and grid[h][w + 1] == 0:
            count = 1
            tmp = w + 1
        elif grid[h][w] == 0 and grid[h][w + 1] == 0:
            count += 1
        elif grid[h][w] == 0 and grid[h][w + 1] == -1:
            grid[h][tmp: w + 1] = [count] * (w + 1 - tmp)
            count = 0
    #print(grid)
#print(grid)
pad_grid = [[-1] * (W + 2)] + grid + [[-1] * (W + 2)]
#pad_grid
#print(pad_grid)
t_grid = np.transpose(pad_grid)

for h in range(1, W + 1):
    for w in range(H + 1):
        if t_grid[h][w] == -1 and t_grid[h][w + 1] != 0:
            count = 1
            tmp = w + 1
        elif t_grid[h][w] != -1 and t_grid[h][w + 1] != -1:
            count += 1
        elif t_grid[h][w] != -1 and t_grid[h][w + 1] == -1:
            t_grid[h][tmp: w + 1] += count - 1
            count = 0
    #print(t_grid)
print(max(t_grid.ravel()))

Compiler output:
a.cc:8:6: error: invalid preprocessing directive #print
    8 |     #print(grid[h])
      |      ^~~~~
a.cc:19:6: error: invalid preprocessing directive #print
   19 |     #print(grid)
      |      ^~~~~
a.cc:20:2: error: invalid preprocessing directive #print
   20 | #print(grid)
      |  ^~~~~
a.cc:22:2: error: invalid preprocessing directive #pad_grid
   22 | #pad_grid
      |  ^~~~~~~~
a.cc:23:2: error: invalid preprocessing directive #print
   23 | #print(pad_grid)
      |  ^~~~~
a.cc:36:6: error: invalid preprocessing directive #print
   36 |     #print(t_grid)
      |      ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; ++i)
using namespace std;


int main()
{
	int n, w;
	vector<string> s(h);
	rep(i,h) cin >> s[i];
	vector<vector<int>> cnt(h, vactor<int>(w));
	rep(i,h){
	    vector<int> done(w);
	    if(s[i][j] == '#') continue;
	    if(done[j]) continue;
	    int l = 0;
	    while(j+l < w){
            if(s[i][j+1] == '#') break;
            ++l;
	    }
	    rep(k,l){
	        cnt[i][j+k] += l;
	        done[j+k] = 1;
	    }
	}
	rep(j,w){
	    vector<int> done(h);
	    if(s[i][j] == '#') continue;
	    if(done[i]) continue;
	    int l = 0;
	    while(i+l < h){
            if(s[i+l][j] == '#') break;
            ++l;
	    }
	    rep(k,l){
	        cnt[i+k][j] += l;
	        done[j+k] = 1;
	    }
	}
	int ans = 0;
	rep(i,h)rep(j,w) ans = max(ans, cnt[i][j]-1));
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'h' was not declared in this scope
    9 |         vector<string> s(h);
      |                          ^
a.cc:11:36: error: 'vactor' was not declared in this scope
   11 |         vector<vector<int>> cnt(h, vactor<int>(w));
      |                                    ^~~~~~
a.cc:11:43: error: expected primary-expression before 'int'
   11 |         vector<vector<int>> cnt(h, vactor<int>(w));
      |                                           ^~~
a.cc:14:21: error: 'j' was not declared in this scope
   14 |             if(s[i][j] == '#') continue;
      |                     ^
a.cc:15:21: error: 'j' was not declared in this scope
   15 |             if(done[j]) continue;
      |                     ^
a.cc:17:19: error: 'j' was not declared in this scope
   17 |             while(j+l < w){
      |                   ^
a.cc:22:24: error: 'j' was not declared in this scope
   22 |                 cnt[i][j+k] += l;
      |                        ^
a.cc:28:18: error: 'i' was not declared in this scope
   28 |             if(s[i][j] == '#') continue;
      |                  ^
a.cc:29:21: error: 'i' was not declared in this scope
   29 |             if(done[i]) continue;
      |                     ^
a.cc:31:19: error: 'i' was not declared in this scope
   31 |             while(i+l < h){
      |                   ^
a.cc:36:21: error: 'i' was not declared in this scope
   36 |                 cnt[i+k][j] += l;
      |                     ^
a.cc:41:53: error: expected ';' before ')' token
   41 |         rep(i,h)rep(j,w) ans = max(ans, cnt[i][j]-1));
      |                                                     ^
      |                                                     ;