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


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <cstdint>
#include <tuple>
#include <numeric>
#define M_PI       3.14159265358979323846


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FILL(a, x) memset(a, x, sizeof(a))

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)

const LL MOD = 1000000007;

const int N = 2005;
char board[N][N];
int xx[N][N], yy[N][N];

int main() {
	int h,w;
	scanf("%d%d", &h, &w);
	REP(i, h)scanf("%s", &board[i][1]);
	REP(i, h + 2)board[i][0] = board[i][w + 1] = '#';
	REP(i, w + 2)board[0][i] = board[h+1][i] = '#';
	FOR(i, 1, h+1) {
		REP(j, 1, w+1) {
			int sx = 1;
			while (sx != w + 1) {
				int tx = sx;
				while (board[i][tx] == '.')tx++;
				FOR(k, sx, tx)xx[i][k] = tx - sx;
				sx = tx+1;
			}
			int sy = 1;
			while (sy != h + 1) {
				int ty = sy;
				while (board[ty][j] == '.')ty++;
				FOR(k, sy, ty)yy[k][j] = ty - sy;
				sy = ty+1;
			}
		}
	}
	int ret = 0;
	FOR(i, 1, h+1)FOR(j, 1, w+1)ret = max(ret, xx[i][j] + yy[i][j]);
	printf("%d\n", ret);
	return 0;
}

Compiler output:
a.cc:81:30: error: macro "REP" passed 3 arguments, but takes just 2
   81 |                 REP(j, 1, w+1) {
      |                              ^
a.cc:66:9: note: macro "REP" defined here
   66 | #define REP(i,n) FOR(i,0,n)
      |         ^~~
a.cc: In function 'int main()':
a.cc:81:17: error: 'REP' was not declared in this scope
   81 |                 REP(j, 1, w+1) {
      |                 ^~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
 
string s[2000];
int h, w;
typedef struct save
{
    int check = -1;
    int left = 0;
    int up = 0;
    int right = 0;
    int down = 0;
} save_t;
save_t save[2000][2000];
int comp(int x, int y)
{
    int res[4];
    res[0] = 0; res[1] = 0; res[2] = 0; res[3] = 0;
    int i = 0;
    if(y-1 >= 0 && save[x][y-1].check != -1)
    {
        res[0] = save[x][y-1].left+1;
    }
    else
    {
        for (i = y-1; i >= 0; i--)
        {
            if(s[x][i] != '#')
            {
                res[0]++;
            }
            else
            {
                break;
            }
        }
    }
    if(y-1 >= 0 && save[x][y-1].check != -1)
    {
        res[1] = save[x][y-1].right-1;
    }
    else
    {
    for (i = y+1; i < w; i++)
    {
        if(s[x][i] != '#')
        {
            res[1]++;
        }
        else
        {
            break;
        }
    }
    }

    if(x-1 >= 0 && save[x-1][y].check != -1)
    {
        res[2] = save[x-1][y].down-1;
    }
    else
    {
    for (i = x+1; i < h; i++)
    {
        if(s[i][y] != '#')
        {
            res[2]++;
        }
        else
        {
            break;
        }
    }
    }

    if(x-1 >= 0 && save[x-1][y].check != -1)
    {
        res[3] = save[x-1][y].up+1;
    }
    else
    {
        for (i = x-1; i >= 0; i--)
        {
            if(s[i][y] != '#')
            {
                res[3]++;
            }
            else
            {
                break;
            }
        }
    }
 
    save[x][y].check = 1;
    save[x][y].left = res[0];
    save[x][y].up = res[3];
    save[x][y].right = res[1];
    save[x][y].down = res[2];
    return res[0] + res[1] + res[2] + res[3] + 1;
}
 
int main()
{
    cin >> h >> w;
    for (int i = 0; i < h; i++)
    {
        cin >> s[i];
    }
    int ans = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if(s[i][j] == '#')
                continue;
            int num = comp(i, j);
            if(num > ans)
            {
                ans = num;
            }
        }
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc:127:1: fatal error: error writing to /tmp/ccrlfq5f.s: No space left on device
  127 | }
      | ^
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <list>
#include <algorithm>
using namespace std;
 
string s[2000];
int h, w;
typedef struct save
{
    int check = -1;
    int left = 0;
    int up = 0;
    int right = 0;
    int down = 0;
} save_t;
save_t save[2000][2000];
int comp(int x, int y)
{
    int res[4];
    res[0] = 0; res[1] = 0; res[2] = 0; res[3] = 0;
    int i = 0;
    if(y-1 >= 0 && save[x][y-1].check != -1)
    {
        res[0] = save[x][y-1].left+1;
    }
    else
    {
        for (i = y-1; i >= 0; i--)
        {
            if(s[x][i] != '#')
            {
                res[0]++;
            }
            else
            {
                break;
            }
        }
    }
    if(y-1 >= 0 && save[x][y-1].check != -1)
    {
        res[1] = save[x][y-1].right-1;
    }
    else
    {
    for (i = y+1; i < w; i++)
    {
        if(s[x][i] != '#')
        {
            res[1]++;
        }
        else
        {
            break;
        }
    }
    }

    if(x-1 >= 0 && save[x-1][y].check != -1)
    {
        res[2] = save[x-1][y].down-1;
    }
    else
    {
    for (i = x+1; i < h; i++)
    {
        if(s[i][y] != '#')
        {
            res[2]++;
        }
        else
        {
            break;
        }
    }
    }

    if(x-1 >= 0 && save[x-1][y].check != -1)
    {
        res[3] = save[x-1][y].up+1;
    }
    else
    {
        for (i = x-1; i >= 0; i--)
        {
            if(s[i][y] != '#')
            {
                res[3]++;
            }
            else
            {
                break;
            }
        }
    }
 
    save[x][y].check = 1;
    save[x][y].left = res[0];
    save[x][y].up = res[3];
    save[x][y].right = res[1];
    save[x][y].down = res[2];
    return res[0] + res[1] + res[2] + res[3] + 1;
}
 
int main()
{
    cin >> h >> w;
    for (int i = 0; i < h; i++)
    {
        cin >> s[i];
    }
    int ans = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if(s[i][j] == '#')
                continue;
            int num = comp(i, j);
            if(num > ans)
            {
                ans = num;
            }
        }
        
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc:131:1: fatal error: error writing to /tmp/ccJgJVm1.s: No space left on device
  131 | }
      | ^
compilation terminated.
Language: Java

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

public class MainD {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int h = Integer.parseInt(sa[0]);
		int w = Integer.parseInt(sa[1]);
		char[][] s = new char[h][w];
		for (int i = 0; i < h; i++) {
			s[i] = br.readLine().toCharArray();
		}
		br.close();

		int[][] val1 = new int[h][w];
		for (int i = 0; i < h; i++) {
			int idx = -1;
			int cnt = 0;
			for (int j = 0; j < w; j++) {
				if (s[i][j] == '.') {
					cnt++;
				} else {
					for (int k = idx + 1; k < j; k++) {
						val1[i][k] = cnt;
					}
					idx = j;
					cnt = 0;
				}
			}
			if (cnt > 0) {
				for (int k = idx + 1; k < w; k++) {
					val1[i][k] = cnt;
				}
			}
		}

		int[][] val2 = new int[h][w];
		for (int j = 0; j < w; j++) {
			int idx = -1;
			int cnt = 0;
			for (int i = 0; i < h; i++) {
				if (s[i][j] == '.') {
					cnt++;
				} else {
					for (int k = idx + 1; k < i; k++) {
						val2[k][j] = cnt;
					}
					idx = i;
					cnt = 0;
				}
			}
			if (cnt > 0) {
				for (int k = idx + 1; k < h; k++) {
					val2[k][j] = cnt;
				}
			}
		}

		int ans = 0;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (s[i][j] != '#') {
					int val = val1[i][j] + val2[i][j] - 1;
					ans = Math.max(ans, val);
				}
			}
		}
		System.out.println(ans);
	}
}


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

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>

int main(){
  int H, W;
  std::cin >> H >> W;
  std::vector< std::vector<char> > grid(H);
  for(int i=0; i<W; ++i) grid[i].resize(W);
  for(int i=0; i<H; ++i) {
    for(int j=0; j<W; ++j) {
      std::cin >> grid[i][j];
    }
  }
  std::vector< std::vector<int> > numlat(H);
  for(int i=0; i<W; ++i) numlat[i].resize(W);
  std::vector< std::vector<int> > numlon(H);
  for(int i=0; i<W; ++i) numlon[i].resize(W);
  int count=0;
  for(int i=0; i<H; ++i) {
    for(int j=0; j<W; ++j) {
      if(grid[i][j] == "#"){
        for(k=0; k<j; ++k){
          numlat[i][k] = count;
          count = 0;
        }
      }
      else count++;
    }
  }
  for(int j=0; j<W; ++j) {
    for(int i=0; i<H; ++i) {
      if(grid[i][j] == "#"){
        for(k=0; k<j; ++k){
          numlon[k][j] = count;
          count = 0;
        }
      }
      else count++;
    }
  }
  std::vector< std::vector<int> > sum(H);
  for(int i=0; i<W; ++i) sum[i].resize(W);
  int max=0;
  for(int i=0; i<H; ++i){
    for(int j=0; j<W; ++j){
      if( max < numlat[i][j]+numlon[i][j] ) max = numlat[i][j]+numlon[i][j];
    }
  }
  std::cout max-1;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |       if(grid[i][j] == "#"){
a.cc:24:13: error: 'k' was not declared in this scope
   24 |         for(k=0; k<j; ++k){
      |             ^
a.cc:34:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |       if(grid[i][j] == "#"){
a.cc:35:13: error: 'k' was not declared in this scope
   35 |         for(k=0; k<j; ++k){
      |             ^
a.cc:51:12: error: expected ';' before 'max'
   51 |   std::cout max-1;
      |            ^~~~
      |            ;
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#define llong long long
#define INF (__INT32_MAX__ / 2)
#define MAX_HW 2000

using namespace std;
typedef pair<int, int> ipair;

int mp[MAX_HW + 2][MAX_HW + 2], sp1[MAX_HW + 2][MAX_HW + 2];
int H, W;
int main(int argc, char **argv) {
    cin >> H >> W;
    for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j) {
            char ch;
            cin >> ch;
            mp[i][j] = (ch == '#' ? 1 : 0);
        }
    
    for(int i = 0; i < H ++i) {
        int cur = 0;
        for(int j = 0; j < W; ++j) {
            if(mp[i][j] == 1) {
                cur = 0;
            } else {
                sp1[i][j] += cur;
                cur++;
            }
        }
    }

    for(int i = 0; i < H; ++i) {
        int cur = 0;
        for(int j = W - 1; j >= 0; --j) {
            if(mp[i][j] == 1) {
                cur = 0;
            } else {
                sp1[i][j] += cur;
                cur++;
            }
        }
    }

    for(int j = 0; j < W; ++j) {
        int cur = 0;
        for(int i = 0; i < H; ++i) {
            if(mp[i][j] == 1) {
                cur = 0;
            } else {
                sp1[i][j] += cur;
                cur++;
            }
        }
    }

    for(int j = 0; j < W; ++j) {
        int cur = 0;
        for(int i = H - 1; i >= 0; --i) {
            if(mp[i][j] == 1) {
                cur = 0;
            } else {
                sp1[i][j] += cur;
                cur++;
            }
        }
    }

    int res = -INF;
    
    for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
            res = max(res, sp1[i][j]);
    
    cout << (res + 1) << endl;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:31:28: error: expected ';' before 'i'
   31 |     for(int i = 0; i < H ++i) {
      |                            ^
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef long long int int64;
typedef unsigned char uchar8;

#define MAX_W 2000
#define MAX_H 2000

uchar8 S[MAX_H][MAX_W];

int spW[MAX_H];
int spH[MAX_W];

int H = 0;
int W = 0;

int sp_N(int w, int h) {
  int cnt_sp = 0;
  int x,y;

  x = w;
  for (y=h; y>=0; y--) {
    if (S[y][x] == 1) {
      break;
    }
    cnt_sp++;
  }
  
  return cnt_sp;
}

int sp_S(int w, int h) {
  int cnt_sp = 0;
  int x,y;

  x = w;
  for (y=h; y<H; y++) {
    if (S[y][x] == 1) {
      break;
    }
    cnt_sp++;
  }
  
  return cnt_sp;
}

int sp_W(int w, int h) {
  int cnt_sp = 0;
  int x,y;

  y = h;
  for (x=w; x>=0; x--) {
    if (S[y][x] == 1) {
      break;
    }
    cnt_sp++;
  }
  
  return cnt_sp;
}

int sp_E(int w, int h) {
  int cnt_sp = 0;
  int x,y;

  y = h;
  for (x=w; x<W; x++) {
    if (S[y][x] == 1) {
      break;
    }
    cnt_sp++;
  }
  
  return cnt_sp;
}

int main()
{

  int cnt;
  int i,j;
  int cnt_sp;
  int max_sp = 0;
  char str[MAX_W];
 

  cnt = scanf("%d %d", &H, &W);

  for (i=0; i<H; i++) {
   cnt = scanf("%s", (char *)(str));
    str[W]= 0x1;
    for(j=0; j<W; j++) {
      if(str[j] == '#') {
        S[i][j] = 1;
      } else {
        S[i][j] = 0;
      }
    }
  }

  for (i=0; i<H; i++) {
    for (j=0; j<W; j++) {
      if (S[i][j] != 0) continue;
      cnt_sp = 0;
      cnt_sp += sp_N(j,i);
      if (MAX(max_sp, (cnt_sp + W - 1 + (H/2))) == max_sp) continue;
      cnt_sp += sp_S(j,i);
      if (MAX(max_sp, (cnt_sp + W - 2)) == max_sp) continue;
      cnt_sp += sp_W(j,i);
      if (MAX(max_sp, (cnt_sp + (W/2) - 3) == max_sp) continue;
      cnt_sp += sp_E(j,i);
      cnt_sp -= 3;
      max_sp = MAX(max_sp, cnt_sp);
    }
  }

  printf(" %d", max_sp);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:115:55: error: expected ')' before 'continue'
  115 |       if (MAX(max_sp, (cnt_sp + (W/2) - 3) == max_sp) continue;
      |          ~                                            ^~~~~~~~
main.c:119:5: error: expected expression before '}' token
  119 |     }
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>


using namespace std;
vector<vector<int>> yoko(h), tate(w);

int main() {
    int h, w;
    cin >> h >> w;
    for (int i=0; i<h; i++) {
        for (int j=0; j<w; j++) {
            char c; cin >> c;
            if (c == '#') {
                yoko[i].push_back(j);
                tate[j].push_back(i);
                cerr << i << j << endl;
            }
        }
    }
    for (int i=0; i<w; i++) 
        for (auto t:tate[i]) cerr << i << ' ' << t << endl;
    int lamp[h][w];
    for (int i=0; i<h; i++) {
        yoko[i].push_back(w);
        int now=-1;
        size_t len = yoko[i].size();
        for (size_t j=0; j<len; j++) {
            for (int k=now+1; k<yoko[i][j]; k++) {

                cerr << i << ' ' << j << ' ' << k << ' ' << yoko[i][j] << endl;
                lamp[i][k] = yoko[i][j] - now - 1;
            }
            now = yoko[i][j];
            lamp[i][now] = 0;
        }
    }
    for (int i=0; i<h; i++) {
        for (int j=0; j<w; j++) {
            cerr << lamp[i][j] << ' ';
        }
        cerr << endl;
    }
    int best=0;
    for (int i=0; i<w; i++) {
        cerr << tate[i][0] << endl;
        tate[i].push_back(h);
        int now=-1;
        size_t len = tate[i].size();
        for (size_t j=0; j<len; j++) {
            cerr << i << ' ' << j << ' '  << tate[i][j] << endl;
            for (int k=now+1; k<tate[i][j]; k++){
                cerr << i << ' ' << j << ' ' << k << endl;
                best = max(best, lamp[k][i] + tate[i][j] - now - 1);
            }
            now = tate[i][j];
        }
    }
    cout << best << '\n';
    return 0;
}


Compiler output:
a.cc:9:26: error: 'h' was not declared in this scope
    9 | vector<vector<int>> yoko(h), tate(w);
      |                          ^
a.cc:9:35: error: 'w' was not declared in this scope
    9 | vector<vector<int>> yoko(h), tate(w);
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int h,w,m,hida,hidari,migi,mi,ue,uee,sita,si;
  cin>>h>>w;
  vector<vector<char>> data(h, vector<char>(w));
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> data.at(i).at(j);
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if(data.at(i).at(j)=='.'){
        for(hida=i-1; hida>-1; hida=hida-1;){
          if(data.at(hida).at(j)=='#'){
            break;
          }
        }
        hidari=i-hida;
        for(ue=j-1; ue>-1; ue=ue-1;){
          if(data.at(i).at(ue)=='#'){
            break;
          }
        }
        uee=j-ue;
        for(migi=i+1; migi<w; migi=migi+1;){
          if(data.at(migi).at(j)=='#'){
            break;
          }
        }
        mi=migi-i;
        for(sita=i+1; sita<w; sita=sita+1;){
          if(data.at(i).at(sita)=='#'){
            break;
          }
        }
        si=sita-j;
        k=si+mi+uee+hidari+1;
        if(k>m){
          m=k;
        }
      }
    }
  }
  cout<<m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: expected ')' before ';' token
   17 |         for(hida=i-1; hida>-1; hida=hida-1;){
      |            ~                              ^
      |                                           )
a.cc:17:44: error: expected primary-expression before ')' token
   17 |         for(hida=i-1; hida>-1; hida=hida-1;){
      |                                            ^
a.cc:23:35: error: expected ')' before ';' token
   23 |         for(ue=j-1; ue>-1; ue=ue-1;){
      |            ~                      ^
      |                                   )
a.cc:23:36: error: expected primary-expression before ')' token
   23 |         for(ue=j-1; ue>-1; ue=ue-1;){
      |                                    ^
a.cc:29:42: error: expected ')' before ';' token
   29 |         for(migi=i+1; migi<w; migi=migi+1;){
      |            ~                             ^
      |                                          )
a.cc:29:43: error: expected primary-expression before ')' token
   29 |         for(migi=i+1; migi<w; migi=migi+1;){
      |                                           ^
a.cc:35:42: error: expected ')' before ';' token
   35 |         for(sita=i+1; sita<w; sita=sita+1;){
      |            ~                             ^
      |                                          )
a.cc:35:43: error: expected primary-expression before ')' token
   35 |         for(sita=i+1; sita<w; sita=sita+1;){
      |                                           ^
a.cc:41:9: error: 'k' was not declared in this scope
   41 |         k=si+mi+uee+hidari+1;
      |         ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
const long long mod = 1e9 + 7;
const int INF = 1 << 20;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;


int main()
{
    int n,m; cin >> n >> m;
    char f[n][m];
    int h[n][m];
    int w[n][m];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin >> f[i][j];
        }
    }
    for(int i = 0;i < n; i++){
        int cnt = 0;
        int tmp = 0;
        for(int j = 0; j < m; j++){
            if(f[i][j] == '.'){
                cnt++;
            }else{
                for(int k = tmp; k < j; k++){
                    h[i][k] = cnt;
                }
                h[i][j] = 0;
                cnt = 0;
                tmp = j+1;
            }
            if(j == m-1){
                for(int k = tmp; k < m; k++){
                    h[i][k] = cnt;
                }
            }
        }
    }
    for(int i = 0; i < m; i++){
        int cnt = 0;
        int tmp = 0;
        for(int j = 0; j < n; j++){
            if(f[j][i] == '.'){
                cnt++;
            }else{
                for(int k = tmp; k < j; k++){
                    w[i][k] = cnt;
                }
                w[i][j] = 0;
                cnt = 0;
                tmp = j+1;
            }
            if(j == n-1){
                for(int k = tmp; k < n; k++){
                    w[i][k] = cnt;
                }
            }
        }
    }
  int ans = 0;
    for(int i = 0; i < m; i++){
        for(int j = 0; j < n; j++){
            ans = max(ans,w[i][j] + h[j][i])
        }
        cout << ans;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:45: error: expected ';' before '}' token
   74 |             ans = max(ans,w[i][j] + h[j][i])
      |                                             ^
      |                                             ;
   75 |         }
      |         ~
Language: C++

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

signed main() {
    ios::cin.tie(0);
    sync_with_stdio(false);
  int H, W; cin >> H >> W;
  string s[H];
  for(int i = 0; i < H; i++) cin >> s[i];

  int dh[] = {-1, 0, 1, 0};
  int dw[] = {0, -1, 0, 1};

  int ans = 0;
  for(int i = 0; i < H; i++) {
      for(int j = 0; j < W; j++) {
          int cnt = 0;
          int cp_i = i, cp_j = j;
          if(s[i][j]=='.'){
              for(int k = 0; k < 4; k++) {
                  while(true) {
                      cp_i += dh[k];
                      cp_j += dw[k];
                      if(s[cp_i][cp_j]=='.' && 0<=cp_i && cp_i<H && 0<=cp_j && cp_j<W) cnt++;
                      else break;
                  }
                  cp_i = i; cp_j = j;
              }
              ans = max(ans, cnt);
          }
      }
  }
  cout << ans+1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
    5 |     ios::cin.tie(0);
      |          ^~~
a.cc:6:5: error: 'sync_with_stdio' was not declared in this scope
    6 |     sync_with_stdio(false);
      |     ^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int h,w,m,hida,hidari,migi,mi,ue,uee,sita,si;
  cin>>h>>w;
  vector<vector<int>> data(h, vector<int>(w));
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> data.at(i).at(j);
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if(data.at(i).at(j)=="."){
        for(hida=i-1; hida>-1; hida=hida-1;){
          if(data.at(hida).at(j)=="#"){
            break;
          }
        }
        hidari=i-hida;
        for(ue=j-1; ue>-1; ue=ue-1;){
          if(data.at(i).at(ue)=="#"){
            break;
          }
        }
        uee=j-ue;
        for(migi=i+1; migi<w; migi=migi+1;){
          if(data.at(migi).at(j)=="#"){
            break;
          }
        }
        mi=migi-i;
        for(sita=i+1; sita<w; sita=sita+1;){
          if(data.at(i).at(sita)=="#"){
            break;
          }
        }
        si=sita-j;
        k=si+mi+uee+hidari+1;
        if(k>m){
          m=k;
        }
      }
    }
  }
  cout<<m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |       if(data.at(i).at(j)=="."){
      |          ~~~~~~~~~~~~~~~~^~~~~
a.cc:17:43: error: expected ')' before ';' token
   17 |         for(hida=i-1; hida>-1; hida=hida-1;){
      |            ~                              ^
      |                                           )
a.cc:17:44: error: expected primary-expression before ')' token
   17 |         for(hida=i-1; hida>-1; hida=hida-1;){
      |                                            ^
a.cc:23:35: error: expected ')' before ';' token
   23 |         for(ue=j-1; ue>-1; ue=ue-1;){
      |            ~                      ^
      |                                   )
a.cc:23:36: error: expected primary-expression before ')' token
   23 |         for(ue=j-1; ue>-1; ue=ue-1;){
      |                                    ^
a.cc:29:42: error: expected ')' before ';' token
   29 |         for(migi=i+1; migi<w; migi=migi+1;){
      |            ~                             ^
      |                                          )
a.cc:29:43: error: expected primary-expression before ')' token
   29 |         for(migi=i+1; migi<w; migi=migi+1;){
      |                                           ^
a.cc:35:42: error: expected ')' before ';' token
   35 |         for(sita=i+1; sita<w; sita=sita+1;){
      |            ~                             ^
      |                                          )
a.cc:35:43: error: expected primary-expression before ')' token
   35 |         for(sita=i+1; sita<w; sita=sita+1;){
      |                                           ^
a.cc:41:9: error: 'k' was not declared in this scope
   41 |         k=si+mi+uee+hidari+1;
      |         ^
Language: C++

//encoding:utf-8
//#include <iostream> //c++
//#include<stack> //スタックに関して　最新のデータから捨てる
//#include<queue> //キューに関して　最古のデータから捨てる
//#include<math.h>
//#include<vector>
//#include<algorithm> //sort とかにいる
#include<bits/stdc++.h>//vector,algorithm,que
#include<time.h> //時間にかんして

#define ll long long
#define MOD 1000000007
#define INF (1<<29)
using namespace std;


int H,W;
int cnt;
ll S[2001][2001];
ll lights[2001][2001][2];
char a =.;

int count_ver(int i,int j){
  int cnt = 0;
  for(int x=i;x<W;x++){
    if (S[j][x] == a) {
      cnt ++;
    }
    else{
      break;
    }
    if (S[j][x] == a) {
      lights[j][x][0] = cnt;
    }
    else{
      break;
    }
  }
  return cnt;
}


int count_hor(int i,int j){
  cnt = 0;
  for(int y=j;y<H;y++){
    if (S[y][i] == a) {
      cnt ++;
    }
    else{
      break;
    }
    if (S[y][i] == a) {
      lights[y][i][1] = cnt;
    }
    else{
      break;
    }
  }
  return cnt;
}

int main(){
  int H,W;
  int cnt;
  cin>>H>>W;
  ll S[2001][2001];
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin>>S[i][j];
    }
  }

  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      for(int k=0;k<2;k++){
        lights[i][j][k] = 0;
      }
    }
  }
  int ans = -1;
  int ver = 0,hor =0 ;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(S[i][j] == a){
        ver = lights[i][j][0];
        hor = lights[i][j][1];
        if(ver==0){
          ver = count_ver(j,i);
        }
        if(hor==0){
          hor = count_hor(j,i);
        ans = max(ans,hor+ver-1);
        }
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:21:9: error: expected primary-expression before '.' token
   21 | char a =.;
      |         ^
a.cc:21:10: error: expected unqualified-id before ';' token
   21 | char a =.;
      |          ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <math.h>
using namespace std;

int main(void) {

	// TODO: submit前にprintf-debugの削除確認！
	int H, W;
	cin >> H >> W;

	string S[H];
	int ansMap[H][W];
	for(int i=0; i<H; i++) {
		string s;
		cin >> s;
		S[i] = s;
	}

	int ans = 0;
	for(int i=0; i<H; i++) {
		int side = 0;
		for(int j=0; j<W; j++) {
			if(j == 0) {
				side = 0;
			}
			if(S[i][j] == '#') continue;

			int sum = 1;

			
			if(side != 0) {
				sum += side;
			} else {
				int tmp = i-1;
				while(tmp > -1) {
					if(S[tmp][j] == '#') break;

					side++;
					tmp--;
				}
				bl = 


				tmp = i+1;
				while(tmp < H) {
					if(S[tmp][j] == '#') break;

					side++;
					tmp++;
				}

				sum += side;

			}

			tmp = j-1;
			while(tmp > -1) {
				if(S[i][tmp] == '#') break;

				sum++;
				tmp--;
			}
			tmp = j+1;
			while(tmp < W) {
				if(S[i][tmp] == '#') break;

				sum++;
				tmp++;
			}

			ans = max(ans, sum);
		}		
	}

	cout << ans;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:33: error: 'bl' was not declared in this scope
   45 |                                 bl =
      |                                 ^~
a.cc:60:25: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   60 |                         tmp = j-1;
      |                         ^~~
      |                         tm
Language: C++

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

	int h,w;

	string s[2002] = {};

	vector<int> brokx[2002];
	vector<int> broky[2002];

int count_yoko(int x, int y) {


	if (brokx[x].size() == 0) {
		return w;
	}
	auto iter = lower_bound(brokx[x].begin(), brokx[x].end(), y);
	if (iter == brokx[x].begin()) {
		return brokx[x][0];
	} else if (iter == brokx[x].end()) {
		return w - *(iter-1) -1;
	} else {
		return *iter - *(iter-1) - 1; 
	}


}

int count_yoko(int x, int y) {


	if (brokx[y].size() == 0) {
		return h;
	}
	auto iter = lower_bound(broky[y].begin(), broky[y].end(), x);
	if (iter == broky[y].begin()) {
		return broky[y][0];
	} else if (iter == broky[y].end()) {
		return h - *(iter-1) -1;
	} else {
		return *iter - *(iter-1) - 1; 
	}


}

int main(){

	cin >> h>> w;

	rep(i,h) {
		cin >> s[i];
		// brok[i].push_back(-1);
		rep(j,w) {
			if (s[i][j] == '#') {
				brokx[i].push_back(j);
				broky[j].push_back(i);

			}
		}
	}

	int cnt = 0;
	

	rep(i,h) {
		rep(j,w) {
			if (s[i][j] == '#') {
				continue;
			}
			cnt = max(cnt, count_tate(i,j) + count_yoko(i,j) -1);
			if (cnt == h+w-1) {
				break;
			}
		}
	}

	cout << cnt << endl;
}

Compiler output:
a.cc:32:5: error: redefinition of 'int count_yoko(int, int)'
   32 | int count_yoko(int x, int y) {
      |     ^~~~~~~~~~
a.cc:14:5: note: 'int count_yoko(int, int)' previously defined here
   14 | int count_yoko(int x, int y) {
      |     ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:74:40: error: 'count_tate' was not declared in this scope
   74 |                         cnt = max(cnt, count_tate(i,j) + count_yoko(i,j) -1);
      |                                        ^~~~~~~~~~
Language: C++

int H, W;
vector<string> S;

int main() {
    scanf("%d %d", &H, &W);
    S.resize(H);
    for (int i = 0; i < H; i++) cin >> S[i];

    int maxi = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (S[i].at(j) == '#') continue;
            int counter = 0;
            int range = 0;
            bool allflag = 1;
            bool zoneflags[4] = {1}; //西東南北
            while(allflag) {
                if (range == 0) {
                    counter++;
                    continue;
                }
                if (zoneflags[0] && i < range && S.at(i-1).at(j) == '.') counter++;
                else zoneflags[0] = 0;
                if (zoneflags[1] && H-i < range && S.at(i+1).at(j) == '.') counter++;
                else zoneflags[1] = 0;
                if (zoneflags[2] && j < range && S.at(i).at(j-1) == '.') counter++;
                else zoneflags[2] = 0;
                if (zoneflags[3] && W-j < range && S.at(i).at(j+1) == '.') counter++;
                else zoneflags[3] = 0;

                if (zoneflags[0] || zoneflags[1] || zoneflags[2] || zoneflags[3]) allflag = 0;
                range++;
            }
            maxi = max(maxi, counter);
        }
    }

    cout << maxi << endl;
}

Compiler output:
a.cc:2:1: error: 'vector' does not name a type
    2 | vector<string> S;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'scanf' was not declared in this scope
    5 |     scanf("%d %d", &H, &W);
      |     ^~~~~
a.cc:6:5: error: 'S' was not declared in this scope
    6 |     S.resize(H);
      |     ^
a.cc:7:33: error: 'cin' was not declared in this scope
    7 |     for (int i = 0; i < H; i++) cin >> S[i];
      |                                 ^~~
a.cc:34:20: error: 'max' was not declared in this scope; did you mean 'maxi'?
   34 |             maxi = max(maxi, counter);
      |                    ^~~
      |                    maxi
a.cc:38:5: error: 'cout' was not declared in this scope
   38 |     cout << maxi << endl;
      |     ^~~~
a.cc:38:21: error: 'endl' was not declared in this scope
   38 |     cout << maxi << endl;
      |                     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>

using namespace std;

#define BLOCK '#'
#define NONE '.'

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> S(H+2);
  for (int i = 0; i < H+2; i++) {
    S[i].resize(W+2);
    for (int j = 0; j < W+2; j++) {
      if (i == 0 || i == H + 1 || j == 0 || j == W + 1) {
        S[i][j] = '#';
      } else {
        cin >> S[i][j];
      }
    }
  }
  vector<vector<int>> hmap(H + 2);
  for (int i = 0; i < H + 2; i++) {
    hmap[i].resize(W + 2);
    int cnt = 0;
    for (int j = 0; j < W + 2; j++) {
      if (S[i][j] == BLOCK) {
        int k = j - 1;
        while (k >= 0 && S[i][k] == NONE) {
          hmap[i][k] = cnt;
          k--;
        }
        cnt = 0;
      } else {
        cnt++;
      }
    }
  }

  vector<vector<int>> vmap(H + 2);
  for (int i = 0; i < H + 2; i++) {
    vmap[i].resize(W + 2);
  }

  for (int j = 0; j < W + 2; j++) {
    int cnt = 0;
    for (int i = 0; i < H + 2; i++) {
      if (S[i][j] == BLOCK) {
        int k = i - 1;
        while (k >= 0 && S[k][j] == NONE) {
          vmap[k][j] = cnt;
          k--;
        }
        cnt = 0;
      } else {
        cnt++;
      }
    }
  }
  int ans = INT_MIN;
  for (int i = 0; i < H + 2; i++) {
    for (int j = 0; j < W + 2; j++) {
      ans = max(ans, {hmap[i][j] + vmap[i][j] - 1});
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:13: error: 'INT_MIN' was not declared in this scope
   67 |   int ans = INT_MIN;
      |             ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <cmath>
  +++ |+#include <climits>
    9 |
Language: C++

#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include <string>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;
int dy[4] = { 0, -1, 0, 1 };
int dx[4] = { 1, 0, -1, 0 };
bool inside(int y, int x, int H, int W) {
    return 0 <= y && y < H && 0 <= x && x < W;
}
int h,w; 
int ans=0;
int cnth[2005];
int cntw[2005];
char field[2005][2005];
void dfs(int y,int x,int cnt){
	for(int i=0;i<4;i++){
		int nx=x+dx[i];
		int ny=y+dy[i];
		while(inside(ny,nx,h,w)&&field[ny][nx]=='.'){
			cnt++;
			ny+=dy[i]; nx+=dx[i];
		}
	}
	ans=max(ans,cnt);
	if(ans==h+w-1){
		cout << ans << endl;
		return 0;
	}
	return ;
}
int main(){
	cin >>h>>w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin >>field[i][j];
			if(field[i][j]=='.'){
				cnth[i]++;
				cntw[j]++;
			}
		}
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(field[i][j]=='.'){
				if(cntw[j]+cnth[i]>ans)dfs(i,j,1);
			}
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:33:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   33 |                 return 0;
      |                        ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<deque>
using namespace std;
const int dx[4]={1,-1,0,0};
const int dy[4]={0,0,1,-1};
constexpr long mod=1000000007;



int main(){
	int h,w;
	cin>>h>>w;
	vector<string>s(h+20);
	vector<vector<int>>num(h+20,vector<int>(w+20,0));
	for(int i=0;i<h;i++){
		cin>>s[i];
		s[i].push_back('#');
		s[i].push_back('#');
		s[i].push_back('#');

		s[i].push_back('#');
		s[i].push_back('#');
	}
	string block(w+20,'#');
	s[h]=block;
	s[h+1]=block;
	s[h+2]=block;
	s[h+3]=block;
	int start,end;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(s[i][j]=='.'){
				start=j;
				break;
			}
		}
		for(int j=start+1;j<=w;j++){
			if(s[i][j]=='#'){
				end=j-1;
				int light=end-start+1;
				for(int k=start;k<=end;k++){
					num[i][k]+=light;
				}
				start=end+2;
			}
		}
	}

	// for(int i=0;i<h;i++){
	// 	for(int j=0;j<w;j++){
	// 		cout<<num[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }
	// cout<<endl<<endl;

	// for(int i=0;i<w;i++){
	// 	for(int j=0;j<h;j++){
	// 		if(s[j][i]=='.'){
	// 			start=j;
	// 			break;
	// 		}
	// 	}
	// 	for(int j=start+1;j<=h;j++){
	// 		if(s[j][i]=='#'){
	// 			end=j-1;
	// 			int light=end-start;
	// 			for(int k=start;k<=end;k++){
	// 				num[k][i]+=light;
	// 			}
	// 			start=end+2;
	// 		}
	// 	}
	// }
	// int ans=0;
	// for(int i=0;i<h;i++){
	// 	for(int j=0;j<w;j++){
	// 		ans=max(num[i][j],ans);
	// 	}
	// }
	cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:86:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   86 |         cout<<ans;
      |               ^~~
      |               abs
Language: C++

//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

lo n,m,b,a[li],k,flag,vis[10005][10005],deger[10005][10005],deger1[10005][10005],deger2[10005][10005],deger3[10005][10005],mx;
lo cev;
char s[10005][10005];
vector<lo> v[10005];
vector<lo> vv[10005];

void YES(lo xxxxxxx){
	if(xxxxxxx==1){cout<<"YES\n";exit(0);}
	printf("YES\n");
	exit(0);
}

void NO(lo xxxxxxx){
	if(xxxxxxx==1){cout<<"NO\n";exit(0);}
	printf("NO\n");
	exit(0);
}

void solve(){
	cin>>n>>m;
	FOR{
		for(lo j=1;j<=m;j++){
			cin>>s[i][j];
			if(s[i][j]=='#'){vis[i][j]=1;v[i].pb(j);vv[j].pb(i);}
			//~ if(v[i].size())
			deger[i][j]=v[i].size();
			deger1[i][j]=vv[j].size();
			//~ cout<<deger<<" "<<deger1<<endl;
		}
	}
	//~ cout<<"**";
	FOR{
		//~ cin>>s[i];
		for(lo j=1;j<=m;j++){
			if(s[i][j]=='#'){continue;}
			if(deger[i][j]!=(int)v[i].size()) deger2[i][j]=v[i][deger[i][j]]-1;
			else if(deger[i][j]==(lo)v[i].size()) deger2[i][j]=m;
			if(deger[i][j]!=0) deger[i][j]=v[i][deger[i][j]-1];
			if(deger1[i][j]!=(lo)vv[j].size()) deger3[i][j]=vv[j][deger1[i][j]]-1;
			else if(deger1[i][j]==(lo)vv[j].size()) deger3[i][j]=n;
			if(deger1[i][j]!=0) deger1[i][j]=vv[j][deger1[i][j]-1];
			cev=0;
			cev+=deger3[i][j]-deger1[i][j];
			//~ cout<<cev<<" ";
			cev+=deger2[i][j]-deger[i][j];
			//~ cout<<cev<<endl;
			mx=max(mx,cev-1);
		}
	}
	cout<<mx<<endl;
}

int main(void){
	fio();
	solve();
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:9:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <queue>
#include<iomanip>
#include <cmath>
#include <set>

#define ABS(x) ((x)>0?(x):-(x))
#define MIN(x,y) ((x)>(y)?(y):(x))

using namespace std;
typedef long long ll;

ll newton(long long int a, long long int  b)
{
	if(a==b)
		return a;
	while(a != 0 && b != 0)
	{
		if(a > b)
		{
			b += a;
			a = b-a;
			b -= a;
		}
		b %= a;
	}
	return a;
}

struct UnionFind {
	vector<int> p;
	UnionFind(int N):p(N)
	{
		for(int i=0; i< N; i++)
		{
			p[i] = i;
		}
	}
	int root(int x)
	{
		if(p[x] == x)
			return x;
		return p[x] = root(p[x]);
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if(rx == ry) return;
		p[rx] = ry;
	}
	bool issame(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

//大きな数に対する割り算をするとき、MODを指定することで掛け算の値に変換できる

ll div2mul_calc(ll a, ll b, ll m)
{
	if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = div2mul_calc(a, b / 2, m);
        return (d * d) % m;
    } else {
        return (a * div2mul_calc(a, b - 1, m)) % m;
    }
}
ll div2mul(ll n, ll mod)
{
	return div2mul_calc(n, mod-2, mod);
}

	int mp[2010][2010] = {0};
	int tot[2010][2010] = {0};
	int tot2[2010][2010] = {0};
int main()
{
	int H,W;
	int i,j,k,n;
	cin >> H >> W;
	for(i=0;i<H;++i)
	{
		string s;
		cin >> s;
		for(j=0;j<W;++j)
		{
			if(s[j]=='#')
				mp[i][j] = 1;
		}
	}
	for(i=0;i<H;++i)
	{
		k = 0;
		for(j=0;j<W;++j)
		{
			if(mp[i][j] == 1)
			{
				for(n=0;n<k;++n)
				{
					tot[i][j-n-1] = k;
				}
				k = 0;
			}
			else
			{
				++k;
			}
		}
		for(n=0;n<k;++n)
		{
			tot[i][W-n-1] = k;
		}
		k = 0;
	}
	for(i=0;i<W;++i)
	{
		k = 0;
		for(j=0;j<H;++j)
		{
			if(mp[j][i] == 1)
			{
				for(n=0;n<k;++n)
				{
					tot2[j-n-1][i] = k;
				}
				k = 0;
			}
			else
			{
				++k;
			}
		}
		for(n=0;n<k;++n)
		{
			tot2[H-n-1][i] = k;
		}
		k = 0;
	}
	int ans = 0;
	for(i=0;i<H;++i)
	{
		for(j=0;j<W;++j)
		{
			if(ans < tot[i][j]+tot2[i][j] && )
			{
				ans = tot[i][j]+tot2[i][j];
			}
		}
	}
	cout << ans-1 << endl;

	return 0;
}




































Compiler output:
a.cc: In function 'int main()':
a.cc:153:58: error: expected primary-expression before ')' token
  153 |                         if(ans < tot[i][j]+tot2[i][j] && )
      |                                                          ^
Language: C

#include <bits/stdc++.h>

using namespace std;
using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

int main() {
  int H, W;
  cin >> H >> W;
  vector< string > S(H);
  cin >> S;

  auto dp = make_v< int >(4, H, W);
  fill_v(dp, -10101010);
  int vy[] = {0, 1, 0, -1};
  int vx[] = {1, 0, -1, 0};
  for(int i = 0; i < 4; i++) {
    for(int a = 0; a < H; a++) {
      for(int b = 0; b < W; b++) {
        int j = a;
        int k = b;
        if(i <= 2) {
          j = H - j - 1;
          k = W - k - 1;
        }
        if(S[j][k] == '.') dp[i][j][k] = 0;
        int ny = j + vy[i], nx = k + vx[i];
        if(ny < 0 || nx < 0 || ny >= H || nx >= W) continue;
        chmax(dp[i][j][k], dp[i][ny][nx] + 1);
      }
    }
  }

  int64 ret = -inf;
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {\
      chmax(ret, dp[0][i][j] + dp[1][i][j] + dp[2][i][j] + dp[3][i][j]);

    }
  }
  cout << ret + 1 << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
#pragma region atcoder
#include <atcoder/modint>
using namespace atcoder;
#pragma endregion
#pragma region macros
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vl = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n - 1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#pragma endregion
#pragma region debug for var, v, vv
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){cout << endl;int cnt = 0;for(const auto& v : vv){cout << cnt << "th : "; view(v); cnt++;} cout << endl;}
#pragma endregion

const ll mod = 1000000007;
const int inf = 1001001001;
const ll INF = 1001001001001001001;
const int MAX = 100005;

//using mint = modint998244353;
using mint = modint1000000007;
//These are for segment tree
/*int op(int a, int b){return max(a, b);}
int e(){return -1;}
bool f(int v){ return v < target;}
*/

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

template<class T>bool chmax(T &a, const T b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T b) { if (b<a) { a=b; return 1; } return 0; }
ll modpow(ll a, ll p){ll ret = 1; while(p){if(p & 1){ret = ret * a % mod;} a = a * a % mod; p >>= 1;} return ret;}

/*--------------------------------------------------------------------------------------------------------------------------------*/

mint dp[100002][2];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s; cin >> s;
	int sz = sz(s);
	dp[0][0] = 1; 
	dp[0][1] = 0;
	for(int i = 1; i <= sz; i++){
		// a = b = 0
		if(s[i - 1] == '0'){
			dp[i][0] = dp[i - 1][0];
			dp[i][1] = dp[i - 1][1];
		}
		else{
			dp[i][1] = dp[i - 1][0] + dp[i - 1][1];
		}
		// a = 1 and b = 0 or vice versa
		if(s[i - 1] == '0'){
			dp[i][1] += dp[i - 1][1] * 2;
		}
		else{
			dp[i][0] += dp[i - 1][0] * 2;
			dp[i][1] += dp[i - 1][1] * 2;
		}
	}
	cout << (dp[sz][0] + dp[sz][1]).val() << endl;
} 

Compiler output:
a.cc:4:10: fatal error: atcoder/modint: No such file or directory
    4 | #include <atcoder/modint>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.