criyle/codenet-compile-errors huggingface dataset:
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(w);
  rep(i,h) cin >> s[i];
  vector<vector<int>> cnt(h,vector<int>(w));
  
  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(j,w){
    vector<int> done(h);
    rep(i,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[i+k] = 1;
      }
    }
  }

  int ans = 0;
  rep(i,w){
    rep(j,h){
      ans = max(ans,cnt[j][i]-1);
    }
  }
  cout << ans << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:41:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   41 |         if(s[i+l][j]=="#")break;
Language: C++

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

int main(){
  int h,w,a=0;
  cin>>h>>w;
  vector<vector<char>> v(h+2,vector<char>(w+2,'#'));
  vector<vector<int>> u(h+2,vector<int>(w+2));
  vector<vector<int>> d(h+2,vector<int>(w+2));
  vector<vector<int>> l(h+2,vector<int>(w+2));
  vector<vector<int>> r(h+2,vector<int>(w+2));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++) cin>>v[i][j];
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')u.at(i).at(j)=0;
      else u.at(i).at(j)=u.at(i-1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')d.at(i).at(j)=0;
      else d.at(i).at(j)=d.at(i+1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')l.at(i).at(j)=0;
      else l.at(i).at(j)=l.at(i).at(j-1)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')r.at(i).at(j)=0;
      else r.at(i).at(j)=r.at(i).at(j+1)+1;
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
    }
  }
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:73: error: expected ';' before '}' token
   41 |       a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
      |                                                                         ^
      |                                                                         ;
   42 |     }
      |     ~
Language: C++

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

int main(){
  int h,w,a=0;
  cin>>h>>w;
  vector<vector<char>> v(h+2,vector<char>(w+2,'#'));l
  vector<vector<int>> u(h+2,vector<int>(w+2));
  vector<vector<int>> d(h+2,vector<int>(w+2));
  vector<vector<int>> l(h+2,vector<int>(w+2));
  vector<vector<int>> r(h+2,vector<int>(w+2));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++) cin>>v[i][j];
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')u.at(i).at(j)=0;
      else u.at(i).at(j)=u.at(i-1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')d.at(i).at(j)=0;
      else d.at(i).at(j)=d.at(i+1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')l.at(i).at(j)=0;
      else l.at(i).at(j)=l.at(i).at(j-1)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')r.at(i).at(j)=0;
      else r.at(i).at(j)=r.at(i).at(j+1)+1;
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
    }
  }
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:53: error: 'l' was not declared in this scope
    7 |   vector<vector<char>> v(h+2,vector<char>(w+2,'#'));l
      |                                                     ^
a.cc:17:29: error: 'u' was not declared in this scope
   17 |       if(v.at(i).at(j)=='#')u.at(i).at(j)=0;
      |                             ^
a.cc:18:12: error: 'u' was not declared in this scope
   18 |       else u.at(i).at(j)=u.at(i-1).at(j)+1;
      |            ^
a.cc:41:15: error: 'u' was not declared in this scope
   41 |       a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
      |               ^
Language: C++

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

int main(){
  int h,w,a=0;
  cin>>h>>w;
  vector<vector<char>> v(h+2,vector<char>(w+2,'#'));l
  vector<vector<int>> u(h+2,vector<int>(w+2));
  vector<vector<int>> d(h+2,vector<int>(w+2));
  vector<vector<int>> l(h+2,vector<int>(w+2));
  vector<vector<int>> r(h+2,vector<int>(w+2));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++) cin>>v[i][j];
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')u.at(i).at(j)=0;
      else up.at(i).at(j)=u.at(i-1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')d.at(i).at(j)=0;
      else up.at(i).at(j)=d.at(i+1).at(j)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')l.at(i).at(j)=0;
      else up.at(i).at(j)=l.at(i).at(j-1)+1;
    }
  }
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      if(v.at(i).at(j)=='#')r.at(i).at(j)=0;
      else up.at(i).at(j)=r.at(i).at(j+1)+1;
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
    }
  }
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:53: error: 'l' was not declared in this scope
    7 |   vector<vector<char>> v(h+2,vector<char>(w+2,'#'));l
      |                                                     ^
a.cc:17:29: error: 'u' was not declared in this scope
   17 |       if(v.at(i).at(j)=='#')u.at(i).at(j)=0;
      |                             ^
a.cc:18:12: error: 'up' was not declared in this scope; did you mean 'dup'?
   18 |       else up.at(i).at(j)=u.at(i-1).at(j)+1;
      |            ^~
      |            dup
a.cc:18:27: error: 'u' was not declared in this scope
   18 |       else up.at(i).at(j)=u.at(i-1).at(j)+1;
      |                           ^
a.cc:24:12: error: 'up' was not declared in this scope; did you mean 'dup'?
   24 |       else up.at(i).at(j)=d.at(i+1).at(j)+1;
      |            ^~
      |            dup
a.cc:30:12: error: 'up' was not declared in this scope; did you mean 'dup'?
   30 |       else up.at(i).at(j)=l.at(i).at(j-1)+1;
      |            ^~
      |            dup
a.cc:36:12: error: 'up' was not declared in this scope; did you mean 'dup'?
   36 |       else up.at(i).at(j)=r.at(i).at(j+1)+1;
      |            ^~
      |            dup
a.cc:41:15: error: 'u' was not declared in this scope
   41 |       a=max(a,u.at(i).at(j)+d.at(i).at(j)+l.at(i).at(j)+r.at(i).at(j)-3)
      |               ^
Language: C

#include <cstdio>
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};//0 right 1 up 2left 3 down
bool map[2005][2005];
int dir[2005][2005][4];
int h,w,ans=0,tot;
int check(const int &x,const int &y,const int &d){
	if(dir[x][y][d]!=0)	return dir[x][y][d];
	if(map[x][y]||x>h||x<1||y>w||y<1)	return 0;
	return dir[x][y][d]=1+check(x+dx[d],y+dy[d],d);
}
int main(){
	scanf("%d %d ",&h,&w);
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++)
			if(getchar()=='#')	map[i][j]=true;
		getchar();
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(!map[i][j]){
				tot=1;
				for(int d=0;d<4;d++)	tot+=check(i+dx[d],j+dy[d],d);
				if(tot>ans)	ans=tot;
			}
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class lt {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int h = in.nextInt(), w = in.nextInt();
        char[][] areaCharred = new char[h][w];
        int[][] horizontalLight = new int[h][w];
        int[][] verticalLight = new int[w][h];
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < h; i++){
            areaCharred[i] = in.next().toCharArray();
        }
        for (int i = 0; i < h; i++){
            int prevH = 0;
            for (int j = 0; j < w; j++){
                if (areaCharred[i][j] == '#'){
                    Arrays.fill(horizontalLight[i], prevH, j, j - prevH);
                    prevH = j + 1;
                }
            }
            Arrays.fill(horizontalLight[i], prevH, w, w - prevH);
        }
        for (int i = 0; i < w; i++){
            int prevV = 0;
            for (int j = 0; j < h; j++){
                if (areaCharred[j][i] == '#') {
                    Arrays.fill(verticalLight[i], prevV, j, j - prevV);
                    prevV = j + 1;
                }
            }
            Arrays.fill(verticalLight[i], prevV, h, h - prevV);
        }
        for (int i = 0; i < h; i++){
            for (int j = 0; j < w; j++){
                max = Math.max(horizontalLight[i][j] + verticalLight[j][i] - 1, max);
            }
        }
        System.out.println(max);
    }
}


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

#include <cstdio>
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};//0 right 1 up 2left 3 down
bool map[2005][2005];
int h,w,ans=0,tot;
int check(const int &x,const int &y,const int &d){
	if(map[x][y]||x>h||x<1||y>w||y<1)	return 0;
	return 1+check(x+dx[d],y+dy[d],d);
}
int main(){
	scanf("%d %d ",&h,&w);
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++)
			if(getchar()=='#')	map[i][j]=true;
		getchar();
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(!map[i][j]){
				tot=1;
				for(int d=0;d<4;d++)	tot+=check(i+dx[d],j+dy[d],d);
				if(tot>ans)	ans=tot;
			}
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

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(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(j, w) {
        vector<int> done(h);
        rep(i, 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[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:36:31: error: expected primary-expression before '+=' token
   36 |                 cnt[i][j+k] = += l;
      |                               ^~
a.cc:58:31: error: expected primary-expression before '+=' token
   58 |                 cnt[i+k][j] = += l;
      |                               ^~
Language: C

#include <stdio.h>



int main (){
    int H, W;
    int i, j;
    int max =0;
    int buff;
    scanf("%d %d", &H, &W);
    char s[2001][2001]; 
    
    for(i=0; i<H; ++i){
        scanf("%s", s[i]);
    }
    
    int L[H][M], R[H][M], D[H][M], U[H][M];

    for(i=0; i< H ; ++i){
        L[i][j]=0;
        for(j=0; j< W; ++j){
            if(s[i][j] == '#'){
                L[i][j]=0;
            }else if(j==0){
                L[i][j]=1;
            }else{
                L[i][j]= L[i][j-1]+1;
            }
            
        }
       
    }

    for(i=0; i< H ; ++i){
        R[i][j]=0;
        for(j=W-1; j >= 0 ; --j){
            if(s[i][j] == '#'){
                R[i][j]=0;
            }else if(j==W-1){
                R[i][j]=1;
            }else{
                R[i][j]= R[i][j+1]+1;
            }

        }
    }

    for(i=H-1; i >= 0 ; --i){
        U[i][j]=0;
        for(j=0; j< W; ++j){
            if(s[i][j] == '#'){
                U[i][j]=0;
            }else if(i==H-1){
                U[i][j]=1;
            }else{
                U[i][j]= U[i+1][j]+1;
            }

        }
    }

    for(i=0; i < H ; ++i){
        D[i][j]=0;
        for(j=0; j< W; ++j){
            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;
            }

        }
    }
    for(i=0; i<H; ++i){
        for(j=0; j<W; ++j){
            buff = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3;
            if(max < buff){
                max = buff;
            }
        }

    }
    
    printf("%d", max);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:14: error: 'M' undeclared (first use in this function)
   17 |     int L[H][M], R[H][M], D[H][M], U[H][M];
      |              ^
main.c:17:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>



int main (){
    int H, W;
    int i, j;
    int max =0;
    int buff;
    scanf("%d %d", &H, &W);
    char s[2001][2001]; 
    
    for(i=0; i<H; ++i){
        scanf("%s", s[i]);
    }
    
    int L[H*M][H*M], R[H*M][H*M], D[H*M][H*M], U[H*M][H*M];

    for(i=0; i< H ; ++i){
        L[i][j]=0;
        for(j=0; j< W; ++j){
            if(s[i][j] == '#'){
                L[i][j]=0;
            }else if(j==0){
                L[i][j]=1;
            }else{
                L[i][j]= L[i][j-1]+1;
            }
            
        }
       
    }

    for(i=0; i< H ; ++i){
        R[i][j]=0;
        for(j=W-1; j >= 0 ; --j){
            if(s[i][j] == '#'){
                R[i][j]=0;
            }else if(j==W-1){
                R[i][j]=1;
            }else{
                R[i][j]= R[i][j+1]+1;
            }

        }
    }

    for(i=H-1; i >= 0 ; --i){
        U[i][j]=0;
        for(j=0; j< W; ++j){
            if(s[i][j] == '#'){
                U[i][j]=0;
            }else if(i==H-1){
                U[i][j]=1;
            }else{
                U[i][j]= U[i+1][j]+1;
            }

        }
    }

    for(i=0; i < H ; ++i){
        D[i][j]=0;
        for(j=0; j< W; ++j){
            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;
            }

        }
    }
    for(i=0; i<H; ++i){
        for(j=0; j<W; ++j){
            buff = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3;
            if(max < buff){
                max = buff;
            }
        }

    }
    
    printf("%d", max);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:13: error: 'M' undeclared (first use in this function)
   17 |     int L[H*M][H*M], R[H*M][H*M], D[H*M][H*M], U[H*M][H*M];
      |             ^
main.c:17:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<algorithm>
#include<bitset>
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
long long n,w;
string a[2005];
long long Left[2005][2005],Right[2005][2005],Up[2005][2005],Down[2005][2005];
long long main()
{
    cin>>n>>w;
    for(long long i=0;i<n;i++)
		cin>>a[i];
    for(long long i=0;i<n;i++)//左 
	{
        long long cur=0;
        for(long long j=0;j<w;j++)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Left[i][j]=cur;
        }
    }
    for(long long i=0;i<n;i++)//右 
	{
        long long cur=0;
        for(long long j=w-1;j>=0;j--)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Right[i][j]=cur;
        }
    }
    for(long long j=0;j<w;j++)//上 
	{
        long long cur=0;
        for(long long i=0;i<n;i++)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Up[i][j]=cur;
        }
    }
    for(long long j=0;j<w;j++)//下 
	{
        long long cur=0;
        for(long long i=n-1;i>=0;i--)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Down[i][j]=cur;
        }
    }
    long long ans=0;
    for(long long i=0;i<n;i++)
        for(long long j=0;j<w;j++)
		{
            if(a[i][j]=='#')
				continue;
            ans=max(ans,Left[i][j]+Right[i][j]+Up[i][j]+Down[i][j]-3);
        }
    cout<<ans;
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<algorithm>
#include<bitset>
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
long long n,w;
string a[2005];
long long Left[2005][2005],Right[2005][2005],Up[2005][2005],Down[2005][2005];
long long main()
{
    cin>>n>>w;
    for(long long i=0;i<n;i++)
		cin>>a[i];
    for(long long i=0;i<n;i++)//左 
	{
        long long cur=0;
        for(long long j=0;j<w;j++)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Left[i][j]=cur;
        }
    }
    for(long long i=0;i<n;i++)//右 
	{
        long long cur=0;
        for(long long j=w-1;j>=0;j--)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Right[i][j]=cur;
        }
    }
    for(long long j=0;j<w;j++)//上 
	{
        long long cur=0;
        for(long long i=0;i<n;i++)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Up[i][j]=cur;
        }
    }
    for(long long j=0;j<w;j++)//下 
	{
        long long cur=0;
        for(long long i=n-1;i>=0;i--)
		{
            if(a[i][j]=='#')
				cur=0;
            else
				cur++;
            Down[i][j]=cur;
        }
    }
    long long ans=0;
    for(long long i=0;i<n;i++)
        for(long long j=0;j<w;j++)
		{
            if(a[i][j]=='#')
				continue;
            ans=max(ans,Left[i][j]+Right[i][j]+Up[i][j]+Down[i][j]-3);
        }
    cout<<ans;
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>

using namespace std;

const long long MOD = 1000000007LL;
long long GCD(long long a, long long b){return b == 0 ? a : GCD(b, a % b);}

vector<string> a;

int hor_best[2001][2001], ver_best[2001][2001];

int main(){

    cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n, m;

    cin >> n >> m;

    for(int i = 0; i < n; ++i){
        string c;
        cin >> c;
        a.push_back(c);
    }

    // Horizontal

    for(int x = 0; x < n; ++x){
        int cur = 0;
        for(int y = 0; y < m; ++y){
            if(a[x][y] == '#'){
                for(int py = y - cur; py < y; ++py)
                    hor_best[x][py] = cur;
                cur = 0;
            } else {
                ++cur;
            }
        }
        for(int py = m - cur; py < m; ++py)
            hor_best[x][py] = cur;
    }

    // Vertical

    for(int y = 0; y < m; ++y){
        int cur = 0;
        for(int x = 0; x < n; ++x){
            if(a[x][y] == '#'){
                for(int px = x - cur; px < x; ++px)
                    ver_best[px][y] = cur;
                cur = 0;
            } else {
                ++cur;
            }
        }
        for(int px = n - cur; px < n; ++px)
            ver_best[px][y] = cur;
    }

    int best = 0;

    for(int x = 0; x < n; ++x){
        for(int y = 0; y < m; ++y){
            best = max(best, hor_best[x][y] + ver_best[x][y] - 1);

    cout << best;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:65:31: note: to match this '{'
   65 |     for(int x = 0; x < n; ++x){
      |                               ^
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#include <iterator>
#include "prettyprint.hpp"

using namespace std;
using ll = long long;

int Left[2100][2100], Right[2100][2100], Up[2100][2100], Down[2100][2100];

int main()
{
    int H, W;
    vector<string> fi;
    cin >> H >> W;
    fi.resize(H);
    for (int i = 0; i < H; i++)
    {
        cin >> fi[i];
        // cout << fi[i] << endl;
    }

    // Left accumulation.
    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;
        }
    }

    // Right accumulation.
    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;
        }
    }

    // Up accumulation.
    for (int j = 0; j < W; j++)
    {
        int cur = 0;
        for (int i = 0; i < H; i++)
        {
            if (fi[i][j] == '#')
            {
                cur = 0;
            }
            else
            {
                cur++;
            }
            Up[i][j] = cur;
        }
    }

    // Down accumulation.
    for (int j = 0; j < W; j++)
    {
        int cur = 0;
        for (int i = H - 1; i >= 0; i--)
        {
            if (fi[i][j] == '#')
            {
                cur = 0;
            }
            else
            {
                cur++;
            }
            Down[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] + Up[i][j] + Down[i][j] - 3);
        }
    }
    cout << res << endl;
}

Compiler output:
a.cc:15:10: fatal error: prettyprint.hpp: No such file or directory
   15 | #include "prettyprint.hpp"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.io.*;

public class Main
{
  int h, w, max = 0;
  int[][] x;
  char[][] g;
  
  Main(Scanner in, PrintWriter out)
  {
    g = new char[h = in.nextInt()][w = in.nextInt()];
    for (int i = 0; i < h; i++)
      g[i] = in.next().toCharArray();
    
    x = new int[h][w];
    for (int i = 0; i < h; i++)
    {
      int at = 0, st = 0;
      while (at < w)
      {
        int cnt = 0;
        st = at;
        while (at < w && g[i][at] != '#')
        {
          cnt++;
          at++;
        }
        for (int j = st; j < at; j++)
          x[i][j] += cnt;
        at++;
      }
    }
    
    for (int i = 0; i < w; i++)
    {
      int at = 0, st = 0;
      while (at < h)
      {
        int cnt = 0;
        st = at;
        while (at < h && g[at][i] != '#')
        {
          cnt++;
          at++;
        }
        for (int j = st; j < at; j++)
          x[j] += cnt;
        at++;
      }
    }
    
    for (int[] y : x)
      for (int z : y)
        max = Math.max(max, z-1);
    out.println(max);
  }

  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new	Main(in, out);
    out.close();
  } 
}


Compiler output:
Main.java:48: error: bad operand types for binary operator '+'
          x[j] += cnt;
               ^
  first type:  int[]
  second type: int
1 error
Language: C++

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

int main()
{
	int h, w;
	cin >> h >> w;
	vector<vector<int>> matrix(h, vector<int>(w, 0));
	{
		string str;
		for (int i = 0; i < h; ++i) {
			cin >> str;
			for (int j = 0; j < w; ++j) {
				if (str[j] == '#') {
					matrix[i][j] = 1;
				}
			}
		}
	}

	int maxLight = 0;
	int numLight = 0;
	int temp = x;
	for (int y = 0; y < h; ++y) {
		for (int x = 0; x < w; ++x) {
			if (matrix[y][x]) {
				continue;
			}

			numLight = 0;
			temp = x;
			while (-1 < --temp && !matrix[y][temp]) {
				++numLight;
			}
			temp = x;
			while (++temp < w && !matrix[y][temp]) {
				++numLight;
			}
			temp = y;
			while (-1 < --temp && !matrix[temp][x]) {
				++numLight;
			}
			temp = y;
			while (++temp < h && !matrix[temp][x]) {
				++numLight;
			}
			if (maxLight < ++numLight) {
				maxLight = numLight;
			}
		}
	}

	cout << maxLight << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'x' was not declared in this scope
   25 |         int temp = x;
      |                    ^
Language: C++

#include<bits/stdc++.h>

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
// typedef pair<ll,ll> p;

int h,w;
int r[2010][2010], l[2010][2010], u[2010][2010], d[2010][2010];


int main(){
  cin >> h >> w;
  vector<string> c(h);
  for(int i=0; i< w; i++) cin >> c[i];

  //左からの探索
  // for(int i = 0; i < h; i++){
  //   for(int j = 0; j < w; j++){
  //         if(c[i][j]=='#')l[i][j] = 0;
  //         else if (j==0)l[i][j] = 1;
  //         else l[i][j] = l[i][j-1]+1;
  //   }
  // }

   for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) {
            if(c[i][j] == '#') {
                l[i][j] = 0;
            } else {
                if(j > 0) {
                    l[i][j] = l[i][j - 1] + 1;
                } else {
                    l[i][j] = 1;
                }
            }
        }
    }

  //右からの探索
  // for(int i = 0; i < h; i++){
  //   for(int j = w-1; j >= 0; j--){
  //         if(c[i][j]=='#')r[i][j] = 0;
  //         else if (j==w-1)r[i][j] = 1;
  //         else r[i][j] = r[i][j+1]+1;
  //   }
  // }
  for(int i = 0; i < h; i++) {
    for(int j = w - 1; j >= 0; j--) {
        if(c[i][j] == '#') {
            r[i][j] = 0;
        } else {
            if(j < w - 1) {
                r[i][j] = r[i][j + 1] + 1;
            } else {
                r[i][j] = 1;
            }
        }
      }
  }

  //下からの探索
  // for(int i = 0; i < h; i++){
  //   for(int j = 0; j < w; j++){
  //         if(c[i][j]=='#')u[i][j] = 0;
  //         else if (i==0)u[i][j] = 1;
  //         else u[i][j] = u[i-1][j] + 1;
  //   }
    
  // }
  for(int j = 0; j < w; j++) {
    for(int i = 0; i < h; i++) {
        if(c[i][j] == '#') {
            u[i][j] = 0;
        } else {
            if(i > 0) {
                u[i][j] = u[i - 1][j] + 1;
            } else {
                u[i][j] = 1;
            }
        }
    }
  }
  上からの探索
  for(int i = h-1; i >= 0; i--){
    for(int j = 0; j < w; j++){
          if(c[i][j]=='#')d[i][j] = 0;
          else if (i==h-1)d[i][j] = 1;
          else d[i][j] = d[i+1][j] + 1;
    }
  }

  int ans = 0;
  for(int i=0; i<h;i++){
    for(int j=0; j<w; j++){
      if(c[i][j] == '.'){
        ans = max(ans, u[i][j]+d[i][j]+r[i][j]+l[i][j]-3);
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:3: error: '\U00004e0a\U0000304b\U00003089\U0000306e\U000063a2\U00007d22' was not declared in this scope
   90 |   上からの探索
      |   ^~~~~~~~~~~~
a.cc:91:20: error: 'i' was not declared in this scope
   91 |   for(int i = h-1; i >= 0; i--){
      |                    ^
Language: C++

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

int h,m;
int ma=0x80000000;
int visted[10000][10000]= {0};
int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};

void dfs(int i,int j,string s[])
{
    int ni,nj;
    if(s[i][j]=='.')
    {
        int t=1;
        for(int k=i+1; s[k][j]=='.'&&k<h; k++)
            t++;
        for(int k=i-1,l=0; s[k][j]=='.'&&k>=0; k--,l++)
            t++;
        for(int k=j+1; s[i][k]=='.'&&k<m; k++)
            t++;
        for(int k=j-1,l=0; s[i][k]=='.'&&k>=0; k--,l++)
            t++;
        if(t>ma)
            ma=t;
    }
    for(int a=0; a<=3; a++)
    {
        ni=i+next[a][0];
        nj=j+next[a][1];
        if(ni<0||ni>=h||nj<0||nj>=m)
            continue;
        if(s[ni][nj]=='.'&&visted[ni][nj]==0)
        {
            visted[ni][nj]=1;
            dfs(ni,nj,s);
            visted[ni][nj]=0;
        }
    }
    return ;
}

int main()
{
    cin>>h>>m;
    string s[m];
    for(int i=0; i<h; i++)
        cin>>s[i];
    dfs(0,0,s);
    cout<<ma;
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, std::string*)':
a.cc:28:14: error: reference to 'next' is ambiguous
   28 |         ni=i+next[a][0];
      |              ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:5: note:                 'int next [4][2]'
    7 | int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};
      |     ^~~~
a.cc:29:14: error: reference to 'next' is ambiguous
   29 |         nj=j+next[a][1];
      |              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:5: note:                 'int next [4][2]'
    7 | int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};
      |     ^~~~
Language: C++

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

int h,m;
int ma=0x80000000;
int visted[10000][10000]= {0};
const int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};

void dfs(int i,int j,string s[])
{
    int ni,nj;
    if(s[i][j]=='.')
    {
        int t=1;
        for(int k=i+1; s[k][j]=='.'&&k<h; k++)
            t++;
        for(int k=i-1,l=0; s[k][j]=='.'&&k>=0; k--,l++)
            t++;
        for(int k=j+1; s[i][k]=='.'&&k<m; k++)
            t++;
        for(int k=j-1,l=0; s[i][k]=='.'&&k>=0; k--,l++)
            t++;
        if(t>ma)
            ma=t;
    }
    for(int a=0; a<=3; a++)
    {
        ni=i+next[a][0];
        nj=j+next[a][1];
        if(ni<0||ni>=h||nj<0||nj>=m)
            continue;
        if(s[ni][nj]=='.'&&visted[ni][nj]==0)
        {
            visted[ni][nj]=1;
            dfs(ni,nj,s);
            visted[ni][nj]=0;
        }
    }
    return ;
}

int main()
{
    cin>>h>>m;
    string s[m];
    for(int i=0; i<h; i++)
        cin>>s[i];
    dfs(0,0,s);
    cout<<ma;
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, std::string*)':
a.cc:28:14: error: reference to 'next' is ambiguous
   28 |         ni=i+next[a][0];
      |              ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:11: note:                 'const int next [4][2]'
    7 | const int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};
      |           ^~~~
a.cc:29:14: error: reference to 'next' is ambiguous
   29 |         nj=j+next[a][1];
      |              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:11: note:                 'const int next [4][2]'
    7 | const int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}};
      |           ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int rows[2000][2000] ={};
int columns[2000][2000]= {};

int main(){
  int h, w;
  cin >> h, w;
  vector<string> s_vec;
  for(int i = 0; i<h; ++i){
    string s;
    cin >> s;
    s_vec.push_back(s);
  }
  for(int i=0;i<h; ++i){
    for(int j=0;j<w; ++j){
      if(j == 0) continue;
      if(s_vec[i][j] == "#") rows[i][j] = 0;
      if(s_vec[i][j] == "." ) rows[i][j] = rows[i][j -1] +1;
    }
  }
  for(int i=0;i<w; ++i){
    for(int j=0;j<h; ++j){
      if(j == 0) continue;
      if(s_vec[i][j] == "#") columns[i][j] = 0;
      if(s_vec[i][j] == "." ) columns[i][j] = columns[i-1][j] +1;
    }
  }
}
        
        
        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |       if(s_vec[i][j] == "#") rows[i][j] = 0;
a.cc:21:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |       if(s_vec[i][j] == "." ) rows[i][j] = rows[i][j -1] +1;
a.cc:27:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |       if(s_vec[i][j] == "#") columns[i][j] = 0;
a.cc:28:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |       if(s_vec[i][j] == "." ) columns[i][j] = columns[i-1][j] +1;
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N=2003;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
	int n,m;
	cin >>n>>m;
	char mp[2003][2003];
	for(int i=1;i<=n;i++)scanf("%s",mp[i]+1);
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
	for(int i=n;i;i--)
	for(int j=m;j;j--)
	if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
	printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: redeclaration of 'int n'
    9 |         int n,m;
      |             ^
a.cc:8:5: note: 'int n' previously declared here
    8 | int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
      |     ^
a.cc:9:15: error: redeclaration of 'int m'
    9 |         int n,m;
      |               ^
a.cc:8:7: note: 'int m' previously declared here
    8 | int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
      |       ^
Language: C++

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

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
	int h,w;
	cin >>h>>w;
	char mp[2003][2003];
	for(int i=1;i<=n;i++)scanf("%s",mp[i]+1);
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
	for(int i=n;i;i--)
	for(int j=m;j;j--)
	if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
	printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'N' was not declared in this scope
    8 | int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
      |                ^
a.cc:15:26: error: 'f1' was not declared in this scope; did you mean 'y1'?
   15 |         if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
      |                          ^~
      |                          y1
a.cc:15:48: error: 'f2' was not declared in this scope
   15 |         if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
      |                                                ^~
a.cc:18:26: error: 'f3' was not declared in this scope
   18 |         if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
      |                          ^~
a.cc:18:48: error: 'f4' was not declared in this scope
   18 |         if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
      |                                                ^~
a.cc:21:38: error: 'f1' was not declared in this scope; did you mean 'y1'?
   21 |         if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
      |                                      ^~
      |                                      y1
a.cc:21:47: error: 'f2' was not declared in this scope
   21 |         if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
      |                                               ^~
a.cc:21:56: error: 'f3' was not declared in this scope
   21 |         if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
      |                                                        ^~
a.cc:21:65: error: 'f4' was not declared in this scope
   21 |         if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
      |                                                                 ^~
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>> cnt(h,vector<int>(w));

  //縦と横に見る.

  for(int i = 0;i < h;i++){
    vector<int> done(w);
    for(int j = 0;j < w;j++){
      if(s[i][j] == '#')continue;//障害物ならcontinue
      if(done[j])continue;//既に参照済みならcontinue
      int l = 0;
      while(j + l < w){//#でない初めてのグリッドがここに入る.
        if(s[i][j+1] == '#')break;
        ++l;
      }
      for(int k = 0;k < l;k++){
        cnt[i][j+k] += l;//左からすでに見たものとして埋めていく.
        done[j+k] = 1;
      }
    }
  }

  for(int j = 0;j < w;i++){
    vector<int> done(h);
    for(int i = 0;i < h;j++){
      if(s[i][j] == '#')continue;
      if(done[i])continue;
      int l = 0;
      while(i + l < h){
        if(s[i+l][j] == '#')break;
        ++l;
      }
      for(int k = 0;k < l;k++){
        cnt[i+k][j] += l;
        done[i+k] = 1;
      }
    }
  }

  int ans = 0;
  for(int i = 0;i < h;i++)
    for(int j = 0;j < w;j++)ans = max(ans,cnt[i][j] - 1);

  cout << ans << endl;

  return 0;
}


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

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


signed main(){
	int h,w;cin>>h>>w;
	for(auto&& u:s)cin>>u;

	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));

//  int l[h+2][w+2],r[h+2][w+2],u[h+2][w+2],d[h+2][w+2];

	rep0(i,h)rep0(j,w){
		if(s[i-1][j-1]=='.'){
		l[i][j]=l[i][j-1]+1;
		u[i][j]=u[i-1][j]+1;
		}
	}
	rep1(i,h)rep1(j,w){
		if(s[i-1][j-1]=='.'){
		r[i][j]=r[i][j+1]+1;
		d[i][j]=d[i+1][j]+1;
	}
	}
	int ret=0;
	rep0(i,h)rep0(j,w){
	if(s[i-1][j-1]=='.')ret=max(ret,l[i][j]+u[i][j]+r[i][j]+l[i][j]-3);
	}
	cout<<ret<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 's' was not declared in this scope
   11 |         for(auto&& u:s)cin>>u;
      |                      ^
a.cc:21:20: error: 's' was not declared in this scope
   21 |                 if(s[i-1][j-1]=='.'){
      |                    ^
a.cc:27:20: error: 's' was not declared in this scope
   27 |                 if(s[i-1][j-1]=='.'){
      |                    ^
a.cc:34:12: error: 's' was not declared in this scope
   34 |         if(s[i-1][j-1]=='.')ret=max(ret,l[i][j]+u[i][j]+r[i][j]+l[i][j]-3);
      |            ^
Language: C++

//#pragma GCC optimize("Ofast")
//#pragma GCC optimization ("O3")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define fi first
#define se second
#define pii pair<int,int>
#define push_back emplace_back
#define push emplace
#define insert emplace
//#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 10000000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n,m;
	cin>>n>>m;
	string s[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	int prej[n][m],sucj[n][m],prei[n][m],suci[n][m];
	fot(int i=0;i<n;i++){
		int x=-1;
		for(int j=0;j<m;j++){
			if(s[i][j]=='#')x=j;
			prej[i][j]=x;
		}
		x=m;
		for(int j=m-1;j>=0;j--){
			if(s[i][j]=='#')x=j;
			sucj[i][j]=x;
		}
	}
	for(int j=0;j<m;j++){
		int x=-1;
		for(int i=0;i<n;i++){
			if(s[i][j]=='#')x=i;
			prei[i][j]=x;
		}
		x=n;
		for(int i=n-1;i>=0;i--){
			if(s[i][j]=='#')x=i;
			suci[i][j]=x;
		}	
	}
	int x=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(s[i][j]=='#')continue;
			x=max(x,suci[i][j]+sucj[i][j]-prei[i][j]-prej[i][j]-2);
		}
	}
	x--;
	cout<<x;
	return 0;

}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:35:13: error: expected primary-expression before 'int'
   35 |         fot(int i=0;i<n;i++){
      |             ^~~
a.cc:35:21: error: 'i' was not declared in this scope
   35 |         fot(int i=0;i<n;i++){
      |                     ^
Language: C++

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


signed main(){
	int h,w;cin>>h>>w;
	vector<string>s(h);
	for(auto&& u:s)cin>>u;

	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));

	for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
		if(s[i][j]=='.'){
		l[i][j]=l[i][j-1]+1;
		u[i][j]=u[i-1][j]+1;
		}
	}
	for(int i=h;i>=1;i--)for(int j=w;j>=1;j--){
		if(s[i][j]=='.'){
		r[i][j]=r[i][j+1]+1;
		d[i][j]=d[i+1][j]+1;
	}
	}
	int ret=0;
	for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
	if(s[i][j]=='.')ret=max(ret,l[i][j]+u[i][j]+r[i][j]+l[i][j]-3);
	}
	cout<<rep<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'rep' was not declared in this scope
   35 |         cout<<rep<<endl;
      |               ^~~
Language: C++

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


signed main(){
	int h,w;cin>>h>>w;
	vector<string>s(h);
	for(auto&& u:s)cin>>u;

	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)rep(j,w){
		if(s[i][j]=='.'){
		l[i][j+1]=l[i][j]+1;
		u[i+1][j]=u[i][j]+1;
		}
	}
	repr(i,h+1)repr(j,w+1){
		if(s[i][j]=='.'){
		r[i][j]=r[i][j+1]+1;
		d[i][j]=d[i+1][j]+1;
	}
	}
	int ret=0;
	repf(i,1,h+1)repf(j,1,w+1){
	if(s[i][j]=='.')ret=max(ret,l[i][j]+u[i][j]+r[i][j]+l[i][j]-3);
	}
	cout<<rep<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'rep' was not declared in this scope
   35 |         cout<<rep<<endl;
      |               ^~~
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(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(j,w) {
	vector<int> done(h);
	rep(j,w) {
	  if (s[i][j] == '#') continue;
	  if (done[i]) continue;
	  int l = 0;
	  while(j+l < w) {
		if (s[i][j+l] == '#') 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:30:17: error: 'i' was not declared in this scope
   30 |           if (s[i][j] == '#') continue;
      |                 ^
a.cc:31:20: error: 'i' was not declared in this scope
   31 |           if (done[i]) continue;
      |                    ^
a.cc:34:23: error: 'i' was not declared in this scope
   34 |                 if (s[i][j+l] == '#') break;
      |                       ^
a.cc:38:21: error: 'i' was not declared in this scope
   38 |                 cnt[i+k][j] += l;
      |                     ^