Language: C++

#include<iostream>
#include<vector>
#include<queue>
using namespae std;
int main () {
  int H, W;
  cin >> H >> W;
  vector<vector<int>>num(H, vector<int>(W));
  vector<vector<char>>map(H, vector<char>(W));
  vector<vector<bool>>reach(H, vector<bool>(W, false));
  queue<int>qx;
  queue<int>qy;
  queue<int>qn;
  for (int i = 0; i < H; i ++) {
    for (int j = 0; j < W; j ++) {
      cin >> map[i][j];
      if (map[i][j] == '#') {
        qx.push(i);
        qy.push(j);
        qn.push(0);
        reach[i][j] = true;
        num[i][j] = 0;
      }
    }
  }
  int x[] = {0, 1, 0, -1};
  int y[] = {1, 0, -1, 0};
  while(!qx.empty()) {
    int bx = qx.front();
    int by = qy.front();
    int bn = qn.front();
    qx.pop();
    qy.pop();
    qn.pop();
    for (int i = 0; i < 4; i ++) {
      int ax = bx + x[i];
      int ay = by + y[i];
      int an = bn + 1;
      if (ax >= H || ax < 0 || ay >= W || ay < 0 || reach[ax][ay]) continue;
      num[ax][ay] = an;
      reach[ax][ay] = true;
      qx.push(ax);
      qy.push(ay);
      qn.push(an);
    }
  }
  int ans = 0;
  for (int i = 0; i < H; i ++) {
    for (int j = 0; j < W; j ++) {
      if (ans < num[i][j]) ans = num[i][j];
    }
  }
  cout << ans << endl;
}
  
  

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namespae'
    4 | using namespae std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> H >> W;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<vector<int>>num(H, vector<int>(W));
      |   ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   vector<vector<int>>num(H, vector<int>(W));
      |                 ^~~
a.cc:9:17: error: expected primary-expression before 'char'
    9 |   vector<vector<char>>map(H, vector<char>(W));
      |                 ^~~~
a.cc:10:17: error: expected primary-expression before 'bool'
   10 |   vector<vector<bool>>reach(H, vector<bool>(W, false));
      |                 ^~~~
a.cc:11:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
   11 |   queue<int>qx;
      |   ^~~~~
      |   std::queue
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: 'std::queue' declared here
   96 |     class queue
      |           ^~~~~
a.cc:11:9: error: expected primary-expression before 'int'
   11 |   queue<int>qx;
      |         ^~~
a.cc:12:9: error: expected primary-expression before 'int'
   12 |   queue<int>qy;
      |         ^~~
a.cc:13:9: error: expected primary-expression before 'int'
   13 |   queue<int>qn;
      |         ^~~
a.cc:16:14: error: 'map' was not declared in this scope
   16 |       cin >> map[i][j];
      |              ^~~
a.cc:18:9: error: 'qx' was not declared in this scope
   18 |         qx.push(i);
      |         ^~
a.cc:19:9: error: 'qy' was not declared in this scope
   19 |         qy.push(j);
      |         ^~
a.cc:20:9: error: 'qn' was not declared in this scope
   20 |         qn.push(0);
      |         ^~
a.cc:21:9: error: 'reach' was not declared in this scope; did you mean 'rpmatch'?
   21 |         reach[i][j] = true;
      |         ^~~~~
      |         rpmatch
a.cc:22:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   22 |         num[i][j] = 0;
      |         ^~~
      |         enum
a.cc:28:10: error: 'qx' was not declared in this scope; did you mean 'x'?
   28 |   while(!qx.empty()) {
      |          ^~
      |          x
a.cc:30:14: error: 'qy' was not declared in this scope; did you mean 'by'?
   30 |     int by = qy.front();
      |              ^~
      |              by
a.cc:31:14: error: 'qn' was not declared in this scope; did you mean 'bn'?
   31 |     int bn = qn.front();
      |              ^~
      |              bn
a.cc:39:53: error: 'reach' was not declared in this scope; did you mean 'rpmatch'?
   39 |       if (ax >= H || ax < 0 || ay >= W || ay < 0 || reach[ax][ay]) continue;
      |                                                     ^~~~~
      |                                                     rpmatch
a.cc:40:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   40 |       num[ax][ay] = an;
      |       ^~~
      |       enum
a.cc:41:7: error: 'reach' was not declared in this scope; did you mean 'rpmatch'?
   41 |       reach[ax][ay] = true;
      |       ^~~~~
      |       rpmatch
a.cc:50:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   50 |       if (ans < num[i][j]) ans = num[i][j];
      |                 ^~~
      |                 enum
a.cc:53:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   53 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:53:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   53 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~