Language: C++

#include <bits/stdc++.h>
// statics
using namespace std;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;

// init/input
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main() {
  INIT;
  VAR(int,h,w);
  VEC(string,a,h);

  vector<PAIR> black,white;
  REP(hi,h){
    REP(wi,w){
      if(a[hi][wi] == '#') black.push_back(make_pair(hi,wi));
      else white.push_back(make_pair(hi,wi));
    }
  }

  int ans = 0;
  EACH(wi, white){
    int tmp2 = INF;
    EACH(bi, black){
      int tmp = abs(wi.first-bi.first) + abs(wi.second-bi.second);
      tmp2 = min(tmp2,tmp);
    }
    ans = max(ans,tmp2);
  }
  
  OUT(ans)BR;
  
  return 0;
}


Compiler output:
a.cc:4:19: error: 'int64' was not declared in this scope
    4 | using PAIR = pair<int64, int64>;
      |                   ^~~~~
a.cc:4:26: error: 'int64' was not declared in this scope
    4 | using PAIR = pair<int64, int64>;
      |                          ^~~~~
a.cc:4:31: error: template argument 1 is invalid
    4 | using PAIR = pair<int64, int64>;
      |                               ^
a.cc:4:31: error: template argument 2 is invalid
a.cc:6:11: error: 'int64' does not name a type; did you mean 'int64_t'?
    6 | constexpr int64 LINF = 1LL << 60;
      |           ^~~~~
      |           int64_t
a.cc: In function 'int main()':
a.cc:42:10: error: 'PAIR' was not declared in this scope
   42 |   vector<PAIR> black,white;
      |          ^~~~
a.cc:42:14: error: template argument 1 is invalid
   42 |   vector<PAIR> black,white;
      |              ^
a.cc:42:14: error: template argument 2 is invalid
a.cc:45:34: error: request for member 'push_back' in 'black', which is of non-class type 'int'
   45 |       if(a[hi][wi] == '#') black.push_back(make_pair(hi,wi));
      |                                  ^~~~~~~~~
a.cc:46:18: error: request for member 'push_back' in 'white', which is of non-class type 'int'
   46 |       else white.push_back(make_pair(hi,wi));
      |                  ^~~~~~~~~
a.cc:28:35: error: 'begin' was not declared in this scope
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:51:3: note: in expansion of macro 'EACH'
   51 |   EACH(wi, white){
      |   ^~~~
a.cc:28:35: note: suggested alternatives:
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:51:3: note: in expansion of macro 'EACH'
   51 |   EACH(wi, white){
      |   ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:28:35: error: 'end' was not declared in this scope
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:51:3: note: in expansion of macro 'EACH'
   51 |   EACH(wi, white){
      |   ^~~~
a.cc:28:35: note: suggested alternatives:
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:51:3: note: in expansion of macro 'EACH'
   51 |   EACH(wi, white){
      |   ^~~~
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:28:35: error: 'begin' was not declared in this scope
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:53:5: note: in expansion of macro 'EACH'
   53 |     EACH(bi, black){
      |     ^~~~
a.cc:28:35: note: suggested alternatives:
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:53:5: note: in expansion of macro 'EACH'
   53 |     EACH(bi, black){
      |     ^~~~
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:28:35: error: 'end' was not declared in this scope
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:53:5: note: in expansion of macro 'EACH'
   53 |     EACH(bi, black){
      |     ^~~~
a.cc:28:35: note: suggested alternatives:
   28 | #define EACH(i, a) for(auto &&i:(a))
      |                                   ^
a.cc:53:5: note: in expansion of macro 'EACH'
   53 |     EACH(bi, black){
      |     ^~~~
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~