Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using P = pair<int, int>;
int x[4] = {1, 0, -1, 0};
int y[4] = {0, 1, 0, -1};
int sx = 1, sy = 1;
int gx, gy;
vector<vector<char>> map;
int H, W;
const int INF = 1000000;
int dis[H][W];

int min_loot() {
  cin >> H >> W;
  map.assign(H, vector<char>(W));
  for (int y = 0; y < H; y++) {
    for (int x = 0; x < W; x++) {
      cin >> map.at(y).at(x);
      if (y = 0 && x = 0)
        dis[y][x] = 0;
      else
        dis[y][x] = INF;
    }
  }
  
  queue<P> que;
  que.push(P(0, 0));
  
  while (!que.empty()) {
    P p = que.front(); que.pop();
    if (p.first == H - 1 && p.second == W - 1) break;
    
    for (int i = 0; i < 4; i++) {
      int ny = p.first + x[i];
      int nx = p.second + y[i];
      
      if (nx >= 0 && nx < H && ny >= 0 && ny < W &&
            map.at(ny).at(nx) == '.' && dis[ny][nx] == INF) {
        dis[ny][nx] = dis[p.first][p.second] + 1;
        que.push(P(ny, nx));
      }
    }
  }
  
  return dis[H-1][W-1];
}

int main() {
  int a = min_loot();
  
  int count = 0;
  rep(i, H) {
    rep(j, W) {
      if (map.at(i).at(j) = '.')
        count++;
    }
  }
  
  cout << count - a - 1 << endl;
}

Compiler output:
a.cc:13:12: error: size of array 'dis' is not an integral constant-expression
   13 | int dis[H][W];
      |            ^
a.cc:13:9: error: size of array 'dis' is not an integral constant-expression
   13 | int dis[H][W];
      |         ^
a.cc: In function 'int min_loot()':
a.cc:17:3: error: reference to 'map' is ambiguous
   17 |   map.assign(H, vector<char>(W));
      |   ^~~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:10:22: note:                 'std::vector<std::vector<char> > map'
   10 | vector<vector<char>> map;
      |                      ^~~
a.cc:20:14: error: reference to 'map' is ambiguous
   20 |       cin >> map.at(y).at(x);
      |              ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:10:22: note:                 'std::vector<std::vector<char> > map'
   10 | vector<vector<char>> map;
      |                      ^~~
a.cc:21:17: error: lvalue required as left operand of assignment
   21 |       if (y = 0 && x = 0)
      |               ~~^~~~
a.cc:40:13: error: reference to 'map' is ambiguous
   40 |             map.at(ny).at(nx) == '.' && dis[ny][nx] == INF) {
      |             ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:10:22: note:                 'std::vector<std::vector<char> > map'
   10 | vector<vector<char>> map;
      |                      ^~~
a.cc: In function 'int main()':
a.cc:56:11: error: reference to 'map' is ambiguous
   56 |       if (map.at(i).at(j) = '.')
      |           ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:10:22: note:                 'std::vector<std::vector<char> > map'
   10 | vector<vector<char>> map;
      |                      ^~~