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

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


long long H,W, INF= 1000000000;

//文字は一次元は配列
vector<vector<string> > s(H,vector<string>(W));;

//縦横の移動
long long dx[4] = { 0, 0, 1, -1 }, dy[4] = { 1, -1, 0, 0 };

//X,Yはスタート位置
long long BFS(long long X,long long Y){
    //キューの宣言(二次元)
    queue<pair<long long,long long>> q;
    //可変長配列の宣言(H×Wの配列)　INFは初期値　訪問用の記録変数
    vector<vector<long long> > Dist(H,vector<long long>(W,INF));

    q.push({X,Y});
    Dist[X][Y] = 0;
    while(!q.empty()){
        pair<long long , long long> P = q.front();
        q.pop();
        for(int i = 0; i < 4; i++){
            //X座標、Y座標を±1 Pは現在地
            long long NX = P.first + dx[i], NY = P.second + dy[i];

            //次の訪問先が範囲内の場合
            if (0 <= NX && NX < H && 0 <= NY && NY < W) {
                //次の訪問先が移動可能の場合
                if(s.at[NX][NY] == '.' and Dist[NX][NY] == INF){

                    Dist[NX][NY] = Dist[P.first][P.second] + 1;
                    q.push({NX,NY});
                
                }
            }
        }
    }

    long long MAX = 0;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++)
            if(Dist[i][j] != INF) MAX = max(MAX,Dist[i][j]); 
    }
    return MAX;
}


int main(){
    cin >> H >> W;
    for(int i = 0; i < H; i++ ){
        for(int j = 0; j < W; j++ ){
            cin >> s[i][j];
        }
    } 
    long long ans = 0;
    for(int i = 0; i < H; i++ ){
        for(int j = 0; j < W; j++ ){
            if(s.at[i][j] == '.') ans = max(ans,BFS(i,j)); 
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int BFS(long long int, long long int)':
a.cc:34:24: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   34 |                 if(s.at[NX][NY] == '.' and Dist[NX][NY] == INF){
      |                        ^
a.cc: In function 'int main()':
a.cc:63:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   63 |             if(s.at[i][j] == '.') ans = max(ans,BFS(i,j));
      |                    ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
using pii = pair<int, int>;
int main() {
  int n, m; cin >> n >> m;
  bool g[n][m];
  for (int i=0;i<n;i++) {
    string s; cin >> s;
    for (int j=0;j<m;j++)
      g[i][j] = s[j] == '.';
  }
  
  auto shortest = [&](pii start, pii end) -> int {
    set<pii> vis;
    queue<pair<pii, int>> q;
    q.push({start, 0});
    while (!q.empty()) {
      auto [p, d] = q.front(); q.pop();
      if (vis.count(p)) continue;
      if (p == end) return d;
      vis.insert(p);
      
      int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
      for (int i = 0; i < 4; i++) {
        pii ne = {p.first + dir[i][0], p.second + dir[i][1]};
        if (ne.first < 0 || ne.first >= n || ne.second < 0 || ne.second >= m) continue;
        if (!g[ne.first][ne.second]) continue;
        q.emplace(ne, d + 1);
      }
    }
    return -1;
  };
  
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (!g[i][j]) continue;
      for (int a = 0; a < n; a++) {
        for (int b = 0; b < m; b++) {
          if (!g[a][b]) continue;
          if (i == a && j == b) continue;
          ans = max(ans, shortest({i, j}, {a, b}));
        }
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:27:14: sorry, unimplemented: capture of variably-modified type 'bool [n][m]' that is not an N3639 array of runtime bound
   27 |         if (!g[ne.first][ne.second]) continue;
      |              ^
a.cc:27:14: note: because the array element type 'bool [m]' has variable size
Language: C++

#include "bits/stdc++.h"
using namespace std;
using pii = pair<int, int>;
int main() {
  int n, m; cin >> n >> m;
  bool[n][m] g;
  for (int i=0;i<n;i++) {
    string s; cin >> s;
    for (int j=0;j<m;j++)
      g[i][j] = s[j] == '.';
  }
  
  auto shortest = [&](pii start, pii end) -> int {
    set<pii> vis;
    queue<pair<pii, int>> q;
    q.push({start, 0});
    while (!q.empty()) {
      auto [p, d] = q.front(); q.pop();
      if (vis.count(p)) continue;
      if (p == end) return d;
      vis.insert(p);
      
      int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
      for (int i = 0; i < 4; i++) {
        pii ne = {p.first + dir[i][0], p.second + dir[i][1]};
        if (ne.first < 0 || ne.first >= n || ne.second < 0 || ne.second >= m) continue;
        if (!g[ne.first][ne.second]) continue;
        q.emplace(ne, d + 1);
      }
    }
    return -1;
  };
  
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (!g[i][j]) continue;
      for (int a = 0; a < n; a++) {
        for (int b = 0; b < m; b++) {
          if (!g[a][b]) continue;
          if (i == a && j == b) continue;
          ans = max(ans, shortest({i, j}, {a, b}));
        }
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: structured binding declaration cannot have type 'bool'
    6 |   bool[n][m] g;
      |       ^~~
a.cc:6:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:8: error: conflicting declaration 'auto n'
    6 |   bool[n][m] g;
      |        ^
a.cc:5:7: note: previous declaration as 'int n'
    5 |   int n, m; cin >> n >> m;
      |       ^
a.cc:6:10: error: expected initializer before '[' token
    6 |   bool[n][m] g;
      |          ^
a.cc:10:7: error: 'g' was not declared in this scope
   10 |       g[i][j] = s[j] == '.';
      |       ^
a.cc: In lambda function:
a.cc:27:14: error: 'g' was not declared in this scope
   27 |         if (!g[ne.first][ne.second]) continue;
      |              ^
a.cc: In function 'int main()':
a.cc:37:12: error: 'g' was not declared in this scope
   37 |       if (!g[i][j]) continue;
      |            ^
a.cc:40:16: error: 'g' was not declared in this scope
   40 |           if (!g[a][b]) continue;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
int n,m;
int l[]={-1,0,1,0};
int r[]={0,-1,0,1};
int dfs(int i,int j,char v[][24] ){
	    if(v[i][j]=='#')
	    return 0;
    queue<pair<int,int>>q;
     int  dp[n+1][m+1],a[n][m];
      for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            dp[i][j]=-1; a[i][j]=0;
        }
      }
 
    int ans=0;
    q.push(make_pair(i,j));
    dp[i][j]=0;
    pair<int,int>t;
     while(!q.empty()){
         t=q.front();
        q.pop();
        a[t.x][t.y]=1;
      
 
 
        for(int k=0; k<4; k++){

              if( (t.x+l[k]>=0 && t.x+l[k]<n) && (t.y+r[k]>=0 && t.y+r[k]<m) ){
                       // cout<<t.x+l[k]<<" "<<t.y+r[k]<< " "<<a[t.x+l[k]][t.y+r[k]]<< " "<<v[t.x+l[k]][t.y+r[k]]<<" "<<endl;
                 if(  a[t.x+l[k]][t.y+r[k]]==0 && v[t.x+l[k]][t.y+r[k]]=='.'){
                       //             cout<<t.x+l[k]<<" "<<t.y+r[k]<< " "<<a[t.x+l[k]][t.y+r[k]]<< " "<<v[t.x+l[k]][t.y+r[k]]<<" "<<endl;
                     dp[t.x+l[k]][t.y+r[k]]=dp[t.x][t.y]+1;
                    // cout<<dp[t.x+l[k]][t.y+r[k]]<<" ";
                     ans=max(ans, dp[t.x+l[k]][t.y+r[k]]);
                    q.push(make_pair(t.x+l[k],t.y+r[k]));
 
                 }
 
              }
 
        }
        }
     //cout<<ans<<" ";
  return ans;
}
int main(){
 
         cin>>n>>m;
         char v[21][21];
         for(int i=0; i<n; i++)
           {
               for(int j=0; j<m; j++){
                cin>>v[i][j];
               }
 
           }
         int ans=0;
         for(int i=0; i<n; i++){
 
            for(int j=0; j<m;j++){
          
            ans=max(ans,dfs(i,j,v));
         }}
         cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:33: error: cannot convert 'char (*)[21]' to 'char (*)[24]'
   66 |             ans=max(ans,dfs(i,j,v));
      |                                 ^
      |                                 |
      |                                 char (*)[21]
a.cc:8:26: note:   initializing argument 3 of 'int dfs(int, int, char (*)[24])'
    8 | int dfs(int i,int j,char v[][24] ){
      |                     ~~~~~^~~~~~~
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define INF 1000000007

typedef long long int lli;

typedef struct
{
  int front;
  int rear;
  int data[MAX][3];
} queue;

queue que;

void initQueue(queue *p)
{
  p->front = p->rear = 0;
}

bool emptyQueue(queue *p)
{
  return p->front == p->rear;
}

bool fullQueue(queue *p)
{
  return (p->front - 1 == p->rear) || (p->front == 0 && p->rear == MAX - 1);
}

void queuePop(queue *p)
{
  if (emptyQueue(p))
  {
    printf("UnderFlow\n");
    exit(1);
  }
  else
  {
    p->front++;
    if (p->front == MAX)
      p->front = 0;
  }
}

void queuePush(queue *p, int x, int y, int d)
{
  if (fullQueue(p))
  {
    printf("OverFlow\n");
    exit(1);
  }
  else
  {
    p->data[p->rear][0] = x;
    p->data[p->rear][1] = y;
    p->data[p->rear][2] = d;
    p->rear++;
    if (p->rear == MAX)
      p->rear = 0;
  }
}


int main(void) {
  char s[22][22];
  int h, w;
  scanf("%d %d", &h, &w);
  rep(hi, 0, h) {
    scanf("%s", s[hi]);
  }

  int mx[4] = { 0, 1, 0, -1 };
  int my[4] = { 1, 0, -1, 0 };
  int ans = 0;
  rep(hi, 0, h) {
    rep(wi, 0, w) {
      if ( s[hi][wi] == '#' ) continue;
      int visited[21][21] = {0};
      initQueue(&que);
      visited[hi][wi] = 1;
      queuePush(&que, hi, wi, 0);
      while ( !emptyQueue(&que) ) {
        int x = que.data[que.front][0];
        int y = que.data[que.front][1];
        int d = que.data[que.front][2];
        queuePop(&que);
        ans = max(ans, d);
        rep(mi, 0, 4) {
          int nextX = x + mx[mi];
          int nextY = y + my[mi];
          if ( nextX < 0 || h <= nextX ) continue;
          if ( nextY < 0 || w <= nextY ) continue;
          if ( visited[nextX][nextY] )   continue;
          if ( s[nextX][nextY] == '#' )  continue;
          visited[nextX]nextY] = 1;
          queuePush(&que, nextX, nextY, d + 1);
        }
      }
    }
  }

  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:109:25: error: expected ';' before 'nextY'
  109 |           visited[nextX]nextY] = 1;
      |                         ^~~~~
      |                         ;
main.c:109:30: error: expected statement before ']' token
  109 |           visited[nextX]nextY] = 1;
      |                              ^
main.c:109:32: error: expected expression before '=' token
  109 |           visited[nextX]nextY] = 1;
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int H,W,d[22][22],D,r,i,j,k,l,t[22][22];
char c;
void move(int i,int j,int n){
	if(t[i][j]&&(d[i][j]>n||d[i][j]==-1)){
		d[i][j]=n;
		move(i+1,j,n+1);
		move(i-1,j,n+1);
		move(i,j+1,n+1);
		move(i,j-1,n+1);
	}
}
main(){
	cin>>H>>W;
	for(i=1;i<=H;i++)for(j=1;j<=W;j++){
		cin>>c;
		t[i][j]=(c=='.');
	}
	for(i=1;i<=H;i++)for(j=1;j<=W;j++){
		memset(d,-1,sizeof(n));
		move(i,j,0);
		D=0;
		for(k=1;k<=H;k++)for(l=1;l<=W;l++)D=max(D,d[k][l]);
		r=max(D,r);
	}
	cout<<r;
}


Compiler output:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:21:36: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |                 memset(d,-1,sizeof(n));
      |                                    ^
      |                                    yn
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,mx,s,t,w,k,l,p,x,y,xx,yy,b[4000],c[4000],f[21][21];
//int d[4][2]={{-1,0},{}};
char a[21][21];
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>m;
	d[0][0]=-1,d[0][1]=0;
	d[1][0]=1,d[1][1]=0;
	d[2][0]=0,d[2][1]=-1;
	d[3][0]=0,d[3][1]=1;
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<n;i++)
	    for(int j=0;j<m;j++){
				    memset(f,63,sizeof(f));p=f[1][1];
				    t=1,w=1,b[1]=i,c[1]=j;f[i][j]=0;
				    while(t<=w){
				    	x=b[t];y=c[t];
				    	for(int k=0;k<4;k++){
				    		xx=x+d[k][0];yy=y+d[k][1];
				    		if(xx>=0&&xx<n&&yy>=0&&yy<m&&a[xx][yy]=='.'&&f[x][y]+1<f[xx][yy]){
				    			w++;b[w]=xx;c[w]=yy;f[xx][yy]=f[x][y]+1;
				    		}
				    	}
				    	t++;
				    }
				    for(int k=0;k<n;k++)
				        for(int l=0;l<m;l++)
				            if(f[k][l]!=p) mx=max(mx,f[k][l]);
	            }
	cout<<mx<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'd' was not declared in this scope
    9 |         d[0][0]=-1,d[0][1]=0;
      |         ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int n, m, mx;
vector<vector<char>> grid(1 + n + 1, vector<char>(1 + m + 1, '#'));
 
struct point {
	int i, j;
  	point() {}
  	point(int _i, int _j)
      :i(_i)
      ,j(_j)
    {}
};
 
void BFS(point s) {
	vector<vector<int>> dist(1 + n + 1, vector<int>(1 + m + 1, -1));
  	queue<point> q;
    q.push(s);
    dist[s.i][s.j] = 0;
  	while (!q.empty()) {
    	int i = q.front().i;
      	int j = q.front().j;
      	q.pop();
        for (int di = -1; di <= 1; ++di)
          	for (int dj = -1; dj <= 1; ++dj) 
            	if (di * di + dj * dj == 1) {
            		int ni = i + di;
                	int nj = j + dj;
                	if (grid[ni][nj] == '#') continue;
              		if (dist[ni][nj] != -1) continue;
              		dist[ni][nj] = dist[i][j] + 1;
                	q.push(point(ni, nj));
            	}
    }
  	for (int i = 1; i <= n; ++i)
      	for (int j = 1; j <= m; ++j)
        	mx = max(mx, dist[i][j]);
  	return;
}
 
int main() {
  cin >> n >> m;
  
  for (int i = 1; i <= n; ++i)
    	for (int j = 1; j <= m; ++j) cin >> grid[i][j];
  
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) 
    	if (grid[i][j] != '#') BFS(point(i, j)));
  
  cout << mx << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:48: error: expected ';' before ')' token
   51 |         if (grid[i][j] != '#') BFS(point(i, j)));
      |                                                ^
      |                                                ;
Language: C

// ABC 151-D
// 2020.1.12 bal4u

#include <stdio.h>
#include <string.h>

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	do *s = gc();
	while (*s++ > ' ');
	*(s-1) = 0;
}

int H, W;
char map[22][22];
char vis[22][22];
int ans

#define MAX 1000000
typedef struct { int r, c; int s; } Q;
Q q[MAX+5]; int top, end;
int mv[4][2] = {{-1,0},{0,-1},{1,0},{0,1}};

void bfs(int r0, int c0) {
	int i, r, c, s, rr, cc, ma;

	memset(vis, 0, sizeof(vis));
	top = 0, end = 1;
	q[0].r = r0, q[0].c = c0, q[0].s = 0;
	vis[r0][c0] = 1;
	while (top != end) {
		r = q[top].r, c = q[top].c, s = q[top++].s;
		if (s > ans) ans = s;
		for (i = 0; i < 4; ++i) {
			rr = r + mv[i][0], cc = c + mv[i][1];
			if (map[rr][cc] == '.' && vis[rr][cc] == 0 &&
				rr >= 0 && rr < H && c >= 0 && c < W) {
				vis[rr][cc] = 1;
				q[end].r = rr, q[end].c = cc, q[end++].s = s+1;
			}
		}
	}
}

int main()
{
	int r, c;
	
	H = in(), W = in();
	for (r = 0; r < H; ++r) ins(map[r]);
	for (r = 0; r < H; ++r) for (c = 0; c < W; ++c) {
		if (map[r][c] == '.') bfs(r, c);
	}
	printf("%d\n", ans);
	return 0;
}


Compiler output:
main.c:28:8: error: expected ';' before 'typedef'
   28 | int ans
      |        ^
      |        ;
......
   31 | typedef struct { int r, c; int s; } Q;
      | ~~~~~~~ 
main.c: In function 'bfs':
main.c:44:25: error: 'ans' undeclared (first use in this function); did you mean 'ins'?
   44 |                 if (s > ans) ans = s;
      |                         ^~~
      |                         ins
main.c:44:25: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:65:24: error: 'ans' undeclared (first use in this function); did you mean 'ins'?
   65 |         printf("%d\n", ans);
      |                        ^~~
      |                        ins
Language: C++

#include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<int>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};

struct xydata {
    int x, y;
};

int bfs(int sx, int sy, int gx, int gy) {
    sb = vector<vector<int>>(h, vector<int>(w, 1000));
    xydata first;
    first.x = sx;
    first.y = sy;
    queue<xydata> que;
    que.push(first);
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            sb.at(i).at(j) = 1000;
        }
    }
    sb.at(first.y).at(first.x) = 0;

    while(!que.empty()) {
        xydata now = que.front();
        que.pop();
        if(now.x == gx && now.y == gy) {
            break;
        }
        for(int i = 0; i < 4; ++i) {
            xydata next;
            next.x = now.x+dx.at(i);
            next.y = now.y+dy.at(i);
            if(next.x >= 0 && next.x < w && next.y >= 0 && next.y < h) {
                if(s.at(next.y).at(next.x) == '.' && sb.at(next.y).at(next.x) == 1000) {
                        sb.at(next.y).at(next.x) = sb.at(now.y).at(now.x) + 1;
                        que.push(next);
                    }
                }
            }
        }
    }
    return sb.at(gy).at(gx);
}

int main() {
    cin >> h >> w;
    s = vector<vector<char>>(h, vector<char>(w, '.'));
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            cin >> s.at(i).at(j);
        }
    }

    int maxlen = 0;
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            if(s.at(i).at(j) == '.') {
                for(int k = 0; k < h; ++k) {
                    for(int l = 0; l < w; ++l) {
                        if(i == k && j == l) {
                        
                        }else {
                            if(s.at(k).at(l) == '.') {
                                // cout << j << i << l << k << " ";
                                int len = bfs(j, i, l, k);
                                // cout << len << endl;
                                maxlen = max(maxlen, len);
                            }
                        }
                    }
                }
            }
        }
    }
    
    cout << maxlen << endl;
}


Compiler output:
a.cc: In function 'int bfs(int, int, int, int)':
a.cc:45:5: warning: no return statement in function returning non-void [-Wreturn-type]
   45 |     }
      |     ^
a.cc: At global scope:
a.cc:46:5: error: expected unqualified-id before 'return'
   46 |     return sb.at(gy).at(gx);
      |     ^~~~~~
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef tuple<int, int, int> ti;

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

    int H, W;
    cin >> H >> W;
    vector<string> map(H);
    for (int i = 0; i < H; i++)
    {
        string M;
        cin >> M;
        map.at(i) = M;
    }

    queue<ti> moves;
    //全マスを起点で全探索
    int answer = 0;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(map.at(i).at(j) == '#'){
                continue;
            }
                vector<vector<bool>> alreadyMoved(H, vector<bool>(W, false));
                moves.push(make_tuple(i, j, 0));
          　    alreadyMoved.at(i).at(j) = true;
                while(moves.size()){
                    ti move = moves.front();
                    moves.pop();
                    int curH, curW, count;
                    tie(curH, curW, count) = move;
                    answer = max(answer, count);
                    alreadyMoved.at(curH).at(curW) = true;
                    int nextH, nextW;
                    //上
                    nextH = curH - 1;
                    nextW = curW;
                    if(0 <= nextH && map.at(nextH).at(nextW) == '.' && !alreadyMoved.at(nextH).at(nextW)){
                        moves.push(make_tuple(nextH, nextW, count + 1));
                    }
                    //下
                    nextH = curH + 1;
                    nextW = curW;
                    if(nextH < H && map.at(nextH).at(nextW) == '.' && !alreadyMoved.at(nextH).at(nextW)){
                        moves.push(make_tuple(nextH, nextW, count + 1));
                    }
                    //左
                    nextH = curH;
                    nextW = curW - 1;
                    if(0 <= nextW && map.at(nextH).at(nextW) == '.' && !alreadyMoved.at(nextH).at(nextW)){
                        moves.push(make_tuple(nextH, nextW, count + 1));
                    }
                    //右                    
                    nextH = curH;
                    nextW = curW + 1;
                    if(nextW < W && map.at(nextH).at(nextW) == '.' && !alreadyMoved.at(nextH).at(nextW)){
                        moves.push(make_tuple(nextH, nextW, count + 1));
                    }
                }
        }
    }
    cout << answer << endl;
    return 0;
}

Compiler output:
a.cc:31:11: error: extended character 　 is not valid in an identifier
   31 |           　    alreadyMoved.at(i).at(j) = true;
      |           ^
a.cc: In function 'int main()':
a.cc:31:11: error: '\U00003000' was not declared in this scope
   31 |           　    alreadyMoved.at(i).at(j) = true;
      |           ^~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
using namespace std;
typedef long long llong;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)

static const int MAX = 20;
static const int NIL = -1;
int n, m;
char s[MAX][MAX + 1];
int d[MAX][MAX + 1];
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int ans;

void dfs(int x, int y, int k){
    REP(l, n){
        REP(g, m){
            d[l][g] = NIL;
        }
    }
    queue <pair<int, int> > S;
    S.push(make_pair(x, y));
    d[x][y] = 0;
    if (k == 1) s[x][y] = '#';
    int maxL = 0;
    int maxX = x;
    int maxY = y;
    while (!S.empty()){
        int X = S.front().first;
        int Y = S.front().second;
        S.pop();
        REP(l, 4){
            int nx = X + dx[l];
            int ny = Y + dy[l];
            if (0 <= nx && nx < n && 0 <= ny && ny < m && s[nx][ny] != '#' && d[nx][ny] == NIL){
                if (k == 1) s[nx][ny] = '#';
                S.push(make_pair(nx, ny));
                d[nx][ny] = d[X][Y] + 1;
                if (maxL < d[nx][ny]){
                    maxL = d[nx][ny];
                    maxX = nx;
                    maxY = ny;
                }
            }
        }
    }
    ans = max(ans, maxL);
    if (k == 1) dfs(maxX, maxY, k + 1);
}

int main(){
    cin >> n >> m;
    REP(i, n){
        REP(j, m){
            cin >> s[i][j];
        }
    }

    int cnt = 0;
    ans = 0;
    int h, w;
    REP(i, n){
        REP(j, m){
            if (s[i][j] == '.'){
                h = i:
                w = j;
            }
        }
    }
    dfs(h, w, 0);
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:22: error: found ':' in nested-name-specifier, expected '::'
   70 |                 h = i:
      |                      ^
      |                      ::
a.cc:70:21: error: 'i' is not a class, namespace, or enumeration
   70 |                 h = i:
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#define int long long
const int mod = 1e9+7;  
int power(int a,int b) { if(b==0) return 1; int res = power(a,b/2); if(b&1) return res * res * a; else return res * res; }
 
int mat[20][20];
 
bool isValid(int x,int y,int n,int m){
  if(x>=0&&x<=n-1&&y>=0&&y<=m-1&&mat[x][y]==1) return true;
  else return false;
}
 
int bfs(pair<int,int> src,int n,int m){
 
  queue<pair<int,int>> qu;
  qu.push(src);
  int cost[n][m];
  bool vis[n][m];
 
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      vis[i][j] = false;
      cost[i][j] = 0;
    }
  }
  
  int maxx = 0;
 	vis[src.first][src.second] = 1;
  while(!qu.empty()){ 
    
    pair<int,int> p = qu.front();
    int x = p.first , y = p.second;
    qu.pop();
    maxx = max(maxx,cost[x][y]);
    
    if(isValid(x,y-1,n,m)&&!vis[x][y-1]){
      qu.push({x,y-1});
      cost[x][y-1] = cost[x][y] + 1;
      vis[x][y-1] = 1;
    }
    
    if(isValid(x,y+1,n,m)&&!vis[x][y+1]){
      qu.push({x,y+1});
      cost[x][y+1] = cost[x][y] + 1;
      vis[x][y+1] = 1;
    }
    
    if(isValid(x-1,y,n,m)&&!vis[x-1][y]){
      qu.push({x-1,y});
      cost[x-1][y] = cost[x][y] + 1;
      vis[x-1][y] = 1;
    }
    
    if(isValid(x+1,y,n,m)&&!vis[x+1][y]){      
      qu.push({x+1,y});
      cost[x+1][y] = cost[x][y] + 1;
      vix[x+1][y] = 1;
    }
  }
 
  return maxx;
}
 
 
int32_t main(){
    
  fast;
  int n,m; cin >> n >> m;
  
  vector<pair<int,int>> vp;
 
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      char c; cin >> c;
      if(c=='.'){
        vp.pb({i,j});
        mat[i][j] = 1;
      }else{
        mat[i][j] = 0;
      } 
    }
  }
 
  int ans = 0;
 
  for(int i=0;i<vp.size();i++){
    int ct = bfs({vp[i].fi,vp[i].se},n,m);
    ans = max(ans,ct);
  }
 
  cout << ans;
 
  return 0;
}

Compiler output:
a.cc: In function 'long long int bfs(std::pair<long long int, long long int>, long long int, long long int)':
a.cc:63:7: error: 'vix' was not declared in this scope; did you mean 'vis'?
   63 |       vix[x+1][y] = 1;
      |       ^~~
      |       vis
Language: Java

import java.utli.*;
import java.io.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] hoge = sc.nextLine().split(" ");
        int line = Integer.parseInt(hoge[0]);
        int row = Integer.parseInt(hoge[1]);
        int[][] maze = new int[line][row];
        int result =0;
        for(int l=0;l<line;l++){
            char[] hoja = sc.nextLine().toCharArray();
            for(int r=0;r<row;r++){
                if(hoja[r]=='.'){
                    maze[l][r]=0;
                }else{
                    maze[l][r]=-1;
                }
            }
        }
        for(int l=0;l<line;l++){
            for(int r=0;r<row;r++){
                    int c = calc(maze,l,r,line,row);
                    if(result<c)result=c;
            }
        }
        System.out.println(result);
    }
    private static int calc(int[][] arg,int x,int y,int line,int row){
        int[][] maze = new int[line][row];
        for(int l=0;l<line;l++){
            for(int r=0;r<row;r++){
                maze[l][r]=arg[l][r];
            }
        }
        maze[x][y]=1;
        int result = 1;
        for(int i=2;i<=line*row;i++) {
            for (int l = 0; l < line; l++) {
                for (int r = 0; r < row; r++) {
                    if(maze[l][r]==0) {
                        if (l > 0 && maze[l - 1][r] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (l < line - 1 && maze[l + 1][r] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (r > 0 && maze[l][r - 1] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (r < row - 1 && maze[l][r + 1] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                    }
                }
            }
        }

        return  result-1;
    }
}

Compiler output:
Main.java:1: error: package java.utli does not exist
import java.utli.*;
^
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>

int H, W;
char map[20][20];
int dist_value;
int dist[20][20];

void initdist(){
  dist_value = 0;
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      dist[i][j] = -1;
    }
  }
  return;
}

struct coord  {
  int x;
  int y;
};

int drow[4]={1,-1,0,0};
int dcolumn[4]={0,0,1,-1};
std::queue<coord > queue_next;
coord last;

void bfs(int start_i, int start_j){
  queue_next.push((coord){start_i,start_j});
  dist_value = 0;
  while(queue_next.size()){
    std::queue<coord > queue(queue_next);
    // clear queue_next
    std::queue<coord> empty;
    std::swap(queue_next, empty);
    while(queue.size()){
      int thisi = queue.front().x;
      int thisj = queue.front().y;
      last.x = thisi;
      last.y = thisj;
      queue.pop();
      dist[thisi][thisj]=dist_value;
      for(int k=0; k<4; k++){
        if (thisi+drow[k]>=0 && thisi+drow[k]<H && thisj+dcolumn[k]>=0 && thisj+dcolumn[k]<W){
          if (dist[thisi+drow[k]][thisj+dcolumn[k]]==-1 && map[thisi+drow[k]][thisj+dcolumn[k]]!='#'){
            queue_next.push((coord){thisi+drow[k], thisj+dcolumn[k]});
            dist[thisi+drow[k]][thisj+dcolumn[k]] = dist_value+1;
          }
        }
      }
    }
    dist_value++;
  }
  return;
}


int maxdist(){
  int ans = 0;
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      if (map[i][j]=='#'){
        continue;
      }
      initdist();
      bfs(i,j);
      ans = std::max(ans,dist_value-1);
    }
  }
  return ans;
}

int main(){
  scanf("%d",&H);
  scanf("%d",&W);
  std::string S;

  for (int i=0; i<H; i++){
    std::cin >> S;
    for (int j=0; j<W; j++){
      map[i][j] = S[j];
    }
  }
  int ans = maxdist();
  printf("%d\n",ans);

  return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.utli.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] hoge = sc.nextLine().split(" ");
        int line = Integer.parseInt(hoge[0]);
        int row = Integer.parseInt(hoge[1]);
        int[][] maze = new int[line][row];
        int result =0;
        for(int l=0;l<line;l++){
            char[] hoja = sc.nextLine().toCharArray();
            for(int r=0;r<row;r++){
                if(hoja[r]=='.'){
                    maze[l][r]=0;
                }else{
                    maze[l][r]=-1;
                }
            }
        }
        for(int l=0;l<line;l++){
            for(int r=0;r<row;r++){
                    int c = calc(maze,l,r,line,row);
                    if(result<c)result=c;
            }
        }
        System.out.println(result);
    }
    private static int calc(int[][] arg,int x,int y,int line,int row){
        int[][] maze = new int[line][row];
        for(int l=0;l<line;l++){
            for(int r=0;r<row;r++){
                maze[l][r]=arg[l][r];
            }
        }
        maze[x][y]=1;
        int result = 1;
        for(int i=2;i<=line*row;i++) {
            for (int l = 0; l < line; l++) {
                for (int r = 0; r < row; r++) {
                    if(maze[l][r]==0) {
                        if (l > 0 && maze[l - 1][r] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (l < line - 1 && maze[l + 1][r] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (r > 0 && maze[l][r - 1] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                        if (r < row - 1 && maze[l][r + 1] == i - 1) {
                            maze[l][r] = i;
                            result = i;
                        }
                    }
                }
            }
        }

        return  result-1;
    }
}

Compiler output:
Main.java:1: error: package java.utli does not exist
import java.utli.*;
^
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

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

int main() {
	int h,w,ans;
	cin >> h>>w;
	vector<vector<char>>s(h,vector<char>(w));
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> s.at(i).at(j);
		}
	}
	for (int stai = 0; stai < h; stai++) {
	for (int staj = 0; staj < w; staj++) {
	for (int eni = 0; eni < h; eni++) {
	for (int enj = 0; enj < w; enj++) {
	int k = stai;
	int l = staj;
	int
	while ((!(k == eni)) && (!(l == enj)))
	{

		if (!(k == 1)) {
			k
		}

	}
	}
	}
	}
	}
	cout << ans<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected unqualified-id before 'while'
   20 |         while ((!(k == eni)) && (!(l == enj)))
      |         ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <climits>
#include <iterator>
#include <vector>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

typedef long long ll;
typedef pair<ll, ll> p;

int h, w;
vector<string> v;

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

int res = 0;


int s(int sy, int sx){
  queue<pair<p, int>> st;
  st.push({{sy, sx}, 0});
  vector<vector<int>> vis(h, vector<int>(w, false));
  while(!st.empty()){
    int y = st.front().first.first;
    int x = st.front().first.second;
    int d = st.front().second;
    res = max(res, d);

    // cout << y << ' ' << x << endl;
    // cout << d << endl;
    vis[y][x] = true;

    st.pop();

    for (int i = 0; i < 4; i++) {
      int ny = y + dy[i];
      int nx = x + dx[i];
      int nd = d+1;
      if(ny < 0 || nx < 0) continue;
      if(ny >= h || nx >= w) continue;
      if(v[ny][nx] == '#') continue;

      if(!vis[ny][nx]){
        st.push({{ny, nx}, nd});
      }
    }

  }
  return -1;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w;
  v = vector<string> (h);
  rep(i, h) cin >> v[i];

  for (int sy = 0; sy < h; sy++) {
    for (int sx = 0; sx < w; sx++) {
      // for (int gy = 0; gy < h; gy++) {
      //   for (int gx = 0; gx < w; gx++) {
          if(v[sy][sx] == '#') continue;
          // if(sy == gy && sx == gx) continue;
          res = max(s(sy, sx, vis), res);
      //   }
      // }
    }
  }

  cout << res << endl;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<cmath>
#include<string>
using namespace std;
#define f first
//#define s second
#define MOD 1000000007
#define fast ios::sync_with_stdio(0),cout.tie(0),cin.tie(0)
#define pb push_back
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define mp make_pair
#define mkt make_tuple
#define nax (ll)1e13
typedef long long ll;
typedef unsigned long long ull;
class solution{
public:
	int vertices=0;
	//int edges;
	vector<int> positions;
	vector<int> distance;
	vector<int> adj[402];
	void add(int u,int v){
		adj[u].pb(v);
	}
	
	char mat[20][20];
	void solve(){
		//int h,w;
		int w,h;
		cin>>h>>w;
		
		for(int i =0;i<h;i++){
			for(int j=0;j<w;j++){
				cin>>mat[i][j];
				vertices++;
			}	
		}
		for(int i =0;i<h;i++){
			for(int j=0;j<w;j++){
				if(mat[i][j] == '.'){
					if(i-1>=0){
						if(mat[i-1][j] == '.'){
							add(i*w+j+1,(i-1)*w+j+1);
						}
					}
					if(i+1>=0){
						if(mat[i+1][j] == '.'){
							add(i*w+j+1,(i+1)*w+j+1);
						}
					}
					if(j-1>=0){
						if(mat[i][j-1] == '.'){
							add(i*w+j+1,(i)*w+j);
						}
					}
					if(j+1>=0){
						if(mat[i][j+1] == '.'){
							add(i*w+j+1,(i)*w+j+2);
						}
					}
				}
				else{
					positions.pb(i*w+j+1);
				}
			}
		}
		int ans = 0;
		for(int i =0;i<h;i++){
			for(int j=0;j<w;j++){
				if(mat[i][j] == '.'){
					distance.resize(h*w+1,0);
					for(auto it : positions){
						distance[it] = -1;
					}
					distance[i*w+j+1] = ;
					bfs(i*w+j+1);
					ans = max(ans,*max_element(distance.begin(),distance.end()));
				}
				
			}	
		}
		cout<<ans;
	}
		void bfs(int u) 
	{ 
    	queue<int> q; 
    	q.push(u);
		vector<bool > v(vertices+1,false); 
    	v[u] = true; 
    	while (!q.empty()) { 
        	int f = q.front(); 
        	q.pop(); 
  
        //cout << f << " "; 
  
        // Enqueue all adjacent of f and mark them visited  
        	for (auto it : adj[f]) { 
            	if (!v[it]) { 
                q.push(it); 
                v[it] = true;
				distance[it] = distance[f]+1; 
            } 
        } 
    } 
} 

};

int main()
{
    fast;
	ll i=0;
	solution s;
	s.solve();

 return 0;
}



Compiler output:
a.cc: In member function 'void solution::solve()':
a.cc:77:61: error: expected primary-expression before ';' token
   77 |                                         distance[i*w+j+1] = ;
      |                                                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
#define vcin(a)                          \
    for (int i = 0; i < (a).size(); i++) \
        cin >> (a)[i];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int H, W;

int bfs(int H,int W,vector<vchar> S,int x,int y)
{
    vvint distance(W, vint(H));
    if (S[x][y] == '#')
    {
        return 0;
    }
    pair<int, int> start = {x, y};
    vector<vector<bool>> arrived(W + 1, vector<bool>(H + 1));
    rep(Y, H)
    {
        rep(X, W)
        {
            distance[X][Y] = -1;
        }
    }
    distance[x][y] = 0;
    queue<pair<int, int>> q;
    q.push(start);
    while (!q.empty())
    {
        pair<int, int> now = q.front();
        int nowx = now.first;
        int nowy = now.second;
        int dis = distance[nowx][nowy];
        arrived[nowx][nowy] = true;
        q.pop();
        rep(k, 4)
        {
            if ((nowx + dx[k] < W and nowx + dx[k] >= 0 and nowy + dy[k] < H and nowy + dy[k] >= 0 and S[nowx + dx[k]][nowy + dy[k]] == '.') and arrived[nowx + dx[k]][nowy + dy[k]] == 0)
            {
                q.push({nowx + dx[k], nowy + dy[k]});
                distance[nowx + dx[k]][nowy + dy[k]] = dis + 1;
            }
        }
    } //この時点で最短経路は出てる
    rep(s, W)
    {
        rep(t, H)
        {
            ans = max(distance[s][t], ans);
        }
    }
    return ans;
}

int main()
{
    
    cin >> H >> W;
    vector<vector<char>> S(W, vchar(H));
    int Answer = 0;

    rep(y, H)
    {
        rep(x, W)
        {
            cin >> S[x][y];
        }
    }
    rep(y, H)
    {
        rep(x, W)
        {
            Answer = max(Answer, bfs(H, W, S, x, y));
        }
    }
    cout << Answer;
    return 0;
}


Compiler output:
a.cc: In function 'int bfs(int, int, std::vector<std::vector<char> >, int, int)':
a.cc:69:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   69 |             ans = max(distance[s][t], ans);
      |             ^~~
      |             abs
a.cc:72:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   72 |     return ans;
      |            ^~~
      |            abs
Language: C++

20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................


Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 20 20
      | ^~
Language: C++

#include <bits/stdc++.h>

using namespace std; 
#define REP(i, n) for (int i = 0; i < (n); i++)

typedef long long ll;
typedef pair<int,int> po;
int dx[4] = {0,0,-1,1};
int dy[4] = {1,-1,0,0};
int H, W;
vector<string> board;
ll bfs(int i, int j) {
    vector<string> visited(board.size());
    copy(board.begin(),board.end(),visited.begin());
    queue<po> que;
    queue<int> dist;    
    visited[i][j] = '#';
    REP(k, 4){
        po next = po(i+dx[k],j+dy[k]);
        if (next.first>=0&&next.first<H&&next.second>=0&& next.second <W && visited[next.first][next.second] == '.') {
            visited[next.first][next.second] = '#';
            que.push(next);
            dist.push(1);
        }
    }
    ll d;
    while(!que.empty()){
        po cur = que.front(); que.pop();
        d = dist.front(); dist.pop();
        REP(k, 4){
            po cur_n = po(cur.first+dx[kk],cur.second+dy[k]);
            if (cur_n.first>=0&&cur_n.first<H&&cur_n.second>=0&& cur_n.second <W && visited[cur_n.first][cur_n.second] == '.') {
                visited[cur_n.first][cur_n.second] = '#';
                que.push(cur_n);
                dist.push(d+1);
            }
        }
    }
    return d;
}
int main(int argc, char const *argv[])
{
    cin.tie(0);
   	ios::sync_with_stdio(false);
    cin >> H >> W;
    REP(i, H){
        string s; cin >> s;
        board.push_back(s);
    }
    ll res = 0;
    REP(i, H) {
        REP(j, W) {
            if (board[i][j]=='.')
            res = max(res, bfs(i,j));
        }
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'll bfs(int, int)':
a.cc:31:40: error: 'kk' was not declared in this scope; did you mean 'k'?
   31 |             po cur_n = po(cur.first+dx[kk],cur.second+dy[k]);
      |                                        ^~
      |                                        k
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#ifndef ONLINE_JUDGE
#include "debug.cpp"
#endif
#define int long long
const int mod = 1e9+7;  
int power(int a,int b) { if(b==0) return 1; int res = power(a,b/2); if(b&1) return res * res * a; else return res * res; }

int mat[20][20];

bool isValid(int x,int y,int n,int m){
  if(x>=0&&x<=n-1&&y>=0&&y<=m-1&&mat[x][y]==1) return true;
  else return false;
}

int bfs(pair<int,int> src,pair<int,int> des,int n,int m){

  queue<pair<int,int>> qu;
  qu.push(src);
  int cost[n][m];
  bool vis[n][m];
  memset(cost,0,sizeof(cost));
  memset(vis,false,sizeof(vis));

  int itr = 0;
  while(!qu.empty()){

    pair<int,int> p = qu.front();
    int x = p.first , y = p.second;
    qu.pop();
    vis[x][y] = true;
    if(isValid(x,y-1,n,m)&&!vis[x][y-1]){
      qu.push({x,y-1});
      cost[x][y-1] = cost[x][y] + 1;
    }
    if(isValid(x,y+1,n,m)&&!vis[x][y+1]){
      qu.push({x,y+1});
      cost[x][y+1] = cost[x][y] + 1;
    }
    if(isValid(x-1,y,n,m)&&!vis[x-1][y]){
      qu.push({x-1,y});
      cost[x-1][y] = cost[x][y] + 1;
    }
    if(isValid(x+1,y,n,m)&&!vis[x+1][y]){      
      qu.push({x+1,y});
      cost[x+1][y] = cost[x][y] + 1;
    }
  }

  return cost[des.first][des.second];
}


int32_t main(){
    
  fast;
  int n,m; cin >> n >> m;
  

  vector<pair<int,int>> vp;

  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      char c; cin >> c;
      if(c=='.'){
        vp.pb({i,j});
        mat[i][j] = 1;
      }else{
        mat[i][j] = 0;
      } 
    }
  }

  int ans = 0;

  for(int i=0;i<vp.size();i++){
      pair<int,int> src = vp[i];
    for(int j=i;j<vp.size();j++){
      pair<int,int> des = vp[j];
      int ct = bfs(src,des,n,m);
      ans = max(ans,ct);
    }
  }

  cout << ans;

  return 0;
}

Compiler output:
a.cc:9:10: fatal error: debug.cpp: No such file or directory
    9 | #include "debug.cpp"
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#ifndef ONLINE_JUDGE
#include "debug.cpp"
#endif
#define int long long
const int mod = 1e9+7;  
int power(int a,int b) { if(b==0) return 1; int res = power(a,b/2); if(b&1) return res * res * a; else return res * res; }

int mat[20][20];

bool isValid(int x,int y,int n,int m){
  if(x>=0&&x<=n-1&&y>=0&&y<=m-1&&mat[x][y]==1) return true;
  else return false;
}

int bfs(pair<int,int> src,pair<int,int> des,int n,int m){

  queue<pair<int,int>> qu;
  qu.push(src);
  int cost[n][m];
  bool vis[n][m];
  memset(cost,0,sizeof(cost));
  memset(vis,false,sizeof(cost));

  int itr = 0;
  while(!qu.empty()){

    pair<int,int> p = qu.front();
    int x = p.first , y = p.second;
    qu.pop();
    vis[x][y] = true;
    if(isValid(x,y-1,n,m)&&!vis[x][y-1]){
      qu.push({x,y-1});
      cost[x][y-1] = cost[x][y] + 1;
    }
    if(isValid(x,y+1,n,m)&&!vis[x][y+1]){
      qu.push({x,y+1});
      cost[x][y+1] = cost[x][y] + 1;
    }
    if(isValid(x-1,y,n,m)&&!vis[x-1][y]){
      qu.push({x-1,y});
      cost[x-1][y] = cost[x][y] + 1;
    }
    if(isValid(x+1,y,n,m)&&!vis[x+1][y]){      
      qu.push({x+1,y});
      cost[x+1][y] = cost[x][y] + 1;
    }
  }

  return cost[des.first][des.second];
}


int32_t main(){
    
  fast;
  int n,m; cin >> n >> m;
  

  vector<pair<int,int>> vp;

  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      char c; cin >> c;
      if(c=='.'){
        vp.pb({i,j});
        mat[i][j] = 1;
      }else{
        mat[i][j] = 0;
      } 
    }
  }

  // print(vp);
  int ans = 0;

  for(int i=0;i<vp.size();i++){
      pair<int,int> src = vp[i];
    for(int j=i;j<vp.size();j++){
      pair<int,int> des = vp[j];
      int ct = bfs(src,des,n,m);
      // print(src,des,ct);
      ans = max(ans,ct);
    }
  }

  // bfs({0,0},{0,2},n,m);


  cout << ans;


  

  return 0;
}

Compiler output:
a.cc:9:10: fatal error: debug.cpp: No such file or directory
    9 | #include "debug.cpp"
      |          ^~~~~~~~~~~
compilation terminated.