Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>

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:11:7: error: 'll' does not name a type
   11 | const ll maxn = 1e3 + 10;
      |       ^~
a.cc:13:9: error: 'maxn' was not declared in this scope
   13 | char mp[maxn][maxn];
      |         ^~~~
a.cc:13:15: error: 'maxn' was not declared in this scope
   13 | char mp[maxn][maxn];
      |               ^~~~
a.cc:14:10: error: 'maxn' was not declared in this scope
   14 | int step[maxn][maxn];
      |          ^~~~
a.cc:14:16: error: 'maxn' was not declared in this scope
   14 | int step[maxn][maxn];
      |                ^~~~
a.cc:15:10: error: 'maxn' was not declared in this scope
   15 | bool vis[maxn][maxn];
      |          ^~~~
a.cc:15:16: error: 'maxn' was not declared in this scope
   15 | bool vis[maxn][maxn];
      |                ^~~~
a.cc: In function 'bool check(int, int)':
a.cc:19:45: error: 'vis' was not declared in this scope
   19 |     if(x < 0 || y < 0|| x >= n || y >= m || vis[x][y] || mp[x][y] == '#') return false;
      |                                             ^~~
a.cc:19:58: error: 'mp' was not declared in this scope; did you mean 'm'?
   19 |     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:24:5: error: 'queue' was not declared in this scope
   24 |     queue<pair<int ,int> > q;
      |     ^~~~~
a.cc:5:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    4 | #include<cmath>
  +++ |+#include <queue>
    5 | 
a.cc:24:26: error: expected primary-expression before '>' token
   24 |     queue<pair<int ,int> > q;
      |                          ^
a.cc:24:28: error: 'q' was not declared in this scope
   24 |     queue<pair<int ,int> > q;
      |                            ^
a.cc:26:5: error: 'step' was not declared in this scope; did you mean 'strsep'?
   26 |     step[0][0] = 1;
      |     ^~~~
      |     strsep
a.cc:27:5: error: 'vis' was not declared in this scope
   27 |     vis[0][0] = true;
      |     ^~~
a.cc: In function 'int main()':
a.cc:46:5: error: 'init' was not declared in this scope; did you mean 'int'?
   46 |     init();
      |     ^~~~
      |     int
a.cc:51:18: error: 'mp' was not declared in this scope; did you mean 'm'?
   51 |             cin>>mp[i][j];
      |                  ^~
      |                  m