Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using product = pair<ll,ll>;
using vvll = vector<vector<ll>>;
using vll = vector<ll>;
 
ll H,W;
vector<vector<char>> route(100,vector<char>(100));
vvll dist(100,vll(100));
 
bool checkRoute(ll x,ll y)
{
    if(x<0 || y<0 || H<=x || W<=y)return false;
    if(dist[x][y]==-1 && route[x][y]=='.')return true;
    return false;
}
 
int main(){
    ll white=0;
    cin>>H>>W;
    for(ll i=0;i<H;i++)
    {
        for(ll j=0;j<W;j++)
        {
            char s;cin>>s;
            if(s=='.')white++;
            route[i][j]=s;
            dist[i][j]=-1;
        }
    }
    queue<product>  que;
    que.push(make_pair(0,0));
    dist[0][0]=1;
    while(!que.empty())
    {
        product v=que.front();
        que.pop();
 
        if(checkRoute(v.first+1,v.second))
        {
            que.push(make_pair(v.first+1,v.second));
            dist[v.first+1][v.second]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first-1,v.second))
        {
            que.push(make_pair(v.first-1,v.second));
            dist[v.first-1][v.second]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first,v.second+1))
        {
            que.push(make_pair(v.first,v.second+1));
            dist[v.first][v.second+1]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first,v.second-1))
        {
            que.push(make_pair(v.first,v.second-1));
            dist[v.first][v.second-1]=dist[v.first][v.second]+1;
        }
    }
    if(dist[H-1][W-1]==-1)cout<<-1<<endl;
    else cout<<white-dist[H-1][W-1]<<endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using product = pair<ll,ll>;
using vvll = vector<vector<ll>>;
using vll = vector<ll>;

ll H,W;
vector<vector<char>> route(100,vector<char>(100));
vvll dist(100,vll(100));

bool checkRoute(ll x,ll y)
{
    if(x<0 || y<0 || H<=x || W<=x)return false;
    if(dist[x][y]==-1 && route[x][y]=='.')return true;
    return false;
}

int main(){
    ll white=0;
    cin>>H>>W;
    for(ll i=0;i<H;i++)
    {
        for(ll j=0;j<W;j++)
        {
            char s;cin>>s;
            if(s=='.')white++;
            route[i][j]=s;
            dist[i][j]=-1;
        }
    }
    queue<product>  que;
    que.push(make_pair(0,0));
    dist[0][0]=1;
    while(!que.empty())
    {
        product v=que.front();
        que.pop();

        if(checkRoute(v.first+1,v.second))
        {
            que.push(make_pair(v.first+1,v.second));
            dist[v.first+1][v.second]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first-1,v.second))
        {
            que.push(make_pair(v.first-1,v.second));
            dist[v.first-1][v.second]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first,v.second+1))
        {
            que.push(make_pair(v.first,v.second+1));
            dist[v.first][v.second+1]=dist[v.first][v.second]+1;
        }
        if(checkRoute(v.first,v.second-1))
        {
            que.push(make_pair(v.first,v.second-1));
            dist[v.first][v.second-1]=dist[v.first][v.second]+1;
        }
    }
    if(dist[H-1][W-1]==-1)cout<<-1<<endl;
    else cout<<white-dist[H-1][W-1]<<endl;
    return 0;
}


Compiler output:
a.cc:72:4: error: redefinition of 'll H'
   72 | ll H,W;
      |    ^
a.cc:8:4: note: 'll H' previously declared here
    8 | ll H,W;
      |    ^
a.cc:72:6: error: redefinition of 'll W'
   72 | ll H,W;
      |      ^
a.cc:8:6: note: 'll W' previously declared here
    8 | ll H,W;
      |      ^
a.cc:73:22: error: redefinition of 'std::vector<std::vector<char> > route'
   73 | vector<vector<char>> route(100,vector<char>(100));
      |                      ^~~~~
a.cc:9:22: note: 'std::vector<std::vector<char> > route' previously declared here
    9 | vector<vector<char>> route(100,vector<char>(100));
      |                      ^~~~~
a.cc:74:6: error: redefinition of 'vvll dist'
   74 | vvll dist(100,vll(100));
      |      ^~~~
a.cc:10:6: note: 'vvll dist' previously declared here
   10 | vvll dist(100,vll(100));
      |      ^~~~
a.cc:76:6: error: redefinition of 'bool checkRoute(ll, ll)'
   76 | bool checkRoute(ll x,ll y)
      |      ^~~~~~~~~~
a.cc:12:6: note: 'bool checkRoute(ll, ll)' previously defined here
   12 | bool checkRoute(ll x,ll y)
      |      ^~~~~~~~~~
a.cc:83:5: error: redefinition of 'int main()'
   83 | int main(){
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main(){
      |     ^~~~