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 s[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:12:41: error: 'mp' was not declared in this scope; did you mean 'm'?
   12 |         for(int i=1;i<=n;i++)scanf("%s",mp[i]+1);
      |                                         ^~
      |                                         m
a.cc:15:12: error: 'mp' was not declared in this scope; did you mean 'm'?
   15 |         if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
      |            ^~
      |            m
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:12: error: 'mp' was not declared in this scope; did you mean 'm'?
   18 |         if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
      |            ^~
      |            m
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:12: error: 'mp' was not declared in this scope; did you mean 'm'?
   21 |         if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
      |            ^~
      |            m
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);
      |                                                                 ^~