Language: C++

/*
  AUTHOR:SOURABH
  CREATED:10:01:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<ll , null_type, less< ll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

string s[20];
bool vis[20][20];
ll sum[20][20];
ll n,m,x1,y1,x2,y2;

void dfs(ll i,ll j)
{
    vis[i][j]=1;
    if(i+1<n && s[i+1][j]=='.' && !vis[i+1][j])
    {sum[i+1][j]=sum[i][j]+1;dfs(i+1,j);}
    if(j+1<m && s[i][j+1]=='.' && !vis[i][j+1])
    {sum[i][j+1]=sum[i][j]+1;dfs(i,j+1);}
    if(i-1>=0 && s[i-1][j]=='.' && !vis[i-1][j])
    {sum[i-1][j]=sum[i][j]+1;dfs(i-1,j);}
    if(j-1>=0 && s[i][j-1]=='.' && !vis[i][j-1])
    {sum[i][j-1]=sum[i][j]+1;dfs(i,j-1);}
    //cout<<i<<" "<<j<<" "<<sum[i][j]<<endl;
    return;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    ll k,i,j,ma,o;
    cin>>n>>m;
    vector<pll> ans;
    fn(i,n)
    {
        cin>>s[i];
        fn(j,m)
        {
            if(s[i][j]=='.')
            ans.pb({i,j});
        }
    }
    k=ans.size();
    ma=0;
    fn(i,k)
    {
        x1=ans[i].fi;
        y1=ans[i].se;
        memset(vis,0,sizeof(vis));
        memset(sum,0,sizeof(sum));
        dfs(x1,y1);
        /*cout<<x1<<" "<<y1<<endl;
        fn(o,n)
        {
            fn(j,m)
            cout<<sum[o][j]<<" ";
            cout<<endl;
        }
        cout<<endl;*/
        fs(j,i+1,k)
        {
            x2=ans[j].fi;
            y2=ans[j].se;
            ma=max(ma,sum[x2][y2]);
        }
    }
    cout<<ma;
    return 0;
}









Compiler output:
a.cc:38:11: error: 'long long int y1' redeclared as different kind of entity
   38 | ll n,m,x1,y1,x2,y2;
      |           ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:5:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:81:11: error: assignment of function 'double y1(double)'
   81 |         y1=ans[i].se;
      |           ^
a.cc:84:16: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
   84 |         dfs(x1,y1);
      |                ^~
      |                |
      |                double (*)(double) noexcept
a.cc:40:18: note:   initializing argument 2 of 'void dfs(long long int, long long int)'
   40 | void dfs(ll i,ll j)
      |                  ^