criyle/codenet-compile-errors huggingface dataset:
Language: C++

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

int h,w;
char a[1000][1000];
queue <pair<pii,int>> q;
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
int d[1000][1000]

int main(){
    cin >> h >> w;
    rep(i,h){
        rep(j,w){
            cin >> a[i][j];
            if(a[i][j] == '#'){
                q.push({{i,j},0});
            }
        }
    }
    int ans = 0;
    while(!q.empty()){
        auto key = q.front();
        ans = max(ans,key.second);
        q.pop();
        rep(0,4){
            int ny = key.first.first + dy[i];
            int nx = key.first.second + dx[i];
            if (ny < 0 || ny >= h || nx < 0 || nx >= w || a[ny][nx] == '#') continue;
            else {
                a[nx][ny] = '#';
                p.push({{nx,xy}, key.second + 1});
            }
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc:13:1: error: expected initializer before 'int'
   13 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;++i)
const int INF = 1e9+7;

int main(){
  int H,W;
  cin >> H >> W;
  vi dh = {0,1,0,-1}, dw = {1,0,-1,0};
  vector<vector<char>> A(H,vector<char>(W));
  vector<vector<int>> B(H,vector<int>(W));
  rep(i,H){
    rep(j,W){
      cin >> A.at(i).at(j);
    }
  }
  queue<P> q;
  rep(i,H){
    rep(j,W){
      B.at(i).at(j) = INF;
      if(A.at(i).at(j)=='#'){
        q.push(P(i,j));
        B.at(i).at(j) = 0;
      }
    }
  }
  int m = 0;
  while(q.size()){
    P p = q.front(); q.pop();
    rep(k,4){
      int nh = p.first + dh.at(k);
      int nw = p.second + dw.at(k);
      if(0<=nh&&nh<H&&0<=nw&&nw<W&&A.at(nh).at(nw)=='.'&&B.at(nh).at(nw)==INF){
        A.at(nh).at(nw) = '#';
        B.at(nh).at(nw) = min(B.at(nh).at(nw), (B.at(p.first).at(p.second) + 1));
        q.push(P(nh,nw));
        m = max(m,B.at(nh).at(nw));
      }
    }
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vi' was not declared in this scope
   10 |   vi dh = {0,1,0,-1}, dw = {1,0,-1,0};
      |   ^~
a.cc:10:21: error: expected primary-expression before ',' token
   10 |   vi dh = {0,1,0,-1}, dw = {1,0,-1,0};
      |                     ^
a.cc:10:23: error: 'dw' was not declared in this scope
   10 |   vi dh = {0,1,0,-1}, dw = {1,0,-1,0};
      |                       ^~
a.cc:32:26: error: 'dh' was not declared in this scope; did you mean 'nh'?
   32 |       int nh = p.first + dh.at(k);
      |                          ^~
      |                          nh
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> P;
#define v(i,j,k,type) vector<vector<type>> i(j,vector<type>(k));
#define x(a,b) x.at(a).at(b)
#define rep(i,n) for(int i=0;i<n;++i)
const int INF = 1e9+7;

int main(){
  int H,W;
  cin >> H >> W;
  vi dh = {0,1,0,-1}, dw = {1,0,-1,0};
  v(A,H,W,char);
  v(B,H,W,int);
  rep(i,H){
    rep(j,W){
      cin >> A.at(i).at(j);
    }
  }
  queue<P> q;
  rep(i,H){
    rep(j,W){
      B(i,j) = INF;
      if(A(i,j)=='#'){
        q.push(P(i,j));
        B(i,j) = 0;
      }
    }
  }
  int m = 0;
  while(q.size()){
    P p = q.front(); q.pop();
    rep(k,4){
      int nh = p.first + dh.at(k);
      int nw = p.second + dw.at(k);
      if(0<=nh&&nh<H&&0<=nw&&nw<W&&A(nh,nw)=='.'&&B(nh,nw)==INF){
        A(nh,nw) = '#';
        B(nh,nw) = min(B(nh,nw), (B(p.first,p.second) + 1));
        q.push(P(nh,nw));
        m = max(m,B(nh,nw));
      }
    }
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   24 |       B(i,j) = INF;
      |       ~^~~~~
a.cc:25:11: error: no match for call to '(std::vector<std::vector<char> >) (int&, int&)'
   25 |       if(A(i,j)=='#'){
      |          ~^~~~~
a.cc:27:10: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   27 |         B(i,j) = 0;
      |         ~^~~~~
a.cc:37:37: error: no match for call to '(std::vector<std::vector<char> >) (int&, int&)'
   37 |       if(0<=nh&&nh<H&&0<=nw&&nw<W&&A(nh,nw)=='.'&&B(nh,nw)==INF){
      |                                    ~^~~~~~~
a.cc:37:52: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   37 |       if(0<=nh&&nh<H&&0<=nw&&nw<W&&A(nh,nw)=='.'&&B(nh,nw)==INF){
      |                                                   ~^~~~~~~
a.cc:38:10: error: no match for call to '(std::vector<std::vector<char> >) (int&, int&)'
   38 |         A(nh,nw) = '#';
      |         ~^~~~~~~
a.cc:39:10: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   39 |         B(nh,nw) = min(B(nh,nw), (B(p.first,p.second) + 1));
      |         ~^~~~~~~
a.cc:39:25: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   39 |         B(nh,nw) = min(B(nh,nw), (B(p.first,p.second) + 1));
      |                        ~^~~~~~~
a.cc:39:36: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   39 |         B(nh,nw) = min(B(nh,nw), (B(p.first,p.second) + 1));
      |                                   ~^~~~~~~~~~~~~~~~~~
a.cc:41:20: error: no match for call to '(std::vector<std::vector<int> >) (int&, int&)'
   41 |         m = max(m,B(nh,nw));
      |                   ~^~~~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
//constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
ll INF = 6001001001001001001;
long double EPS = 1e-6;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

ll dy[4]{-1,0,1,0};
ll dx[4]{0,-1,0,1};

ll H,W,ans=0;
char field[1010][1010];
ll d[1010][1010];

queue<pair<ll,ll>> Q;

void BFS(){
    while(Q.size()){
        ll y,x;
        tie(y,x) = Q.front();
        Q.pop();
        field[y][x] = '#';
        rep(i,4){
            ll ny = y + dy[i],nx = x + dx[i];
            if(0 <= ny && ny < H && 0 <= nx && nx < W){
                if(field[ny][nx] == '.'){
                    Q.emplace(ny,nx);
                    d[ny][nx] = d[y][x] + 1;
                }
            }
        }
    }
}


int main(){
   cin >> H  >> W;
   rep(i,1010)rep(j,1010) d[i][j] = INF;
   rep(i,H)rep(j,W){
       cin >> field[i][j];
       if(field[i][j] == '#'){
           Q.emplace(i,j);
           d[i][j] = 0;
       }
   }
   BFS();
   rep(i,H) rep(j,W) ans = max(ans,d[i][j]);
   cout << ans << endl;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,1,-1};
int n,m,ans;
char s[1111][1111];
struct node
{
	int x,y,step;
};
queue<node> que;
void bfs(){
	while(!que.empty()){
		node now=que.front();que.pop();
		ans=max(ans,now.step);
		for(int i=0;i<4;i++){
			node nex=node{now.x+dx[i],now.y+dy[i],now.step+1};
			if(s[nex.x][nex.y]=='.'){
				s[nex.x][nex.y]=='#';
				que.push(nex);
			}
		}
	}
}

int main(){

  scanf("%d%d",&n,&m);
  for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++)
    {
    	scanf("%c",&s[i][j]);
    	if(s[i][j]=='#')que.push(node{i,j,0});
    }
    bfd();
    printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'bfd' was not declared in this scope; did you mean 'bfs'?
   35 |     bfd();
      |     ^~~
      |     bfs
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<ll>>;
template<typename T=ll,typename U=ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
const ll INF = (ll)1e9;
ll dh[4]{0,1,0,-1};
ll dw[4]{1,0,-1,0};

int main(){
    ll h,w;
    cin >> h >> w;
    auto a = v<string>(h,"");
    rep(i,h) cin >> a[i];
    

    auto que = queue<p<>>();
    
    for(ll c=0;c<h*w/4+1;c++){
        bool f = true;
        auto ff = v<bool>(h,true);
        rep(i,h) {
            if(a[i].find_first_of('.')!=string::npos) {
                f= false;
                ff[i]=false;
            }
        }
        if(f){
            cout << c;
            return 0;
        }


        rep(i,h)
            if(ff[i])continue;
            rep(j,w)
                rep(k,4){
                    if(0<=i+dh[k]&&i+dh[k]<h&&0<=j+dw[k]&&j+dw[k]<w&&a[i][j]=='#'&&a[i+dh[k]][j+dw[k]]=='.'){
                        que.push(make_pair(i+dh[k],j+dw[k]));
                    } 
                }

        while(!que.empty()){
            auto u = que.front(); que.pop();
            a[u.first][u.second]='#';
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:27: error: 'i' was not declared in this scope
   42 |                     if(0<=i+dh[k]&&i+dh[k]<h&&0<=j+dw[k]&&j+dw[k]<w&&a[i][j]=='#'&&a[i+dh[k]][j+dw[k]]=='.'){
      |                           ^
Language: C++

//AGC-A問題
#include <bits/stdc++.h<
using namespace std;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};

int main(){
    int height,width; cin >> height >> width;
    vector<string> A(height);

    for(int h=0;h<height;++h) cin >> A[h];
    vector <vector<int> > dist(height, vector<int>(width,-1));
    queue <pair<int,int> > que;
    for(int h=0;h<height;++h){
        for(int w=0;w<width;++w){
            if(A[h][w]=='#'){
                dist[h][w] = 0;
                que.push(make_pair(h,w));
            }
        }
    }
    while(!que.empty()){
        pair<int,int> current_pos = que.front();
        int y = current_pos.first;
        int x = current_pos.second;
        que.pop();

        for(int direction = 0;direction<4;++direction){
            int next_y = y + dy[direction];
            int next_x = x + dx[direction];
            if(next_x < 0 || next_x >= width || next_y < 0 || next_y >= height) continue;
            if(A[next_y][next_x] == '#') continue;

            if(dist[next_y][next_x] == -1){
                dist[next_y][next_x] = dist[y][x] + 1;
                que.push(make_pair(next_y,next_x));
                A[next_y][next_x] = '#';
            }
        }
    }
    int ans=0;
    for(int h=0;h<height;++h){
        for(int w=0;w<width;++w){
            ans = max(ans,dist[h][w]);
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:2:25: error: missing terminating > character
    2 | #include <bits/stdc++.h<
      |                         ^
a.cc:2:10: fatal error: bits/stdc++.h<: No such file or directory
    2 | #include <bits/stdc++.h<
      |          ^
compilation terminated.
Language: C++

H, W = map(int, input().split())

A = [['#' for i in range(W + 2)]]\
    + [list('#' + input() + '#') for i in range(H)]\
    + [['#' for i in range(W + 2)]]

import collections
q = collections.deque()
for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q.appendleft((i, j, 0))

while True:
    i, j, c = q.pop()
    if A[i - 1][j] == '.':
        q.appendleft((i - 1, j, c + 1))
        A[i - 1][j] = '#'
    if A[i + 1][j] == '.':
        q.appendleft((i + 1, j, c + 1))
        A[i + 1][j] = '#'
    if A[i][j - 1] == '.':
        q.appendleft((i, j - 1, c + 1))
        A[i][j - 1] = '#'
    if A[i][j + 1] == '.':
        q.appendleft((i, j + 1, c + 1))
        A[i][j + 1] = '#'


    if len(q) == 0:
        print(c)
        break


Compiler output:
a.cc:1:1: error: 'H' does not name a type
    1 | H, W = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<char>> a(y,vector<char>(x))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

vector<int> ta={1,0,-1,0};
vector<int> su={0,1,0,-1};
using p=pair<int,int>;

int main(){
  int h,w,x,y,nx,ny;
  cin>>h>>w;
  vec2(a,h,w);
  rep(i,h)rep(j,w) cin>>a[i][j];
  queue<p> bfs;
  vector<vector<int>> seen(h,vector<int>(w,10000000));
  rep(i,h)rep(j,w) if(a[i][j]=='#') {bfs.push(p(i,j));seen[i][j]=0;}
  
  while(!bfs.empty()){
    y=bfs.top().first;x=bfs.top().second;
    bfs.pop();
    rep(i,4){
      ny=y+ta[i];nx=x+su[i];
      if(ny<0||nx<0||nx>=w||ny>=h) continue;
      if(a[ny][nx]=='#') continue;
      a[ny][nx]='#';
      seen[ny][nx]=seen[y][x]+1;
      bfs.push(p(ny,nx));
    }
  }
  int maxi=seen[0][0];
  rep(i,h)rep(j,w){
    maxi =min(maxi,seen[i][j]);
  }
  cout<<maxi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:11: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   27 |     y=bfs.top().first;x=bfs.top().second;
      |           ^~~
      |           pop
a.cc:27:29: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   27 |     y=bfs.top().first;x=bfs.top().second;
      |                             ^~~
      |                             pop
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<char>> a(y,vector<char>(x))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

vector<int> ta={1,0,-1,0};
vector<int> su={0,1,0,-1};
using p=pair<int,int>;

int main(){
  int h,w,x,y,nx,ny;
  cin>>h>>w;
  vec(a,h,w);
  rep(i,h)rep(j,w) cin>>a[i][j];
  queue<p> bfs;
  vector<vector<int>> seen(h,vector<int>(w,10000000));
  rep(i,h)rep(j,w) if(a[i][j]=='#') {bfs.push(p(i,j));seen[i][j]=0;}
  
  while(!bfs.empty()){
    y=bfs.top().first;x=bfs.top().second;
    bfs.pop();
    rep(i,4){
      ny=y+ta[i];nx=x+su[i];
      if(ny<0||nx<0||nx>=w||ny>=h) continue;
      if(a[ny][nx]=='#') continue;
      a[ny][nx]='#';
      seen[ny][nx]=seen[y][x]+1;
      bfs.push(p(ny,nx));
    }
  }
  int maxi=seen[0][0];
  rep(i,h)rep(j,w){
    maxi =min(maxi,seen[i][j]);
  }
  cout<<maxi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'a' was not declared in this scope
   20 |   vec(a,h,w);
      |       ^
a.cc:20:3: error: 'vec' was not declared in this scope; did you mean 'vec1'?
   20 |   vec(a,h,w);
      |   ^~~
      |   vec1
a.cc:27:11: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   27 |     y=bfs.top().first;x=bfs.top().second;
      |           ^~~
      |           pop
a.cc:27:29: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   27 |     y=bfs.top().first;x=bfs.top().second;
      |                             ^~~
      |                             pop
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<char>> a(y,vector<char>(x))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

vector<int> ta={1,0,-1,0};
vector<int> su={0,1,0,-1};
using p=pair<int,int>;

int main(){
  int h,w;
  cin>>h>>w;
  vec(a,h,w);
  rep(i,h)rep(j,w) cin>>a[i][j];
  queue<p> bfs;
  rep(i,h)rep(j,w) if(a[i][j]=='#') bfs.push(p(i,j));
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'a' was not declared in this scope
   20 |   vec(a,h,w);
      |       ^
a.cc:20:3: error: 'vec' was not declared in this scope; did you mean 'vec1'?
   20 |   vec(a,h,w);
      |   ^~~
      |   vec1
Language: C++

#include <bits/stdc++.h>
using namespace std;

int INF = 1e7;
vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};

int main(){
  int H, W;
  vector<vector<int>> A(100010, vector<int>(100010, INF));

  cin >> H >> W;
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      char c; cin >> c;
      if(c == '#') A[i][j] = 0;
    }
  }

  int cur = 0, cnt = 0;
  while(cnt != H*W){
    for(int i=0; i<H; i++){
      for(int j=0; j<W; j++){
        if(A[i][j] == cur){
          for(int k=0; k<4; k++){
            int x = i+dx[k], y = j+dy[k];

            if(0 <= x && x < H && 0 <= y && y <= W){
              if(A[x][y] == INF){
                A[x][y] = cur+1; cnt++;
              } else if (A[x][y] > cur+1){
                A[x][y] = cur+1;
              }
            }
          }
        }
      }
    }
    cur++;
  }

  int cur = 0;
  cout << cur << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:42:7: error: redeclaration of 'int cur'
   42 |   int cur = 0;
      |       ^~~
a.cc:20:7: note: 'int cur' previously declared here
   20 |   int cur = 0, cnt = 0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll h,w;
  cin>>h>>w;
  vvc t(h,vc(w));
  rep(i,h){
    rep(j,w){
      cin>>t[i][j];
    }
  }
  vvll ans(h,vll(w,INF));
  rep(i,h){
    rep(j,w){
      if(t[i][j]=='.') continue;
      pll pp=mp(i,j);
      queue<pll> p;
      p.pu(pp);
      ans[i][j]=0;
      while(p.size()){
        pll ppp=p.front();
        p.pop();
        rep(i,4){
          ll nx=ppp.F+dx[i];
          ll ny=ppp.S+dy[i];
          if(nx>=0&&nx<h&&ny>=0&&ny<w&&t[nx][ny]!='#'){
            a[nx][ny]=min(a[nx][ny],a[ppp.F][ppp.S]+1);
            p.pu(pll(nx,ny));
          }
        }
      }
    }
  }
  ll k=0;
  rep(i,h){
    rep(j,w){
      k=max(ans[i][j],k);
    }
  }
  COUT(k);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:13: error: 'a' was not declared in this scope
   64 |             a[nx][ny]=min(a[nx][ny],a[ppp.F][ppp.S]+1);
      |             ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll h,w;
  cin>>h>>w;
  vvc t(h,vc(w));
  rep(i,h){
    rep(j,w){
      cin>>t[i][j];
    }
  }
  vvll ans(h,vll(w,INF));
  rep(i,h){
    rep(j,w){
      if(t[i][j]=='.') continue;
      pll pp=mp(i,j);
      queue<pll> p;
      p.pu(pp);
      a[i][j]=0;
      while(p.size()){
        pll ppp=p.front();
        p.pop();
        rep(i,4){
          ll nx=ppp.F+dx[i];
          ll ny=ppp.S+dy[i];
          if(nx>=0&&nx<h&&ny>=0&&ny<w&&t[nx][ny]!='#'){
            a[nx][ny]=min(a[nx][ny],a[ppp.F][ppp.S]+1);
            p.pu(pll(nx,ny));
          }
        }
      }
    }
  }
  ll k=0;
  rep(i,h){
    rep(j,w){
      k=max(ans[i][j],k);
    }
  }
  COUT(k);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:7: error: 'a' was not declared in this scope
   56 |       a[i][j]=0;
      |       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int h, w;
    cin >> h >> w;
    char data[1010][1010];
    int map[1010][1010];
    int ans = 0;
    vector<int> q[2];
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            cin >> data[i][j];
            if (data[i][j] == '.')
            {
               
            }
            else
            {
                map[i][j] = 0;
                q[0].push_back(i);
                q[1].push_back(j);
            }
        }
    }
int last[2];
    while (q[0].size() > 0)
    {
        if (data[q[0][0] + 1][q[1][0]] == '.')
        {
            data[q[0][0] + 1][q[1][0]] = 'a';
            map[q[0][0] + 1][q[1][0]] = map[q[0][0]][q[1][0]] + 1;
       //     ans = max(ans, map[q[0][0] + 1][q[1][0]]);
            q[0].push_back(q[0][0] + 1);
            q[1].push_back(q[1][0]);
        }

        if (data[q[0][0]][q[1][0] + 1] == '.')
        {
            data[q[0][0]][q[1][0] + 1] = 'a';
            map[q[0][0]][q[1][0] + 1] = map[q[0][0]][q[1][0]] + 1;
        //    ans = max(ans, map[q[0][0]][q[1][0] + 1]);
            q[0].push_back(q[0][0]);
            q[1].push_back(q[1][0] + 1);
        }

        if (q[0][0] != 0)
        {
            if (data[q[0][0] - 1][q[1][0]] == '.')
            {
                data[q[0][0] - 1][q[1][0]] = 'a';
                map[q[0][0] - 1][q[1][0]] = map[q[0][0]][q[1][0]] + 1;
           //     ans = max(ans, map[q[0][0] - 1][q[1][0]]);
                q[0].push_back(q[0][0] - 1);
                q[1].push_back(q[1][0]);
            }
        }
        if (q[1][0] != 0)
        {
            if (data[q[0][0]][q[1][0] - 1] == '.')
            {
                data[q[0][0]][q[1][0] - 1] = 'a';
                map[q[0][0]][q[1][0] - 1] = map[q[0][0]][q[1][0]] + 1;
              //  ans = max(ans, map[q[0][0]][q[1][0] - 1]);
                q[0].push_back(q[0][0]);
                q[1].push_back(q[1][0] - 1);
            }
        }
        last[0]=q[0][0];
        last[1]=q[1][0];
        q[0].erase(q[0].begin());
        q[1].erase(q[1].begin());
       // cout << ans << endl;
    }

    cout << map[last[0]][[last[1]]];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:25: error: two consecutive '[' shall only introduce an attribute before '[' token
   80 |     cout << map[last[0]][[last[1]]];
      |                         ^
Language: C++

#include<iostream>
#include<vector>
#include<queue>
#include<string>
using namespace std;

int main() {
	int h, w; cin >> h >> w;
	vector<string>A(h); for (auto&& x : A)cin >> x;
	vector<vector<int>>G(h, vector<int>(w, INT_MAX));
	queue<pair<int, int>>que;

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (A[i][j] == '#') {
				G[i][j] = 0;
				que.push({ i,j });
			}
		}
	}

	int ans = 0;
	int dx[4] = { -1,0,1,0 }, dy[4] = { 0,1,0,-1 };
	while (!que.empty()) {
		int x = que.front().first, y = que.front().second;
		que.pop();
		for (int i = 0; i < 4; i++) {
			int nx = x + dx[i], ny = y + dy[i];
			if (0 > nx || 0 > ny || nx >= w || ny >= h || G[ny][nx] != INT_MAX)continue;
			G[ny][nx] = G[y][x] + 1;
			que.push({ nx,ny });
			ans = max(ans, G[ny][nx]);
		}
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:48: error: 'INT_MAX' was not declared in this scope
   10 |         vector<vector<int>>G(h, vector<int>(w, INT_MAX));
      |                                                ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<queue>
  +++ |+#include <climits>
    4 | #include<string>
Language: C++

//#pragma GCC target ("avx2")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long

using namespace std;
using namespace __gnu_pbds;

template <class T> using ordered_set =
tree<T, null_type, less<T>,
rb_tree_tag, tree_order_statistics_node_update>;

const int N = (int)(1e3 + 5);
const int M = (int)(1e9 + 7);
const int INF = (int)(1e18 + 9);
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};

char a[N][N];
int d[N][N];
bool used[N][N];

signed main() {
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j)
      cin >> a[i][j];
  }
  queue <pair <int, int> > q;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == '#') {
        q.push(make_pair(i, j));
        used[i + dx[k]][j + dy[k]] = 1;
      }
    }
  }
  while (!q.empty()) {
    int i = q.front().first;
    int j = q.front().second;
    q.pop();
    for (int k = 0; k < 4; ++k) {
      if (a[i + dx[k]][j + dy[k]] == '.' && used[i + dx[k]][j + dy[k]]) {
        used[i + dx[k]][j + dy[k]] = 1;
        d[i + dx[k]][j + dy[k]] = d[i][j] + 1;
        q.push(make_pair(i + dx[k], j + dy[k]));
      }
    }
  }
  int ret = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == '.')
        ret = max(ret, d[i][j]);
    }
  }
  cout << ret;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:21: error: 'k' was not declared in this scope
   42 |         used[i + dx[k]][j + dy[k]] = 1;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int h,w;
  const int INF = 100000000;
  cin >> h >> w;
  queue<pair<int,int>> que;
  vector<vector<int>> d(h+2,vector<int>(w+2,INF));
  string pad(w+2,'#');
  vector<string> field;
  field.push_back(pad);
  string tmp;
  for(int i=0; i<h; i++){
    cin >> tmp;
    for(int j=0; j<w; j++){
      if(tmp.at(j)=='#'){
        que.push(make_pair(i+1,j+1));
        d[i+1][j+1] = 0;
      }
    }
    field.push_back("#" + tmp + "#");
  }
  field.push_back(pad);
  vector<int> ofst = {0,0,1,-1};
  int ans;
  while(que.size()){
    pair<int,int> p = que.front(); que.pop();
    for(int i=0; i<4; i++){
      int ny=p.first+ofst.at(i),nx=p.second+ofst.at(3-i);
      if(field[ny].at(nx)=='.'&&d[ny][nx]==INF){
        que.push(make_pair(ny,nx));
        ans = d[ny][nx] = d[p.first][p.second]+1;
      }
    }
  }
  cout << d[p.first][p.second] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'p' was not declared in this scope
   37 |   cout << d[p.first][p.second] << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int h,w;
  const int INF = 100000000;
  cin >> h >> w;
  queue<pair<int,int>> que;
  vector<vector<int>> d(h+2,vector<int>(w+2,INF));
  string pad(w+2,'#');
  vector<string> field;
  field.push_back(pad);
  string tmp;
  for(int i=0; i<h; i++){
    cin >> tmp;
    for(int j=0; j<w; j++){
      if(tmp.at(j)=='#'){
        que.push(make_pair(i+1,j+1));
        d[i+1][j+1] = 0;
      }
    }
    field.push_back("#" + tmp + "#");
  }
  field.push_back(pad);
  vector<int> ofst = {0,0,1,-1};
  while(que.size()){
    pair<int,int> p = que.front(); que.pop();
    for(int i=0; i<4; i++){
      int ny=p.first+ofst.at(i),nx=p.second+ofst.at(3-i);
      if(field[ny].at(nx)=='.'&&d[ny][nx]==INF){
        que.push(make_pair(ny,nx));
        d[ny][nx] = d[p.first][p.second]+1;
      }
    }
  }
  cout << d[p.first][p.second] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'p' was not declared in this scope
   36 |   cout << d[p.first][p.second] << endl;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int h, w; cin >> h >> w;
  vector<vector<int>> d(h+2, vector<int>(w+2));
  queue<int> q;
  for (int i = 0; i < h; i++) {
    string s; cin >> s;
    for (int j = 0; j < w; j++) {
      if (s[j] == #) q.push((w+2)*(i+1)+j+1);
      else d[i+1][j+1] = 1e9;
    }
  }
  int res = 0;
  while (q.size()) {
    int p = q.front();
    int r = p / (w+2);
    int c = p % (w+2);
    int dr[] = {-1, 0, 1, 0};
    int dc[] = {0, 1, 0, -1};
    int i = 4;
    while (i--) {
      int nr = r + dr[i];
      int nc = c + dc[i];
      if (d[nr][nc] == 1e9) {
        res = d[nr][nc] = d[r][c] + 1;
        q.push((w+2)*nr+nc);
      }
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc:10:19: error: stray '#' in program
   10 |       if (s[j] == #) q.push((w+2)*(i+1)+j+1);
      |                   ^
a.cc: In function 'int main()':
a.cc:10:20: error: expected primary-expression before ')' token
   10 |       if (s[j] == #) q.push((w+2)*(i+1)+j+1);
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define INF 20006
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
int h,w;
int d[1005][1005];
int dp(int i,int j,int k){
    if(d[i][j]>k){
        d[i][j]=k;
        if(i>0)dp(i-1,j,k+1);
        if(i<h-1)dp(i+1,j,k+1);
        if(j>0)dp(i,j-1,k+1);
        if(j<w-1)dp(i,j+1,k+1);
    }
    return 0;
}
int main(){
  cin>>h>>w;
    memset(d,INF,sizeof(d));
    char a[1005][1005];
    rep(i,h)rep(j,w){
        cin>>a[i][j];
    }
    rep(i,h)rep(j,w){
        if(a[i][j]=='#')dp(i,j,0);
    }
    int ans=0;
    rep(i,h)rep(j,w){
        ans=max(ans,d[i][j]);
     
    }
    cout<<ans;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: expected '}' at end of input
   35 |     return 0;
      |              ^
a.cc:19:11: note: to match this '{'
   19 | int main(){
      |           ^
Language: C

#include <bits/stdc++.h>
using namespace std;

int n,m,x,a,b,c;
bool arr[1005][1005];
char y;
queue < pair < pair <int,int> , int> > q;

int main(){
	memset(arr, -1, sizeof(arr));
	cin>>n>>m;
	x = n*m;
	for(int i=1; i<=n; i++){
		for(int j=1; j<=m; j++){
			cin>>y;
			if(y == '#'){ 
				arr[i][j] = 1;
				q.push(make_pair(make_pair(i,j),0));
			}
		}
	}
	while(x>1){
		a = q.front().first.first;
		b = q.front().first.second;
		c = q.front().second;
		q.pop();
		x--;
		if(a>1 && arr[a-1][b] == 0){
			q.push(make_pair(make_pair(a-1,b),c+1));
			arr[a-1][b] = 1;
		}
		if(a<n && arr[a+1][b] == 0){
			q.push(make_pair(make_pair(a+1,b),c+1));
			arr[a+1][b] = 1;
		}
		if(b>1 && arr[a][b-1] == 0){
			q.push(make_pair(make_pair(a,b-1),c+1));
			arr[a][b-1] = 1;
		}
		if(b<m && arr[a][b+1] == 0){
			q.push(make_pair(make_pair(a,b+1),c+1));
			arr[a][b+1] = 1;
		}
	}
	c = q.front().second;
	q.pop();
	cout<<c<<endl;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(){
    int H,W;
    int a[H,W];
    int i=0,j=0;
    scanf("%d%d",&i&j);
    for(H=0,,H++){
        for(W=0,W<=1000,W++){
                for(i=0,i<=W-1,i++){
                    for(j=0,j<=H-1,j++)
                
            a[i][j+1]=0;
            a[i+1][j]=0;
            a[i][j-1]=0;
            a[i-1][j]=0;
            while(a[i][j]=0)
                printf("%d\n",a[i][j]);
return 0;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: expected ']' before ',' token
    6 |     int a[H,W];
      |            ^
      |            ]
main.c:8:20: error: invalid operands to binary & (have 'int *' and 'int')
    8 |     scanf("%d%d",&i&j);
      |                  ~~^
      |                  |
      |                  int *
main.c:9:13: error: expected expression before ',' token
    9 |     for(H=0,,H++){
      |             ^
main.c:9:17: error: expected expression before ')' token
    9 |     for(H=0,,H++){
      |                 ^
main.c:10:28: error: expected ';' before ')' token
   10 |         for(W=0,W<=1000,W++){
      |                            ^
      |                            ;
main.c:10:28: error: expected expression before ')' token
main.c:11:35: error: expected ';' before ')' token
   11 |                 for(i=0,i<=W-1,i++){
      |                                   ^
      |                                   ;
main.c:11:35: error: expected expression before ')' token
main.c:12:39: error: expected ';' before ')' token
   12 |                     for(j=0,j<=H-1,j++)
      |                                       ^
      |                                       ;
main.c:12:39: error: expected expression before ')' token
main.c:14:13: error: 'a' undeclared (first use in this function)
   14 |             a[i][j+1]=0;
      |             ^
main.c:14:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(){
    int H,W;
    int a[H,W];
    int i=0,j=0;
    scanf("%d%d",&i&j);
    for(H=0,,H++){
        for(W=0,W<=1000,W++){
                for(i=0,i<=W-1,i++){
                    for(j=0,j<=H-1,j++)
                
            a[i][j+1]=0;
            a[i+1][j]=0;
            a[i][j-1]=0;
            a[i-1][j]=0;
            while(a[i][j]=0)
                printf("%d\n",a[i][j]);
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: expected ']' before ',' token
    6 |     int a[H,W];
      |            ^
      |            ]
main.c:8:20: error: invalid operands to binary & (have 'int *' and 'int')
    8 |     scanf("%d%d",&i&j);
      |                  ~~^
      |                  |
      |                  int *
main.c:9:13: error: expected expression before ',' token
    9 |     for(H=0,,H++){
      |             ^
main.c:9:17: error: expected expression before ')' token
    9 |     for(H=0,,H++){
      |                 ^
main.c:10:28: error: expected ';' before ')' token
   10 |         for(W=0,W<=1000,W++){
      |                            ^
      |                            ;
main.c:10:28: error: expected expression before ')' token
main.c:11:35: error: expected ';' before ')' token
   11 |                 for(i=0,i<=W-1,i++){
      |                                   ^
      |                                   ;
main.c:11:35: error: expected expression before ')' token
main.c:12:39: error: expected ';' before ')' token
   12 |                     for(j=0,j<=H-1,j++)
      |                                       ^
      |                                       ;
main.c:12:39: error: expected expression before ')' token
main.c:14:13: error: 'a' undeclared (first use in this function)
   14 |             a[i][j+1]=0;
      |             ^
main.c:14:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
string mp[1111];
int h,w;
int num[1111][1111];
int vx[4]={1,0,-1,0};
int vy[4]={0,-1,0,1};
bool check(int x,int y){
  return x>=0&&x<h&&y>=0&&y<w&&num[x][y]==(1e9);
}
int main(){
  cin>>h>>w;
  for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
  queue<pair<pair<int,int>,int>>que;
  for(int i=0;i<h;i++){
    cin>>mp[i];
    for(int j=0;j<w;j++){
      	if(mp[i][j]=='#'){
          num[i][j]=0;
          que.push(make_pair(make_pair(i,j),0));
        }
    }
  }
  while(!que.empty()){
    pair<int,int>now=que.front().first;
    int cnt=que.front().second;
    for(int i=0;i<4;i++){
      int x=vx[i]+now.first,y=vy[i]+now.second;
      if(check(x,y)){
        num[x][y]=cnt+1;
        que.push(make_pair(make_pair(x,y),cnt+1));
      }
    }
  }
  ll ans=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      ans=max(ans,num[i][j]);
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:3: error: 'll' was not declared in this scope
   35 |   ll ans=0;
      |   ^~
a.cc:38:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |       ans=max(ans,num[i][j]);
      |       ^~~
      |       abs
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
string mp[1111];
int h,w;
int num[1111][1111];
int vx[4]={1,0,-1,0};
int vy[4]={0,-1,0,1};
bool check(int x,int y){
  return x>=0&&x<h&&y>=0&&y<w&&num[x][y]==(1e9);
}
int main(){
  cin>>h>>w;
  for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
  queue<pair<pair<int,int>,int>>que;
  for(int i=0;i<h;i++){
    cin>>mp[i];
    for(int j=0;j<w;j++){
      	if(mp[i][j]=='#'){
          num[i][j]=0;
          que.push(mp(mp(i,j),0));
        }
    }
  }
  while(!que.empty()){
    pair<int,int>now=que.front().first;
    int cnt=que.front().second;
    for(int i=0;i<4;i++){
      int x=vx[i]+now.first,y=vy[i]+now.second;
      if(check(x,y)){
        num[x][y]=cnt+1;
        que.push(mp(mp(x,y),cnt+1));
      }
    }
  }
  ll ans=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      ans=max(ans,num[i][j]);
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                       ~~^~~~~
a.cc:20:22: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                    ~~^~~~~~~~~~~
a.cc:31:23: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                     ~~^~~~~
a.cc:31:20: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                  ~~^~~~~~~~~~~~~~~
a.cc:35:3: error: 'll' was not declared in this scope
   35 |   ll ans=0;
      |   ^~
a.cc:38:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |       ans=max(ans,num[i][j]);
      |       ^~~
      |       abs
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
string mp[1111];
int h,w;
ll num[1111][1111];
int vx[4]={1,0,-1,0};
int vy[4]={0,-1,0,1};
bool check(int x,int y){
  return x>=0&&x<h&&y>=0&&y<w&&num[x][y]==(1e9);
}
int main(){
  cin>>h>>w;
  for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
  queue<pair<pair<int,int>,int>>que;
  for(int i=0;i<h;i++){
    cin>>mp[i];
    for(int j=0;j<w;j++){
      	if(mp[i][j]=='#'){
          num[i][j]=0;
          que.push(mp(mp(i,j),0));
        }
    }
  }
  while(!que.empty()){
    pair<int,int>now=que.front().first;
    int cnt=que.front().second;
    for(int i=0;i<4;i++){
      int x=vx[i]+now.first,y=vy[i]+now.second;
      if(check(x,y)){
        num[x][y]=cnt+1;
        que.push(mp(mp(x,y),cnt+1));
      }
    }
  }
  ll ans=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      ans=max(ans,num[i][j]);
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll num[1111][1111];
      | ^~
a.cc: In function 'bool check(int, int)':
a.cc:9:32: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |   return x>=0&&x<h&&y>=0&&y<w&&num[x][y]==(1e9);
      |                                ^~~
      |                                enum
a.cc: In function 'int main()':
a.cc:13:49: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |   for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
      |                                                 ^~~
      |                                                 enum
a.cc:19:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |           num[i][j]=0;
      |           ^~~
      |           enum
a.cc:20:25: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                       ~~^~~~~
a.cc:20:22: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                    ~~^~~~~~~~~~~
a.cc:30:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   30 |         num[x][y]=cnt+1;
      |         ^~~
      |         enum
a.cc:31:23: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                     ~~^~~~~
a.cc:31:20: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                  ~~^~~~~~~~~~~~~~~
a.cc:35:3: error: 'll' was not declared in this scope
   35 |   ll ans=0;
      |   ^~
a.cc:38:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |       ans=max(ans,num[i][j]);
      |       ^~~
      |       abs
a.cc:38:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   38 |       ans=max(ans,num[i][j]);
      |                   ^~~
      |                   enum
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
string mp[1111];
int h,w;
ll num[1111][1111];
int vx[4]={1,0,-1,0};
int vy[4]={0,-1,0,1};
bool check(int x,int y){
  return x>=0&&x<h&&y>=0&&y<w&&now[x][y]==(1e9);
}
int main(){
  cin>>h>>w;
  for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
  queue<pair<pair<int,int>,int>>que;
  for(int i=0;i<h;i++){
    cin>>mp[i];
    for(int j=0;j<w;j++){
      	if(mp[i][j]=='#'){
          num[i][j]=0;
          que.push(mp(mp(i,j),0));
        }
    }
  }
  while(!que.empty()){
    pair<int,int>now=que.front().first;
    int cnt=que.front().second;
    for(int i=0;i<4;i++){
      int x=vx[i]+now.first,y=vy[i]+now.second;
      if(check(x,y)){
        num[x][y]=cnt+1;
        que.push(mp(mp(x,y),cnt+1));
      }
    }
  }
  ll ans=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      ans=max(ans,num[i][j]);
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll num[1111][1111];
      | ^~
a.cc: In function 'bool check(int, int)':
a.cc:9:32: error: 'now' was not declared in this scope; did you mean 'pow'?
    9 |   return x>=0&&x<h&&y>=0&&y<w&&now[x][y]==(1e9);
      |                                ^~~
      |                                pow
a.cc: In function 'int main()':
a.cc:13:49: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |   for(int i=0;i<1111;i++)for(int j=0;j<1111;j++)num[i][j]=1e9;
      |                                                 ^~~
      |                                                 enum
a.cc:19:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |           num[i][j]=0;
      |           ^~~
      |           enum
a.cc:20:25: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                       ~~^~~~~
a.cc:20:22: error: 'mp' cannot be used as a function
   20 |           que.push(mp(mp(i,j),0));
      |                    ~~^~~~~~~~~~~
a.cc:30:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   30 |         num[x][y]=cnt+1;
      |         ^~~
      |         enum
a.cc:31:23: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                     ~~^~~~~
a.cc:31:20: error: 'mp' cannot be used as a function
   31 |         que.push(mp(mp(x,y),cnt+1));
      |                  ~~^~~~~~~~~~~~~~~
a.cc:35:3: error: 'll' was not declared in this scope
   35 |   ll ans=0;
      |   ^~
a.cc:38:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |       ans=max(ans,num[i][j]);
      |       ^~~
      |       abs
a.cc:38:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   38 |       ans=max(ans,num[i][j]);
      |                   ^~~
      |                   enum
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;

typedef long long ll;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r){return l.second < r.second;}
bool morePair(const ipair& l, const ipair& r){return l.second > r.second;}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const ll MOD = 1e9 + 7;
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }

int main() {
   int H, W;
   cin >> H >> W;
   char f[1001][1001];
   vector<ipair> siro, kuro;
   for (int h = 0; h < H; h++) {
      for (int w = 0; w < W; w++) {
         cin >> f[h][w];
         if (f[h][w] == '#') kuro.push_back(ipair(h, w));
         else siro.push_back(ipair(h, w));
      }
   }
   int ans = 0;
   for (auto it = siro.begin(); it != siro.end(); it++) {
      int a = it->first;
      int b = it->second;
      // cout << a << " " << b << endl;
      
      int tmp = 2010;
      for (auto it2 = kuro.begin(); it2 != kuro.end(); it2++) {
         int x = it2->first;
         int y = it2->second;
         tmp = min(tmp, abs(a - x) + abs(b - y));
      }
      ans = max(ans, tmp);
      
   }
   cout << ans << endl;
   assert(false);
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:4: error: 'assert' was not declared in this scope
   64 |    assert(false);
      |    ^~~~~~
a.cc:9:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    8 | #include<map>
  +++ |+#include <cassert>
    9 |