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

#include<bits/stdc++.h>

using namespace std;

const int maxn = 10000;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
int n,m,ans;
queue<node> temp;
char s[1111][1111];

struct node
{ 
    int x,y,step; 
};

void bfs() 
{
    while(!temp.empty()) 
    {
        node now = temp.front(); 
        temp.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]= '#';
                temp.push(nex);
            }
        }
    }
}

int main() 
{
    cin>>n>>m;
    
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++) 
        {
            cin>>s[i][j];
        
            if(s[i][j] == '#')
                temp.push(node{i, j, 0});
        }
        
    bfs();
    
    cout<<ans<<endl;
    
    return 0;
}

Compiler output:
a.cc:9:7: error: 'node' was not declared in this scope
    9 | queue<node> temp;
      |       ^~~~
a.cc:9:11: error: template argument 1 is invalid
    9 | queue<node> temp;
      |           ^
a.cc:9:11: error: template argument 2 is invalid
a.cc: In function 'void bfs()':
a.cc:19:17: error: request for member 'empty' in 'temp', which is of non-class type 'int'
   19 |     while(!temp.empty())
      |                 ^~~~~
a.cc:21:25: error: request for member 'front' in 'temp', which is of non-class type 'int'
   21 |         node now = temp.front();
      |                         ^~~~~
a.cc:22:14: error: request for member 'pop' in 'temp', which is of non-class type 'int'
   22 |         temp.pop();
      |              ^~~
a.cc:33:22: error: request for member 'push' in 'temp', which is of non-class type 'int'
   33 |                 temp.push(nex);
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:49:22: error: request for member 'push' in 'temp', which is of non-class type 'int'
   49 |                 temp.push(node{i, j, 0});
      |                      ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<queue>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) (a).begin(),(a).end()
#define INF 100000000

vector<ll> dx  = {0, 0, -1, +1};  
vector<ll> dy = {-1, +1, 0, 0}; 

bool compare_by_b(pair<long, long> a, pair<long, long> b){
    return a.second < b.second;
}
 
int main(){
    ll h, w;
    cin >> h >> w;
    vector<string> a(w);
    rep(i, h)cin >> a[i];


    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

int main(){
  int h, w;
  cin >> h >> w;
  vector<string> table;
  vector<vector<int>> d(n, vector<int>(w, -1));
  for(int i=0; i<h; i++){
    string str;
    cin >> str;
    table.push_back(str);
  }
  queue<pair<int, int>> que;
  int count = h * w;
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      if(table[i][j] == '#'){
        d[i][j] = 0;
        que.push(make_pair(i, j));
        count--;
      }
    }
  }
  while(!que.empty){
    int y = que.front().first;
    int x = que.front().second;
    que.pop();
    for (int dx = -1, dy = 0, i = 0; i < 4; dx += dy, dy = dx - dy, dx = dy - dx, ++i) {
      if(x+dx<0 || x+dx>=w || y+dy<0 || y+dy>=h || d[y+dy][x+dx] != -1){
        continue;
      }else{
        que.push(make_pair(y+dy, x+dx));
        d[y+dy][x+dx] = d[y][x] + 1;
        count--;
        if(count == 0){
          cout << d[y+dy][x+dx] << endl;
        }
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'n' was not declared in this scope
   11 |   vector<vector<int>> d(n, vector<int>(w, -1));
      |                         ^
a.cc:28:14: error: cannot convert 'std::queue<std::pair<int, int> >::empty' from type 'bool (std::queue<std::pair<int, int> >::)() const' to type 'bool'
   28 |   while(!que.empty){
      |              ^~~~~
a.cc:28:14: error: in argument to unary !
   28 |   while(!que.empty){
      |          ~~~~^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>

using namespace std;
typedef pair<int,int> pii;
int h,w;
int dist[1005][1005];
char mp[1005][1005];
int dx[]={1,0,-1,0};
int dy[]={0,-1,0,1};

int bfs(){
  memset(dist,-1,sizeof(dist));
  queue<pii> que;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(mp[i][j]=='#'){
	que.push(make_pair(i,j));
	dist[i][j]=0;
      }
    }
  }
  while(!que.empty()){
    pii now=que.front();
    que.pop();
    int ny=now.first;
    int nx=now.second;
    for(int i=0;i<4;i++){
      int ty=ny+dy[i];
      int tx=nx+dx[i];
      if(0<=ty && ty<h && 0<=tx && tx<w){
	if(mp[ty][tx]=='.' && dist[ty][tx]==-1){
	  dist[ty][tx]=dist[ny][nx]+1;
	  mp[ty][tx]='#';
	  que.push(make_pair(ty,tx));
	}
      }
    }
  }
  int maxi=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      maxi=max(maxi,dist[i][j]);
    }
  }
  return maxi;
}
int main(){
  cin>>h>>w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>mp[i][j];
    }
  }
  cout<<bfs()<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int bfs()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(dist,-1,sizeof(dist));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

void unique_vector(vector<int>& v){
	sort(all(v));
	v.erase(unique(all(v)), v.end());
}

int main(){
	int n,m;cin>>n>>m;
	vector<string> v(n);
	rep(i,n)cin>>v[i];
	int ans = 0;
	while(true){
		ans++;
		vector<pii> g;
		rep(i,n)rep(j,m){
			if(nv[i][j]=='#'){
				rep(l,4){
					int x = j+x_pos[l],y=i+y_pos[l];
					if(x<0 || m <= x || y<0 || n<=y) continue;
					if(v[y][x]=='.')g.push_back(make_pair(x,y));
				}
			}
		}
		for(auto p: g)v[p.second][p.first] = '#'
		bool f = true;
		rep(i,n)rep(j,m)if(v[i][j]=='.')f = false;
		if(f)break;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:28: error: 'nv' was not declared in this scope; did you mean 'v'?
   46 |                         if(nv[i][j]=='#'){
      |                            ^~
      |                            v
a.cc:54:57: error: expected ';' before 'bool'
   54 |                 for(auto p: g)v[p.second][p.first] = '#'
      |                                                         ^
      |                                                         ;
   55 |                 bool f = true;
      |                 ~~~~                                     
a.cc:56:49: error: 'f' was not declared in this scope
   56 |                 rep(i,n)rep(j,m)if(v[i][j]=='.')f = false;
      |                                                 ^
a.cc:57:20: error: 'f' was not declared in this scope
   57 |                 if(f)break;
      |                    ^
Language: C++

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

bool a1[1005][1005], a2[1005][1005];
int h,w;


void checkBounds(int i, int j) {
	if (i > 0 && a1[i-1][j]) {
		a2[i][j] = true; return;
	} else if (i < h - 1 && a1[i+1][j]) {
		a2[i][j] = true; return;
	} else if (j > 0 && a1[i][j-1]) {
		a2[i][j] = true; return;
	} else if (j < w -1 && a1[i][j+1]) {
		a2[i][j] = true; return;
	}
}

int main() {
	cin >> h >> w;
	char t;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> t;
			a1[i][j] = (t == '#');
		}
	}

	bool finished = false;
	int count = 0;

	while (!finished) {
		printboard();

		finished = true;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (!a1[i][j]) {
					finished = false;
					checkBounds(i,j);
				} else {
					a2[i][j] = true;
				}
			}
		}

		swap(a1,a2);

		count++;
		if (finished) count--;
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: 'printboard' was not declared in this scope
   34 |                 printboard();
      |                 ^~~~~~~~~~
Language: C++

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

const int INF = (int)1e9;
struct dat {
    int x, y, d;
};

int H, W;
char grid[1000][1000];
int dist[1000][1000];
int ans;

int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    queue<dat> que;
    cin >> H >> W;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> grid[i][j];
            dist[i][j] = INF;
            if (grid[i][j] == '#') {
                que.push({i, j, 0});
                dist[i][j] = 0;
            }
        }
    }

    while (que.size()) {
        dat from = que.front(); que.pop();

        for (int i = 0; i < 4; i++) {
            int nx = from.x+dx[i], ny = from.y+dy[x];
            if (nx < 0 || nx >= H || ny < 0 || ny >= W || dist[nx][ny] != INF) continue;
            que.push({nx, ny, from.d+1});
            dist[nx][ny] = from.d+1;
            ans = max(ans, dist[nx][ny]);
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:51: error: 'x' was not declared in this scope; did you mean 'nx'?
   38 |             int nx = from.x+dx[i], ny = from.y+dy[x];
      |                                                   ^
      |                                                   nx
Language: C++

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

const int INF = (int)1e9;
struct dat {
    int x, y, d;
};

int H, W;
char grid[1000][1000];
int dist[1000][1000];
int ans;

int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    queue.que;
    cin >> H >> W;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> grid[i][j];
            dist[i][j] = INF;
            if (grid[i][j] == '#') {
                que.push({i, j, 0});
                dist[i][j] = 0;
            }
        }
    }

    while (que.size()) {
        dat from = que.front(); que.pop();

        for (int i = 0; i < 4; i++) {
            int nx = from.x+dx[i], ny = from.y+dy[x];
            if (nx < 0 || nx >= H || ny < 0 || ny >= W || dist[nx][ny] != INF) continue;
            que.push({nx, ny, from.d+1});
            dist[nx][ny] = from.d+1;
            ans = max(ans, dist[nx][ny]);
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: expected unqualified-id before '.' token
   21 |     queue.que;
      |          ^
a.cc:28:17: error: 'que' was not declared in this scope
   28 |                 que.push({i, j, 0});
      |                 ^~~
a.cc:34:12: error: 'que' was not declared in this scope
   34 |     while (que.size()) {
      |            ^~~
a.cc:38:51: error: 'x' was not declared in this scope; did you mean 'nx'?
   38 |             int nx = from.x+dx[i], ny = from.y+dy[x];
      |                                                   ^
      |                                                   nx
Language: C++

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

struct dat {
    int x, y, d;
};

const int INF = (int)1e9;

int H, W;
char grid[1000][1000];
int dist[1000][1000]{INF};
int ans;

int dx[] = {0,1,0,-1}, dy[] = {1,0,-1,0};

int main() {
    queue<dat> que;
    cin >> H >> W;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> grid[i][j];
            if (grid[i][j] == '#') {
                que.push(dat{i,j,0});
                dist[i][j] = 0;
            }
        }
    }
    
    while (que.size()) {
        dat from = que.front(); que.pop();

        for (int i = 0; i < 4; i++} {
            int nx = from.x+dx[i], ny = from.y+dy[i];

            if (nx < 0 || nx >= H || ny < 0 || ny >= W || dist[nx][ny] != INF) continue;

            dist[nx][ny] = from.d+1;
            que.push(dat{nx,ny,from.d+1});
            ans = max(ans,dist[nx][ny]);
        }
    }

    cout << ans << endl;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:35: error: expected ')' before '}' token
   34 |         for (int i = 0; i < 4; i++} {
      |             ~                     ^
      |                                   )
a.cc:34:35: error: expected primary-expression before '}' token
a.cc:35:22: error: 'from' was not declared in this scope
   35 |             int nx = from.x+dx[i], ny = from.y+dy[i];
      |                      ^~~~
a.cc:35:32: error: 'i' was not declared in this scope
   35 |             int nx = from.x+dx[i], ny = from.y+dy[i];
      |                                ^
a.cc:37:38: error: 'ny' was not declared in this scope; did you mean 'nx'?
   37 |             if (nx < 0 || nx >= H || ny < 0 || ny >= W || dist[nx][ny] != INF) continue;
      |                                      ^~
      |                                      nx
a.cc:37:80: error: continue statement not within a loop
   37 |             if (nx < 0 || nx >= H || ny < 0 || ny >= W || dist[nx][ny] != INF) continue;
      |                                                                                ^~~~~~~~
a.cc:39:22: error: 'ny' was not declared in this scope; did you mean 'nx'?
   39 |             dist[nx][ny] = from.d+1;
      |                      ^~
      |                      nx
a.cc: At global scope:
a.cc:45:5: error: 'cout' does not name a type
   45 |     cout << ans << endl;
      |     ^~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

//解説AC
#include<iostream>
#include<vector>
#include<queue>

using namespace std;

int main(){
  int H,W; cin >> H >> W;
  int dx[4] = {1,0,-1,0};
  int dy[4] = {0,1,0,-1};
  
   vector<string> A(H);
   vector<vector<int>> dist(H,vector<int>(W,-1));
  // -1 は未到達を表す
  
  for(int i = 0; i < H; i++){ cin >> A[i];}
  
  queue<pair<int,int>> Q;
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if( A[i][j] == '#'){ Q.push(make_pair(i,j)); dist[i][j] = 0;}
                                  }}
                                  
    while(!Q.empty()){
      pair<int,int> p = Q.front();
      Q.pop();
      int s = p.first;
      int t = p.second;
      for(int k = 0; k < 4; k++){
        if( s + dx[k] < 0 || s + dx[k] >= H || t + dy[k] < 0 || t + dy[k] >= W){
          continue;}
        if( dist[ s + dx[k]][ t + dy[k] ] == -1){
          dist[ s + dx[k]][t + dy[k]] = dist[s][t] + 1;
         Q.push(make_pair( s+dx[k] ,t + dy[k]));}}}
                
                int M = 0;
     for(int i = 0; i < H; i++){
       for(int j = 0; j < W; j++){
         M = max( M, dist[i][j]);}}
                
                cout << M << endl;
                return 

Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: expected primary-expression at end of input
   44 |                 return
      |                       ^
a.cc:44:23: error: expected ';' at end of input
   44 |                 return
      |                       ^
      |                       ;
a.cc:44:23: error: expected '}' at end of input
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())
#define de cout << "debug" << endl;
#define push_back pb
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int H,W;
char A[H][W];
int D[1010][1010] = {};
int ans = 0;

int main() {
    cin.tie(0);    
	ios::sync_with_stdio(false);
    
    cin >> H >> W;
    
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            cin >> A[i][j];
        }
    }
    
    
    for(int i = 0; i < 1002; i++){
        D[0][i] = D[i][0] = D[H+1][i] = D[i][W+1] = INF;
    }
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            D[i][j] = A[i][j] == '#' ? 0 : min(D[i-1][j], D[i][j-1]) + 1;
        }
    }
    for(int i = H; i > 0; i--){
        for(int j = W; j > 0;j--){
            D[i][j] = min(D[i][j], min(D[i+1][j], D[i][j+1]) + 1);
        }
    }
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            ans = max(ans,D[i][j]);
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:15:11: error: size of array 'A' is not an integral constant-expression
   15 | char A[H][W];
      |           ^
a.cc:15:8: error: size of array 'A' is not an integral constant-expression
   15 | char A[H][W];
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  int ans=0;
  cin>>h>>w;
  char a[h][w];
  queue<pair<int,int>> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>a[i][j];
      if(a[i][j]=='#'){q.push(pair<int,int> (i,j));}
    }
  }
  vector<vector<int>> distance(h, vector<int> (w, 0));
  while(q.size()){
    pair<int,int> start=q.front(); q.pop();
    int x=start.first();
    int y=start.second();
    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};
    for(int i=0;i<4;i++){
      int cx=x+dx[i];
      int cy=y+dy[i];
      if(0<=cx&&cx<h&&0<=cy&&cy<w){
        distance[cx][cy]=distance[x][y]+1;
        q.push(pair<int,int>(cx,cy));
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      ans=max(ans,distance[i][j]);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expression cannot be used as a function
   18 |     int x=start.first();
      |           ~~~~~~~~~~~^~
a.cc:19:23: error: expression cannot be used as a function
   19 |     int y=start.second();
      |           ~~~~~~~~~~~~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())
#define de cout << "debug" << endl;
#define push_back pb
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
    cin.tie(0);    
	ios::sync_with_stdio(false);
    int H,M;
    cin >> H >> M;
    int D[1010][1010];
    char A[H][M];
    queue<pair<int,int>> Q;
    REP(i,H){
      REP(j,M){
        cin >> A[i][j];
        if(A[i][j] == '#'){
          Q.push(make_pair(i,j));
        }
      }
    }
    
    int a = 0;  //dの値を外に持っていくために作った
    while(!Q.empty()){
        int x = Q.front().first, y = Q.front().second;
        Q.pop();
        int d = D[x][y];
        a = d;
        int dx[4] = {0,1,0,-1};  //xの動く向き
        int dy[4] = {1,0,-1,0};  //yの動く向き（xと連動している）
        REP(i,4){
            int px = x + dx[i];
            int py = y + dy[i];
            //盤外に行った場合はcontinue
            if(px < 0 || px >= H || py < 0 || py >= M) continue;
            if(A[px][py] == '.'){
                Q.push(make_pair(px,py));  //26,27行目同様＃の時queueにpush
                A[px][py] = '#';  //白から黒へと色を変える
                D[px][py] = d+1;  //一つずれるので距離を＋１
            }
        }
    }
    cout << d << endl;
}

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

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

#define f(i,n) for (int i = 0; i < n; i++)

using pii = pair<int,int>;

int di[] = {1,-1,0,0};
int dj[] = {0,0,-1,1};

int main() {
  int n;
  cin >> n >> m;
  int dp[n][m];
  queue<pii> pq;
  f(i,n) f(j,m) {
  	dp[i][j] = n+m+1;
    char c; cin >> c;
    if (c == '#') {
     	dp[i][j] = 0;
      	pq.push(pii(i,j));
    }
  }
  auto in = [&](int i, int j) {
  	return i>=0&&i<n && j>=0&&j<m;
  };
  while (pq.size()) {
  	pii pp = pq.front(); pq.pop();
    int i = pp.first, j = pp.second;
  	f(k,4) {
    	int ni = i+di[k], nj = j+dj[k];
      	if (dp[ni][nj] == n+m+1) {
        	dp[ni][nj] = dp[i][j] + 1;
          	pq.push(pii(ni,nj));
        }
    }
  }
  int ans = 0;
  f(i,n) f(j,m) ans = max(ans,dp[i][j]);
  cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'm' was not declared in this scope
   13 |   cin >> n >> m;
      |               ^
a.cc:17:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   17 |         dp[i][j] = n+m+1;
      |         ^~
      |         dup
a.cc:32:13: error: 'dp' was not declared in this scope; did you mean 'pp'?
   32 |         if (dp[ni][nj] == n+m+1) {
      |             ^~
      |             pp
a.cc:39:31: error: 'dp' was not declared in this scope; did you mean 'dup'?
   39 |   f(i,n) f(j,m) ans = max(ans,dp[i][j]);
      |                               ^~
      |                               dup
Language: Java

import java.util.*;

import com.sun.javafx.scene.paint.GradientUtils.Point;

import static java.lang.Math.*;

import java.awt.SystemTray;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int dx[] = {0, 1, 0, -1};
        int dy[] = {1, 0, -1, 0};

        int h = sc.nextInt();
        int w = sc.nextInt();
        char map[][] = new char[h][w];
        int a[][] = new int[h][w];
        int INF = Integer.MAX_VALUE;
        for(int[] n: a){
            Arrays.fill(n,INF);
        }
        Queue<Point> queue = new ArrayDeque<>();
        for(int i = 0; i < h; i++){
            map[i] = sc.next().toCharArray();
            for(int j=0; j<w; j++){
                if(map[i][j] == '#'){
                queue.add(new Point(i, j));
                a[i][j] = 0;
                }
            }
        }
        int memo = 0;
        while(!queue.isEmpty()){
            Point p = queue.poll();
            for(int k=0; k<4; k++){
                int X = p.x + dx[k];
                int Y = p.y + dy[k];
                if(X>=0 && X<h && Y>=0 && Y<w && a[X][Y]==INF){
                    a[X][Y] = a[p.x][p.y] + 1;
                    queue.add(new Point(X,Y));
                    memo = a[X][Y];
                }
            }
        }
        System.out.println(memo);
    }

}


Compiler output:
Main.java:3: error: package com.sun.javafx.scene.paint.GradientUtils does not exist
import com.sun.javafx.scene.paint.GradientUtils.Point;
                                               ^
Main.java:22: error: cannot find symbol
        Queue<Point> queue = new ArrayDeque<>();
              ^
  symbol:   class Point
  location: class Main
Main.java:27: error: cannot find symbol
                queue.add(new Point(i, j));
                              ^
  symbol:   class Point
  location: class Main
Main.java:34: error: cannot find symbol
            Point p = queue.poll();
            ^
  symbol:   class Point
  location: class Main
Main.java:40: error: cannot find symbol
                    queue.add(new Point(X,Y));
                                  ^
  symbol:   class Point
  location: class Main
5 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h,w;
  cin>>h>>w;
  vector<string> g(h);
  for(int i=0;i<h;i++)cin>>g[i];
  vector<vector<int>> d(h,vector<int>(w,-1));
  vector<pair<int,int>> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(grid[i][j]=='#'){
        que.emplace_back(i,j);
        dist[i][j]=0;
      }
    }
  }
  for(int b=0;b<(int)que.size();b++){
    for(int dx=-1;dx<=1;dx++){
      for(int dy=-1;dy<=1;dy++){
        if(dx*dx+dy*dy==1){
          int xk=que[b].first+dx;
          int yk=que[b].second+dy;
          if(xk >= 0 && yk >= 0 && xk < h && yk < w && dist[xk][yk] == -1) {
            que.emplace_back(xk, yk);
            dist[xk][yk] = dist[que[b].first][que[b].second] + 1;
          }
        }
      }
    }
  }
  cout << dist[que.back().first][que.back().second] << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'grid' was not declared in this scope
   14 |       if(grid[i][j]=='#'){
      |          ^~~~
a.cc:15:9: error: 'que' was not declared in this scope
   15 |         que.emplace_back(i,j);
      |         ^~~
a.cc:16:9: error: 'dist' was not declared in this scope
   16 |         dist[i][j]=0;
      |         ^~~~
a.cc:20:22: error: 'que' was not declared in this scope
   20 |   for(int b=0;b<(int)que.size();b++){
      |                      ^~~
a.cc:26:56: error: 'dist' was not declared in this scope
   26 |           if(xk >= 0 && yk >= 0 && xk < h && yk < w && dist[xk][yk] == -1) {
      |                                                        ^~~~
a.cc:34:11: error: 'dist' was not declared in this scope
   34 |   cout << dist[que.back().first][que.back().second] << '\n';
      |           ^~~~
a.cc:34:16: error: 'que' was not declared in this scope
   34 |   cout << dist[que.back().first][que.back().second] << '\n';
      |                ^~~
Language: C++


#include<iostream>
using namespace std;
int main()
{
    int a;    
  int b;
    cin >>a >>b;
 if(a>=13){
  cout << (b)<< endl;
  
 }
  if(a>=6 && a<=12){
      cout << (b/2) << endl;
    
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

6 6
..#..#
......
#..#..
......
.#....
....#.

Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | ..#..#
      |   ^
a.cc:2:6: error: stray '#' in program
    2 | ..#..#
      |      ^
a.cc:4:2: error: invalid preprocessing directive #.
    4 | #..#..
      |  ^
a.cc:6:2: error: stray '#' in program
    6 | .#....
      |  ^
a.cc:7:5: error: stray '#' in program
    7 | ....#.
      |     ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 6 6
      | ^
Language: C

#include <stdlib.h>

void darker(){
  char *map;
  char *map2;
  int H,W;
  int count = 0;
  scanf("%d%d",&H,&W);
  map = malloc(sizeof(char) * H * W + 1);
  map2 = malloc(sizeof(char) * H * W + 1);
  for(int i = 0;i < H;i++){
    printf("%d\n",i);
    scanf("%s",&map[i * W]);
  }
  for(int i = 0;i < H * W;i++){
    map2[i] = map[i];
  }
  while(1){
    count++;
    for(int i = 0;i < H * W;i++){
      if(map[i] == '#'){
        if(i - W >= 0)map2[i - W] = '#';
        if(i + W < H * W)map2[i + W] = '#';
        if(i + 1 < H * W)map2[i + 1] = '#';
        if(i - 1 >= 0)map2[i - 1] = '#';
      }
    }
    for(int i = 0;i < H * W;i++)map[i] = map2[i];
    int flag = 1;
    for(int i = 0;i < H * W;i++)if(map2[i] == '.'){
      flag = 0;
      break;
    }
    if (flag)break;
  }
  free(map);
  free(map2);
  printf("%d\n",count);
}

Compiler output:
main.c: In function 'darker':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d%d",&H,&W);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <stdlib.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d%d",&H,&W);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |     printf("%d\n",i);
      |     ^~~~~~
main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:38:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   38 |   printf("%d\n",count);
      |   ^~~~~~
main.c:38:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

void bfs(int H, int W, int sy, int sx, vector<vector<char>> maze, vector<vector<int>> &distance) {
    
    int INF = 1000000;
    vector<int> dx = {1, 0, -1, 0};
    vector<int> dy = {0, -1, 0, 1};
    
    queue <pair<int, int>> que; //これからみるマスをしまう
    
    que.push(pair<int, int> (sy, sx));
    distance.at(sy).at(sx) = 0;
    
    vector<vector<bool>> reached(H, vector<bool>(W));
    while (que.size() != 0) {
        pair<int, int> now = que.front();
        que.pop();
        
        for(int i = 0; i < 4; i++) {
            int ny = now.first + dy.at(i);
            int nx = now.second + dx.at(i);
            
            if(0<=ny && ny<H && 0<=nx && nx<W && !(reached.at(ny).at(nx))) {
                reached.at(ny).at(nx) = true;
                if(distance.at(ny).at(nx) > distance.at(now.first).at(now.second) + 1) {
                    que.push(pair<int, int> (ny, nx));
                    distance.at(ny).at(nx) = distance.at(now.first).at(now.second) + 1
                    
                }
            }
        }
    }

}

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<char>> maze(H, vector<char>(W));
    for(int i = 0; i < H; i++) {
        for(int j= 0; j < W; j++) {
            cin >> maze.at(i).at(j);
        }
    }
    vector<vector<int>> distance(H, vector<int>(W, 1000000));
    
    for(int i = 0; i < H; i++) {
        for(int j= 0; j < W; j++) {
            if(maze.at(i).at(j) == '#') bfs(H, W, i, j, maze, distance);
        }
    }
    
    int ans = 0;
    for(int i = 0; i < H; i++) {
        for(int j= 0; j < W; j++) {
            ans = max(ans, distance.at(i).at(j));
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void bfs(int, int, int, int, std::vector<std::vector<char> >, std::vector<std::vector<int> >&)':
a.cc:28:87: error: expected ';' before '}' token
   28 |                     distance.at(ny).at(nx) = distance.at(now.first).at(now.second) + 1
      |                                                                                       ^
      |                                                                                       ;
   29 | 
   30 |                 }
      |                 ~
Language: C++

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, -1, 0, 1};
typedef pair<pll, ll> plll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll H, W;
    cin >> H >> W;
    bool visited[H][W];
    queue<plll> qu;
    string s;
    REP(i, H){
    	cin >> s;
    	REP(j, W){
    		if(s[j] == '#'){
    			qu.push({{i, j}, 0});
    			visited[i][j] = true;
    		}else{
    			visited[i][j] = false;
    		}
    	}
    }

    ll res = -1;
    while(!qu.empty()){
    	auto now = qu.front();qu.pop();
    	ll cx = now.first.first;
    	ll cy = now.first.second;
    	ll cd = now.second;
    	res = max(nd, res);
    	REP(i, 4){
    		ll nx = cx + dx[i];
    		ll ny = cy + dy[i];
    		ll nd = cd + 1;
    		if(nx < 0 || nx > H-1 || ny < 0 || ny > W-1) continue;
    		if(visited[nx][ny]) continue;
    		visited[nx][ny] = true;
    		qu.push({{nx, ny}, nd});
    	}
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:19: error: 'nd' was not declared in this scope; did you mean 'cd'?
   57 |         res = max(nd, res);
      |                   ^~
      |                   cd
Language: C++

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, -1, 0, 1};
typedef pair<pll, ll> plll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll H, W;
    cin >> H >> W;
    bool visited[H][W];
    queue<plll> qu;
    string s;
    REP(i, H){
    	cin >> s;
    	REP(j, W){
    		if(s[j] == '#'){
    			qu.push_back({{i, j}, 0});
    			visited[i][j] = true;
    		}else{
    			visited[i][j] = false;
    		}
    	}
    }

    ll res = -1;
    while(!qu.empty()){
    	auto now = qu.front();qu.pop();
    	ll cx = now.first.first;
    	ll cy = now.first.second;
    	ll cd = now.second;
    	REP(i, 4){
    		ll nx = cx + dx[i];
    		ll ny = cy + dy[i];
    		ll nd = cd + 1;
    		if(nx < 0 || nx > H-1 || ny < 0 || ny > W-1) continue;
    		if(visited[nx][ny]) continue;
    		visited[nx][ny] = true;
    		qu.push({{nx, ny}, nd});
    		res = max(nd, res);
    	}
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:28: error: 'class std::queue<std::pair<std::pair<long long int, long long int>, long long int> >' has no member named 'push_back'
   43 |                         qu.push_back({{i, j}, 0});
      |                            ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int main(){
  int h,w;
  cin>>h>>w;
  int d[1100][1100];
  int dx[4]={1,0,-1,0};
  int dy[4]={0,1,0,-1};
  queue<pii> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      char c;cin>>c;
      if(c=='.'){
        d[i][j]=1;
      }
      else q.push({i,j});
    }
  }
  int count=0;
  while(!q.empty()){
    queue<pii> qq;
    while(!q.empty()){
      pii p=q.front();
      d[q.first][q.second]=0;
      q.pop();
      for(int i=0;i<4;i++){
        if(d[p.first+dx[i]][p.second+dy[i]]){
          qq.push({p.first+dx[i],p.second+dy[i]});
        }
      }
    }
    count++;
    q=qq;
  }
  cout<<count-1<<endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'class std::queue<std::pair<int, int> >' has no member named 'first'
   25 |       d[q.first][q.second]=0;
      |           ^~~~~
a.cc:25:20: error: 'class std::queue<std::pair<int, int> >' has no member named 'second'
   25 |       d[q.first][q.second]=0;
      |                    ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> d.at(h).at(w);
  int dx[4]={1,0,-1,0};
  int dy[4]={0,1,0,-1};
  queue<pii> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      char c;cin>>c;
      if(c=='.'){
        d[i][j]=1;
      }
      else q.push({i,j});
    }
  }
  int count=0;
  while(!q.empty()){
    queue<pii> qq;
    while(!q.empty()){
      pii p=q.front();
      q.pop();
      for(int i=0;i<4;i++){
        if(d[p.first+d[i]][p.second+d[j]]){
          qq.push({p.first+d[i],p.second+d[j]});
        }
      }
    }
    count++;
    q=qq;
  }
  cout<<count-1<<endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected initializer before '.' token
    7 |   vector<vector<int>> d.at(h).at(w);
      |                        ^
a.cc:15:9: error: 'd' was not declared in this scope
   15 |         d[i][j]=1;
      |         ^
a.cc:27:12: error: 'd' was not declared in this scope
   27 |         if(d[p.first+d[i]][p.second+d[j]]){
      |            ^
a.cc:27:39: error: 'j' was not declared in this scope
   27 |         if(d[p.first+d[i]][p.second+d[j]]){
      |                                       ^
a.cc:28:18: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
   28 |           qq.push({p.first+d[i],p.second+d[j]});
      |           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::queue<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int main(){
  int h,w;
  cin>>h>>w;
  int d[1100][1100];
  int dx[4]={1,0,-1,0};
  int dy[4]={0,1,0,-1};
  queue<pii> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      char c;cin>>c;
      if(c=='.'){
        d[i][j]=1;
      }
      else q.push({i,j});
    }
  }
  int count=0;
  while(!q.empty()){
    queue<pii> qq;
    while(!q.empty()){
      pii p=q.front();
      q.pop();
      for(int i=0;i<4;i++){
        if(d[p.first+d[i]][p.second+d[i]]){
          qq.push({p.first+d[i],p.second+d[i]});
        }
      }
    }
    count++;
    q=qq;
  }
  cout<<count-1<<endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: invalid types 'int [1100][1100][int*]' for array subscript
   27 |         if(d[p.first+d[i]][p.second+d[i]]){
      |             ^
a.cc:28:18: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
   28 |           qq.push({p.first+d[i],p.second+d[i]});
      |           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::queue<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int main(){
  int h,w;
  cin>>h>>w;
  int d[1100][1100];
  int dx[4]={1,0,-1,0};
  int dy[4]={0,1,0,-1};
  queue pii q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      char c;cin>>c;
      if(c=='.'){
        d[i][j]=1;
      }
      else q.push({i,j});
    }
  }
  int count=0;
  while(!q.empty()){
    queue<pii> qq;
    while(!q.empty()){
      pii p=q.front();
      q.pop();
      for(int i=0;i<4;i++){
        if(d[p.first+d[i]][p.second+d[i]]){
          qq.push({p.first+d[i],p.second+d[i]});
        }
      }
    }
    count++;
    q=qq;
  }
  cout<<count-1<<endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected initializer before 'q'
   10 |   queue pii q;
      |             ^
a.cc:17:12: error: 'q' was not declared in this scope
   17 |       else q.push({i,j});
      |            ^
a.cc:21:10: error: 'q' was not declared in this scope
   21 |   while(!q.empty()){
      |          ^
a.cc:27:13: error: invalid types 'int [1100][1100][int*]' for array subscript
   27 |         if(d[p.first+d[i]][p.second+d[i]]){
      |             ^
a.cc:28:18: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
   28 |           qq.push({p.first+d[i],p.second+d[i]});
      |           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::queue<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; value_type = std::pair<int, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: Java

import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int height = Integer.parseInt(sc.next());
		int width  = Integer.parseInt(sc.next());

		boolean[][] board = new boolean[height + 2][width + 2];

		for (int i = 0; i < height; i++) {
			String s = sc.next();

			for (int j = 0; j < width; j++) {
				board[i + 1][j + 1] = (s.charAt(j) == '#');
			}
		}

		sc.close();


		int count = 0;
		boolean[][] nextboard = new boolean[height + 2][width + 2];

		while (true) {
			for (int i = 1; i < height + 1; i++) {
				for (int j = 1; j < width + 1; j++) {
					nextboard[i][j] =  board[i][j]
									|| board[i - 1][j]
									|| board[i + 1][j]
									|| board[i][j - 1]
									|| board[i][j + 1];
				}
			}

			for (int i = 1; i < height + 1; i++) {
				for (int j = 1; j < width + 1; j++) {
					board[i][j] = nextboard[i][j];
				}
			}

			count++;

			int number = 0;

			for (int i = 1; i < height + 1; i++) {
				for (int j = 1; j < width + 1; j++) {
					if (board[i][j]) number++;
				}
			}

			if (number == height * width) break;
		}

		System.out.println(count);
	}

Compiler output:
Main.java:60: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

package sample;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		Integer height = Integer.parseInt(sc.next());
		Integer width  = Integer.parseInt(sc.next());

		List<List<Boolean>> board = new ArrayList<>();

		board.add(new ArrayList<>());
		for (int i = 0; i < height + 2; i++) {
			board.get(0).add(false);
		}

		for (int i = 0; i < height; i++) {
			board.add(new ArrayList<>());
			String s = sc.next();
			board.get(i + 1).add(false);

			for (int j = 0; j < width; j++) {
				board.get(i + 1).add(s.charAt(j) == '#');
			}

			board.get(i + 1).add(false);
		}

		board.add(new ArrayList<>());
		for (int i = 0; i < height + 2; i++) {
			board.get(0).add(false);
		}

		sc.close();


		int count = 0;
		List<List<Boolean>> nextboard = new ArrayList<>();
		for (int i = 0; i < height + 2; i++) {
			nextboard.add(new ArrayList<>());

			for (int j = 0; j < width + 2; j++) {
				nextboard.get(i).add(false);
			}
		}

		while (board.stream().anyMatch(s -> s.stream().anyMatch(t -> t))) {
			for (int i = 1; i < height + 1; i++) {
				for (int j = 1; j < width + 1; j++) {
					nextboard.get(i).set(j, board.get(i - 1).get(j)
										 || board.get(i + 1).get(j)
										 || board.get(i).get(j - 1)
										 ||	board.get(i).get(j + 1));
				}
			}

			for (int i = 1; i < height + 1; i++) {
				for (int j = 1; j < width + 1; j++) {
					board.get(i).set(j, nextboard.get(i).get(j));
				}
			}

			count++;
		}

		System.out.println(count);
	}
}


Compiler output:
Main.java:7: error: class Test is public, should be declared in a file named Test.java
public class Test
       ^
1 error