Language: C++

include<bits/stdc++.h>

using namespace std;

#define fi first
#define se second

const ll maxn = 1e3 + 10;
const int Move[4][2] = {-1,0,1,0,0,1,0,-1};
char mp[maxn][maxn];
int step[maxn][maxn];
bool vis[maxn][maxn];
int n,m;

bool check(int x,int y) {
    if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false;
    return true;
}

int BFS() {
    queue<pair<int ,int> > q;
    q.push(make_pair(0,0));
    step[0][0] = 1;
    vis[0][0] = true;
    while (!q.empty()) {
        pair<int ,int> t = q.front();
        q.pop();
        for(int i = 0;i < 4;i++) {
            int tox = t.fi + Move[i][0];
            int toy = t.se + Move[i][1];
            if(tox == n - 1 && toy == m - 1) return step[t.fi][t.se] + 1;
            if(check(tox,toy)) {
                vis[tox][toy] = true;
                step[tox][toy] = step[t.fi][t.se] + 1;
                q.push(make_pair(tox,toy));
            }
        }
    }
    return -1;
}


int main(){
    init();
    cin>>n>>m;
    int cnt = 0;
    for(int i = 0;i < n;i++)
        for(int j = 0;j < m;j++) {
            cin>>mp[i][j];
            if(mp[i][j] == '#') cnt++;
        }
    int res = BFS();
    if(res == -1) {
        cout<<"-1"<<endl;
    } else {
        cout<<n*m - res - cnt<<endl;
    }
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:8:7: error: 'll' does not name a type
    8 | const ll maxn = 1e3 + 10;
      |       ^~
a.cc:10:9: error: 'maxn' was not declared in this scope
   10 | char mp[maxn][maxn];
      |         ^~~~
a.cc:10:15: error: 'maxn' was not declared in this scope
   10 | char mp[maxn][maxn];
      |               ^~~~
a.cc:11:10: error: 'maxn' was not declared in this scope
   11 | int step[maxn][maxn];
      |          ^~~~
a.cc:11:16: error: 'maxn' was not declared in this scope
   11 | int step[maxn][maxn];
      |                ^~~~
a.cc:12:10: error: 'maxn' was not declared in this scope
   12 | bool vis[maxn][maxn];
      |          ^~~~
a.cc:12:16: error: 'maxn' was not declared in this scope
   12 | bool vis[maxn][maxn];
      |                ^~~~
a.cc: In function 'bool check(int, int)':
a.cc:16:45: error: 'vis' was not declared in this scope
   16 |     if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false;
      |                                             ^~~
a.cc:16:58: error: 'mp' was not declared in this scope; did you mean 'm'?
   16 |     if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false;
      |                                                          ^~
      |                                                          m
a.cc: In function 'int BFS()':
a.cc:21:5: error: 'queue' was not declared in this scope
   21 |     queue<pair<int ,int> > q;
      |     ^~~~~
a.cc:21:11: error: 'pair' was not declared in this scope
   21 |     queue<pair<int ,int> > q;
      |           ^~~~
a.cc:21:16: error: expected primary-expression before 'int'
   21 |     queue<pair<int ,int> > q;
      |                ^~~
a.cc:22:5: error: 'q' was not declared in this scope
   22 |     q.push(make_pair(0,0));
      |     ^
a.cc:22:12: error: 'make_pair' was not declared in this scope
   22 |     q.push(make_pair(0,0));
      |            ^~~~~~~~~
a.cc:23:5: error: 'step' was not declared in this scope
   23 |     step[0][0] = 1;
      |     ^~~~
a.cc:24:5: error: 'vis' was not declared in this scope
   24 |     vis[0][0] = true;
      |     ^~~
a.cc:26:14: error: expected primary-expression before 'int'
   26 |         pair<int ,int> t = q.front();
      |              ^~~
a.cc:29:23: error: 't' was not declared in this scope
   29 |             int tox = t.fi + Move[i][0];
      |                       ^
a.cc: In function 'int main()':
a.cc:44:5: error: 'init' was not declared in this scope; did you mean 'int'?
   44 |     init();
      |     ^~~~
      |     int
a.cc:45:5: error: 'cin' was not declared in this scope
   45 |     cin>>n>>m;
      |     ^~~
a.cc:49:18: error: 'mp' was not declared in this scope; did you mean 'm'?
   49 |             cin>>mp[i][j];
      |                  ^~
      |                  m
a.cc:54:9: error: 'cout' was not declared in this scope
   54 |         cout<<"-1"<<endl;
      |         ^~~~
a.cc:54:21: error: 'endl' was not declared in this scope
   54 |         cout<<"-1"<<endl;
      |                     ^~~~
a.cc:56:9: error: 'cout' was not declared in this scope
   56 |         cout<<n*m - res - cnt<<endl;
      |         ^~~~
a.cc:56:32: error: 'endl' was not declared in this scope
   56 |         cout<<n*m - res - cnt<<endl;
      |                                ^~~~