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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {

  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  int h, w;

  cin >> h >> w;

  int sx, sy, fx, fy;

  cin >> sx >> sy >> fx >> fy;

  sx--; sy--; fx--; fy--;

  vector<string> m(h);

  for(int i = 0; i < h; i++) cin >> m[i];

  vector<vector<int> > cost(h, vector<int>(w, 1e9 + 42));

  for(int i = 0; i < h; i++)
    for(int j = 0; j < w; j++)
      cost[i][j] = inf;

  cost[sx][sy] = 0;

  deque<int> qx, qy;

  qx.push_front(sx);
  qy.push_front(sy);

  while(!qx.empty()) {
    int x = qx.front(), y = qy.front();
    qx.pop_front(); qy.pop_front();
    for(int mm = 0; mm < 4; mm++) {
      int cx = x + movex[mm], cy = y + movey[mm];
      if(cx >= 0 && cx < h && cy >= 0 && cy < w && m[cx][cy] == '.' && cost[cx][cy] > cost[x][y]) {
        cost[cx][cy] = cost[x][y];
        qx.push_front(cx);
        qy.push_front(cy);
      }
    }
    for(int xx = x - 2; xx <= x + 2; xx++)
      for(int yy = y - 2; yy <= y + 2; yy++) {
        if(xx >= 0 && xx < h && yy >= 0 && yy < w && m[xx][yy] == '.' && cost[xx][yy] > cost[x][y] + 1) {
          cost[xx][yy] = cost[x][y] + 1;
          qx.push_front(xx);
          qy.push_front(yy);
        }
      }
  }

  cout << (cost[fx][fy] >= 1e9 ? -1 : cost[fx][fy]);

  return 0;
}
/*

*/


Compiler output:
a.cc: In function 'int main()':
a.cc:53:20: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   53 |       cost[i][j] = inf;
      |                    ^~~
      |                    ynf
a.cc:66:20: error: 'movex' was not declared in this scope
   66 |       int cx = x + movex[mm], cy = y + movey[mm];
      |                    ^~~~~
a.cc:67:31: error: 'cy' was not declared in this scope; did you mean 'cx'?
   67 |       if(cx >= 0 && cx < h && cy >= 0 && cy < w && m[cx][cy] == '.' && cost[cx][cy] > cost[x][y]) {
      |                               ^~
      |                               cx
Language: C++

//#include <fsociety>
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <iomanip> 
#include <stdio.h>
//end of libraries ;
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// ll lmax(ll o , ll w) {if(o>w)return o; return w;}
// ll lmin(ll o , ll w) {if(o<w)return o; return w;}
#define LNF 3999999999999999999
#define INF 999999999
#define N 2000
#define PI 3.14159265359
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define mkp(a,b) make_pair(a,b)
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
int h , w , ch , cw , dh , dw , dp[N][N] , ans = INF;
string a[N];
int movex[] = {1 , 0 , -1 , 0};
int movey[] = {0 , 1 , 0 , -1};
deque< pair<int,int> > q;
bool check(int x , int y){
    if(x < 0 || y < 0) return 0;
    if(x >= h || y >= w) return 0;
    return 1;
}
int main(){
fcin;
    cin >> h >> w;
    cin >> ch >> cw;
    cin >> dh >> dw;
    dh--; dw--;
    ch--; cw--;
    for(int i = 0 ; i < h ; i++){
        cin >> a[i];
    }
    for(int i = 0 ; i < h ; i++){
        for(int j = 0 ; j < w ; j++){
            dp[i][j] =INF;
        }
    }
    dp[ch][cw] = 0;
    q.push_back(mkp(ch,cw));
    while(sz(q) > 0){
        int x = q.front().F , y = q.front().S;
        q.pop_front();
        for(int i = 0 ; i < 4 ; i++){
                int newx  = x + movex[i] , newy = y + movey[i];
                if(!check(newx,newy)) continue;
                if(a[newx][newy]=='.' && dp[newx][newy]>dp[x][y]) {dp[newx][newy] = dp[x][y];q.push(mkp(newx,newy));}
            }
        for(int i = x-2 ; i <= x + 2 ; i++){
                for(int j = y-2 ; j <= y+2 ; j++){
                    if(!check(i,j)) continue;
                    if(a[i][j]=='.' && dp[i][j]>dp[x][y]+1) {
                        dp[i][j] = dp[x][y] + 1;
                        q.push(mkp(i,j));}
                }
        }        
    }
    if(dp[dh][dw] == INF) cout <<"-1";
    else cout << dp[dh][dw] << '\n';

}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:96: error: 'class std::deque<std::pair<int, int> >' has no member named 'push'
   71 |                 if(a[newx][newy]=='.' && dp[newx][newy]>dp[x][y]) {dp[newx][newy] = dp[x][y];q.push(mkp(newx,newy));}
      |                                                                                                ^~~~
a.cc:78:27: error: 'class std::deque<std::pair<int, int> >' has no member named 'push'
   78 |                         q.push(mkp(i,j));}
      |                           ^~~~
Language: C++

//#include <fsociety>
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <iomanip> 
#include <stdio.h>
//end of libraries ;
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// ll lmax(ll o , ll w) {if(o>w)return o; return w;}
// ll lmin(ll o , ll w) {if(o<w)return o; return w;}
#define LNF 3999999999999999999
#define INF 999999999
#define N 2000
#define PI 3.14159265359
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define mkp(a,b) make_pair(a,b)
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
int h , w , ch , cw , dh , dw , dp[N][N] , ans = INF;
string a[N];
int movex[] = {1 , 0 , -1 , 0};
int movey[] = {0 , 1 , 0 , -1};
dequeue< pair<int,int> > q;
bool check(int x , int y){
    if(x < 0 || y < 0) return 0;
    if(x >= h || y >= w) return 0;
    return 1;
}
void dfs(int x , int y , int c){
    if(!check(x,y)) return;
    dp[x][y] = c;
    
    if(x==dh && y==dw) {ans = min(ans,c); return; }
 
    
}
int main(){
fcin;
    cin >> h >> w;
    cin >> ch >> cw;
    cin >> dh >> dw;
    dh--; dw--;
    ch--; cw--;
    for(int i = 0 ; i < h ; i++){
        cin >> a[i];
    }
    for(int i = 0 ; i < h ; i++){
        for(int j = 0 ; j < w ; j++){
            dp[i][j] =INF;
        }
    }
    dp[ch][cw] = 0;
    q.push_back(mkp(ch,cw));
    while(sz(q) > 0){
        int x = q.front().F , y = q.front().S;
        q.pop_front();
        for(int i = 0 ; i < 4 ; i++){
                int newx  = x + movex[i] , newy = y + movey[i];
                if(!check(newx,newy)) continue;
                if(a[newx][newy]=='.' && dp[newx][newy]>dp[x][y]) {dp[newx][newy] = dp[x][y];q.push(mkp(newx,newy));}
            }
        for(int i = x-2 ; i <= x + 2 ; i++){
                for(int j = y-2 ; j <= y+2 ; j++){
                    if(!check(i,j)) continue;
                    if(a[i][j]=='.' && dp[i][j]>dp[x][y]+1) {
                        dp[i][j] = dp[x][y] + 1;
                        q.push(mkp(i,j));}
                }
        }        
    }
    if(dp[dh][dw] == INF) cout <<"-1";
    else cout << dp[dh][dw] << '\n';

}

Compiler output:
a.cc:42:1: error: 'dequeue' does not name a type
   42 | dequeue< pair<int,int> > q;
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:72:5: error: 'q' was not declared in this scope
   72 |     q.push_back(mkp(ch,cw));
      |     ^
a.cc:77:51: error: 'y' was not declared in this scope
   77 |                 int newx  = x + movex[i] , newy = y + movey[i];
      |                                                   ^
a.cc:82:29: error: 'y' was not declared in this scope
   82 |                 for(int j = y-2 ; j <= y+2 ; j++){
      |                             ^
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll N = 1e4 + 42, inf = 1e9 + 42;
char m[N][N];
ll h, w;
ll sx, sy, fx, fy;
ll cur = 0;
int cost[N][N];
int movex[4] = {-1, 0, 0, 1};
int movey[4] = {0, -1, 1, 0};
int main() {

  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  cin >> h >> w;

  cin >> sx >> sy >> fx >> fy;

  sx--; sy--; fx--; fy--;

  for(int i = 0; i < h; i++)
    for(int j = 0; j < w; j++)
      cin >> m[i][j];

  for(int i = 0; i < h; i++)
    for(int j = 0; j < w; j++)
      cost[i][j] = inf;

  cost[sx][sy] = 0;

  queue<int> qx, qy;

  qx.push(sx);
  qy.puhs(sy);

  while(!qx.empty()) {
    int x = qx.front(), y = qy.front();
    qx.pop(); qy.pop();
    int curc = cost[x][y];
    for(int mm = 0; mm < 4; mm++) {
      int cx = x + movex[mm], cy = y + movey[mm];
      if(cx >= 0 && cx < h && cy >= 0 && cy < w && m[cx][cy] == '.' && cost[cx][cy] > cost[x][y]) {
        cost[cx][cy] = cost[x][y];
        qx.push(cx);
        qy.push(cy);
      }
    }
    for(int xx = -2; xx <= 2; xx++)
      for(int yy = -2; yy <= 2; yy++) {
        int cx = x + xx, cy = y + yy;
        if(cx >= 0 && cx < h && cy >= 0 && cy < w && m[cx][cy] == '.' && cost[cx][cy] > cost[x][y] + 1) {
          cost[cx][cy] = cost[x][y] + 1;
          qx.push(cx);
          qy.push(cy);
        }
      }
  }

  cout << (cost[fx][fy] >= inf ? -1 : cost[fx][fy]);

  return 0;
}
/*

*/


Compiler output:
a.cc: In function 'int main()':
a.cc:62:6: error: 'class std::queue<int>' has no member named 'puhs'; did you mean 'push'?
   62 |   qy.puhs(sy);
      |      ^~~~
      |      push
Language: C++

#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
struct Data{
	int v,cost;
};
const int V = 550000;
const int INF = 1e18;
signed main(){
	auto comp = [&](const Data &a,const Data &b){
		return a.cost > b.cost;
	};
	priority_queue<Data,vector<Data>,decltype(comp)> pq{comp};
	vector<int> dist(V,INF);
	auto push = [&](int v,int cost){
		if(dist[v] <= cost)return;
		//遷移してはいけない条件を書く
		dist[v] = cost;
		pq.push((Data){v,cost});
	}
	push(0,0);//(頂点、コスト)
	while(pq.size()){
		auto now = pq.top();pq.pop();
		if(dist[now.v] != now.cost)continue;
		//遷移
		{

		}
		
	}
	cout << dist[goal] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: expected ',' or ';' before 'push'
   70 |         push(0,0);//(頂点、コスト)
      |         ^~~~
a.cc:80:22: error: 'goal' was not declared in this scope
   80 |         cout << dist[goal] << endl;
      |                      ^~~~
Language: C++

#include <stdio.h>
#include "iostream"
#include "queue"
#include "vector"
#include "string"

using namespace std;

int main(){
    int H, W;
    const int INF = 1e9+1;
    vector<int> C(2), D(2);
    queue<int> que_y;
    queue<int> que_x;

    cin >> H >> W;
    cin >> C[0] >> C[1];
    cin >> D[0] >> D[1];

    vector<string> S(H);
    vector<vector<int>> maze_visited(H, vector<int>(W, INF));

    for(int i = 0; i < H; i++){
        cin >> S[i];
    }

    que_y.push(C[0]-1);
    que_x.push(C[1]-1);
    maze_visited[C[0]-1][C[1]-1] = 0;

    while(!que_y.empty()){
        int y = que_y.front();
        int x = que_x.front();
        que_y.pop();
        que_x.pop();
        for(int i = -2; i <= 2; ++i){
            for(int j = -2; j <= 2; ++j){
                if(i != 0 || j != 0){
                    int n_x = x + i;
                    int n_y = y + j;
                    int mv_n = maze_visited[n_y][n_x];
                    int mv_c = maze_visited[y][x];
                    if(n_x >= 0 && n_y >= 0 && n_x < W && n_y < H){
                        if(S[n_y][n_x] == '.'){
                            if(abs(i) + abs(j) <= 1){
                                if(mv_n > mv_c){
                                    maze_visited[n_y][n_x] = mv_c;
                                    que_y.push_front(n_y);
                                    que_x.push_front(n_x);
                                }
                            } else {
                                if(mv_n > mv_c + 1){
                                    maze_visited[n_y][n_x] = mv_c + 1;
                                    que_y.push(n_y);
                                    que_x.push(n_x);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    if(maze_visited[D[0]-1][D[1]-1] == INF){
        cout << -1 << endl;
    } else {
        cout << maze_visited[D[0] - 1][D[1] - 1] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:43: error: 'class std::queue<int>' has no member named 'push_front'
   48 |                                     que_y.push_front(n_y);
      |                                           ^~~~~~~~~~
a.cc:49:43: error: 'class std::queue<int>' has no member named 'push_front'
   49 |                                     que_x.push_front(n_x);
      |                                           ^~~~~~~~~~
Language: C++

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

int _main(){
    
    int h,w;
    cin >> h >> w;  
    int _sx,_sy,sx,sy;
    cin >> _sy >> _sx;  
    int _gx,_gy,gx,gy;
    cin >> _gy >> _gx;
    sx = _sx-1; sy = _sy-1;
    gx = _gx-1; gy = _gy-1;

    vector<vector<bool>> road(w, vector<bool>(h));
    for (int y=0; y<h; y++) {
        for (int x=0; x<w; x++) {
            char c;
            cin >> c;
            if(c=='.'){
                road[x][y]=true;
            }else{
                road[x][y]=false;
            }
        }
    }

    vector<vector<int>> cost(w, vector<int>(h,INFINITY));
    queue<tuple<int,int>> searchfrom;
    searchfrom.push(tuple<int,int>(sx,sy));
    int costnow = 0;
    while(true){
        queue<tuple<int,int>> searching = queue<tuple<int,int>>(searchfrom);
        vector<vector<bool>> searching_b(w, vector<bool>(h,false));
        queue<tuple<int,int>> searched  = queue<tuple<int,int>>();
        searchfrom = queue<tuple<int,int>>();
        while(searching.size()>0){
            tuple<int,int> coord = searching.front();
            int cx = get<0>(coord); int cy = get<1>(coord);
            searching.pop();


            if(cx==gx && cy==gy){
                return costnow;
            }

            for(int x=max(0,cx-1); x<=min(w-1,cx+1); x++){
                for(int y=max(0,cy-1); y<=min(h-1,cy+1); y++){
                    int lenSu = abs(x-cx)+abs(y-cy);
                    if(road[x][y] && costnow<cost[x][y]){
                        if(lenSu==0){
                            cost[x][y] = costnow;
                            searched.push(tuple<int,int>(x,y));
                        }else if(lenSu==1 && /*!searching_b[x][y]*/){
                            searching_b[x][y]=true;
                            searching.push(tuple<int,int>(x,y));
                        }
                    }
                }
            }
        }
        while(searched.size()>0){
            tuple<int,int> coord = searched.front();
            int cx = get<0>(coord); int cy = get<1>(coord);
            searched.pop();

            for(int x=max(0,get<0>(coord)-2); x<=min(w-1,get<0>(coord)+2); x++){
                for(int y=max(0,get<1>(coord)-2); y<=min(h-1,get<1>(coord)+2); y++){
                    if(road[x][y] && costnow<cost[x][y]){
                        searchfrom.push(tuple<int,int>(x,y));
                    }
                }
            }
        }
        if(searchfrom.size()==0) return -1;
        costnow++;
    }
}

int main(){
    int result = _main();
    cout << result;
    return 0;
}

Compiler output:
a.cc: In function 'int _main()':
a.cc:29:47: warning: overflow in conversion from 'float' to 'std::vector<int>::value_type' {aka 'int'} changes value from '+Inff' to '2147483647' [-Woverflow]
   29 |     vector<vector<int>> cost(w, vector<int>(h,INFINITY));
      |                                               ^~~~~~~~
a.cc:55:68: error: expected primary-expression before ')' token
   55 |                         }else if(lenSu==1 && /*!searching_b[x][y]*/){
      |                                                                    ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;

int status[1005][1005];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int h, w;
/*
void f() {
   rep(i, 0, h) {
      rep(j, 0, w) printf("%d ", status[i][j]);
      printf("\n");
   }
   printf("=======================\n");
}
*/
int main() {
   cin.tie(0);
   ios_base::sync_with_stdio(0);

   cin >> h >> w;
   P s, g;
   cin >> s.first >> s.second;
   s.first--, s.second--;
   cin >> g.first >> g.second;
   g.first--, g.second--;
   vector<string> maze(h);
   rep(i, 0, h) cin >> maze[i];

   rep(i, 0, h) rep(j, 0, w) status[i][j] = INF;

   deque<P> deq;
   deq.push_front(s);
   status[s.first][s.second] = 0;
   while (!deq.empty()) {
      P p = dep.front();
      dep.pop_front();
      int cx = p.first, cy = p.second;
      rep(i, 0, 4) {
         int nx = cx + dx[i], ny = cy + dy[i];
         if (nx < 0 || nx >= h || ny < 0 || ny >= w) continue;
         if (maze[nx][ny] == '#') continue;
         if (status[nx][ny] > status[cx][cy]) {
            status[nx][ny] = status[cx][cy];
            q.push_front(P(nx, ny));
            // f();
         }
      }
      rep(i, -2, 3) {
         rep(j, -2, 3) {
            int nx = cx + i, ny = cy + j;
            if (nx == cx && ny == cy) continue;
            if (nx < 0 || nx >= h || ny < 0 || ny >= w) continue;
            if (maze[nx][ny] == '#') continue;
            if (status[nx][ny] > status[cx][cy] + 1) {
               status[nx][ny] = status[cx][cy] + 1;
               deq.emplace_back(nx, ny);
               // f();
            }
         }
      }
   }
   int ans = status[g.first][g.second];
   if (status[g.first][g.second] == INF) ans = -1;
   cout << ans << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:13: error: 'dep' was not declared in this scope; did you mean 'deq'?
   62 |       P p = dep.front();
      |             ^~~
      |             deq
a.cc:71:13: error: 'q' was not declared in this scope
   71 |             q.push_front(P(nx, ny));
      |             ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>

using namespace std;

const int N = 1e5 + 10;

char s[N][N];

typedef pair<int, int> PII;

int n, m;
bool st[N][N];

struct node{
	int x, y;
	int step;
	bool operator <(const node &W)const{
	  return step > W.step;
	}
};

node start;
node endt;

void bfs(){
	int dx[20] = {-1, 0, 1, 0, -2, -2, -2, -2, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1};
	int dy[20] = {0, 1, 0, -1, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2};
	
	priority_queue<node> q;
	q.push(start);
	while(q.size()){
		auto t = q.top();
		q.pop();
		
	//	cout << t.x << " " << t.y << " " << t.step << endl;
		
		if (t.x == endt.x && t.y == endt.y){
			cout << t.step << endl;
			return;
		}
		
		for (int i = 0; i < 20; i ++){
			int x = t.x + dx[i], y = t.y + dy[i];
			
			if (st[x][y])   continue;
			st[x][y] = true;
			if (s[x][y] == '#')  continue;
			if (x < 1 || x > n || y < 1 || y > m)   continue;
			if (i < 4){
				q.push({x, y, t.step});
			}
			else {
				q.push({x, y, t.step + 1});
			}
		}
	}
	if (!q.size())  {
		cout << -1 << endl;
		return;
	} 
}

int main(){
	int x, y;
	scanf("%d%d", &n, &m);
	scanf("%d%d", &x, &y);
	start = {x, y, 0};
	st[x][y] = true;
	int x1, y1;
	scanf("%d%d", &x1, &y1);
	endt = {x1, y1, -1};
	getchar();
	for (int i = 1; i <= n; i ++)
	    scanf("%s", s[i] + 1);
	    
	    
	    bfs();
	    
	    return 0;
}

Compiler output:
/tmp/ccHoQ9rf.o: in function `bfs()':
a.cc:(.text+0x185): relocation truncated to fit: R_X86_64_PC32 against symbol `start' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x1d2): relocation truncated to fit: R_X86_64_PC32 against symbol `endt' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x1e2): relocation truncated to fit: R_X86_64_PC32 against symbol `endt' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x26f): relocation truncated to fit: R_X86_64_PC32 against symbol `st' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x299): relocation truncated to fit: R_X86_64_PC32 against symbol `st' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x2d9): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x2ea): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccHoQ9rf.o
/tmp/ccHoQ9rf.o: in function `main':
a.cc:(.text+0x415): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x41f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x461): relocation truncated to fit: R_X86_64_PC32 against symbol `start' defined in .bss section in /tmp/ccHoQ9rf.o
a.cc:(.text+0x467): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define MSET(x,y) memset(x,y,sizeof(x))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 100005
#define ll long long
#define ld long double
#define INF 1e18
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
ll MOD = 1000000007;
string yes = "Yes\n";
string no = "No\n";

ll a[4][2] = {{1,0}, {0, 1}, {-1, 0}, {0, -1}};


struct qitem {
	int h,w,dist;
	bool prevhash;
};

int main() {
	ll h,w;
	cin>>h>>w;
	ll ch,cw,dh,dw;
	cin>>ch>>cw;
	cin>>dh>>dw;
	ch--,cw--,dh--,dw--;
	ll a[h][w], val[h][w];
	bool visited[h][w];
	for(ll i=0;i<h;i++) {
		for(ll j=0;j<w;j++) {
			visited[i][j] = false;
			val[i][j] = 0;
			char c;
			cin>>c;
			if(c == '#') a[i][j] = 1;
			else a[i][j] = 0;
		}
	}
	if(a[ch][cw] == 1 or a[dh][dw] == 1) {
		cout<<-1<<endl;
		return 0;
	}
	struct qitem qit;
	qit.h = ch, qit.w = cw, qit.prevhash = false, qit.dist = 0;
	queue<struct qitem> q;
	q.push(qit);
	visited[ch][cw] = true;
	while(!q.empty()) {
		struct qitem p = q.front();
		q.pop();
//		cout<<"here at "<<p.h<<" "<<p.w<<endl;
		if(p.h == dh and p.w == dw) {
			cout<<p.dist<<endl;
			return 0;
		}
		
		if(a[p.h][p.w] == 1 and p.prevhash) {
//			cout<<"here at "<<p.h<<" "<<p.w<<endl;
			continue;
		}
	
		if(a[p.h][p.w] == 1) pp.prevhash = true;
		if(p.h-1>=0 and !visited[p.h-1][p.w] and !(p.prevhash and a[p.h-1][p.w] == 1)) {
					struct qitem pp;
		pp.prevhash = false;
			pp.h = p.h-1, pp.w = p.w, pp.dist = p.dist;
			if(a[p.h-1][p.w] == 1) pp.dist++;
 			q.push(pp);
 			visited[p.h-1][p.w] = true;
		}
		if(p.h+1<h and !visited[p.h+1][p.w] and !(p.prevhash and a[p.h+1][p.w] == 1)) {
					struct qitem pp;
		pp.prevhash = false;
			pp.h = p.h+1, pp.w = p.w, pp.dist = p.dist;
			if(a[p.h+1][p.w] == 1) pp.dist++;
			q.push(pp);
 			visited[p.h+1][p.w] = true;
		}
		if(p.w-1>=0 and !visited[p.h][p.w-1] and !(p.prevhash and a[p.h][p.w-1] == 1)) {
					struct qitem pp;
		pp.prevhash = false;
			pp.h = p.h, pp.w = p.w-1, pp.dist = p.dist;
			if(a[p.h][p.w-1] == 1) pp.dist++;
			q.push(pp);
 			visited[p.h][p.w-1] = true;
		}
		if(p.w+1<w and !visited[p.h][p.w+1] and !(p.prevhash and a[p.h][p.w+1] == 1)) {
					struct qitem pp;
		pp.prevhash = false;
			pp.h = p.h, pp.w = p.w+1, pp.dist = p.dist;
			if(a[p.h][p.w+1] == 1) pp.dist++;
			q.push(pp);
 			visited[p.h][p.w+1] = true;
		}
	}
	cout<<-1<<endl;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:69:38: error: 'pp' was not declared in this scope; did you mean 'p'?
   69 |                 if(a[p.h][p.w] == 1) pp.prevhash = true;
      |                                      ^~
      |                                      p
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_HW = 1005;
char S[MAX_HW][MAX_HW];
int ans[MAX_HW][MAX_HW];
int H,W;
queue<P> Q[10005];
int dx[5] = {-2,-1,0,1,2}, dy[5] = {-2,-1,0,1,2};
int dx2[4] = {0,1,0,-1}, dy2[4] = {1,0,-1,0};
int now = 0;

void init()
{
	rep(i,MAX_HW)
	{
		rep(j,MAX_HW)
		{
			ans[i][j] = 10000;
		}
	}
}

void dfs(int i, int j, int c)
{
	//cout << i << " " << j << endl;
	ans[i][j] = min(ans[i][j],c);
	rep(ii,4)
	{
		int newi = i+dx2[ii], newj = j+dy2[ii];
		//cout << newi << " " << newj << endl;
		if (newi >= 0 && newi < H && newj >= 0 && newj < W && S[newi][newj] == '.')
		{
			//cout << "b" << endl;
			if (ans[newi][newj] > c)
			{
				dfs(newi,newj,c);
			}
		}
	}

	rep(ii,5)
	{
		rep(jj,5)
		{
			int newi = i+dx[ii], newj = j+dy[jj];
			if (newi >= 0 && newi < H && newj >= 0 && newj < W && S[newi][newj] == '.')
			{
				if (ans[newi][newaj] > c)
				{
					ans[newi][newj] = c+1;
					Q[now+1].push(P(newi,newj));
				}
			}
		}
	}
	return;
}

int main()
{
	init();
	cin >> H >> W;
	int Ch,Cw,Dh,Dw;
	cin >> Ch >> Cw >> Dh >> Dw;
	rep(i,H)
	{
		rep(j,W)
		{
			cin >> S[i][j];
		}
	}
	dfs(Ch-1,Cw-1,0);
	int cnt = 1;
	rep(i,10000)
	{
		now++;
		while(!Q[now].empty())
		{
			P p = Q[now].front();
			Q[now].pop();
			//cout << "aa" << p.first << " " << p.second << " " << ans[p.first][p.second] << " " << cnt << endl;
			if (ans[p.first][p.second] == cnt)
			{
				//cout << "b" << endl;
				dfs(p.first,p.second,cnt);
			}
		}
		if (Q[now+1].empty()) break;
		cnt++;
	}

	/*
	rep(i,H)
	{
		rep(j,W)
		{
			cout << ans[i][j] << " ";
		}
		cout << endl;
	}
	*/
	if (ans[Dh-1][Dw-1] != 10000)cout << ans[Dh-1][Dw-1] << endl;
	else cout << -1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:51:47: error: 'newaj' was not declared in this scope; did you mean 'newj'?
   51 |                                 if (ans[newi][newaj] > c)
      |                                               ^~~~~
      |                                               newj
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,k,ans=2147483647,x1,y_1,x2,y2,d[1005],v[100005][100005];
bool f[10005][10005],n[10005][10005],vi[10005];
char c;
void dfs(int x,int y){
	if(x>1&&v[x-1][y]==0&&n[x-1][y]==0){
		n[x-1][y]=1;
		v[x-1][y]=k;
		dfs(x-1,y);
		n[x-1][y]=0;
	}
	if(x<a&&v[x+1][y]==0&&n[x+1][y]==0){
		n[x+1][y]=1;
		v[x+1][y]=k;
		dfs(x+1,y);
		n[x+1][y]=0;
	}
	if(y>1&&v[x][y-1]==0&&n[x][y-1]==0){
		n[x][y-1]=1;
		v[x][y-1]=k;
		dfs(x,y-1);
		n[x][y-1]=0;
	}
	if(y<b&&v[x][y+1]==0&&n[x][y+1]==0){
		n[x][y+1]=1;
		v[x][y+1]=k;
		dfs(x,y+1);
		n[x][y+1]=0;
	}
}
int main(){
	scanf("%d %d\n",&a,&b);
	scanf("%d %d\n",&x2,&y2);
	scanf("%d %d",&x1,&y_1);
	for(int i=1;i<=a;i++){
		scanf("\n");
		for(int j=1;j<=b;j++){
			scanf("%c",&c);
			if(c=='#')n[i][j]=1;
		}
	}
	for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++){
			if(v[i][j]==0&&n[i][j]==0){
				k++;
				v[i][j]=k;
				n[i][j]=1;
				dfs(i,j);
				n[i][j]=0;
			}
		}
	}
	for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++){
			for(int i1=max(1,i-2);i1<=min(a,i+2);i1++){
				for(int j1=max(1,j-2);j1<=min(b,j+2);j1++){
					if(v[i][j]!=0&&v[i1][j1]!=0&&v[i][j]!=v[i1][j1]){
						f[v[i][j]][v[i1][j1]]=1;
						f[v[i1][j1]][v[i][j]]=1;
					}
				}
			}
		}
	}
	memset(d,0x3f,sizeof(d));
	d[v[x1][y_1]]=0;
	for(int i=1;i<k;i++){
		int x3=0;
		for(int j=1;j<=k;j++){
			if(!vi[j]&&(x3==0||d[j]<d[x3]))x3=j;
		}
		vi[x3]=1;
		for(int j=1;j<=k;j++){
			if(f[x3][j])d[j]=min(d[j],d[x3]+1);
		}
	}
	if(d[v[x2][y2]]==0x3f3f3f3f){
		printf("-1");
	}else printf("%d",d[v[x2][y2]]);
	
}

Compiler output:
/tmp/ccadktwB.o: in function `dfs(int, int)':
a.cc:(.text+0x65): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0xfd): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x193): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x1fb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x25c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x28c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x2f4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x35a): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccadktwB.o
a.cc:(.text+0x38a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;
import javax.xml.soap.Node;

public class Main {
	static Scanner scan = new Scanner(System.in);

	static int h = scan.nextInt();
	static int w = scan.nextInt();
	static int c_h = scan.nextInt()-1;
	static int c_w = scan.nextInt()-1;
	static int d_h = scan.nextInt()-1;
	static int d_w = scan.nextInt()-1;
	static int maze[][] = new int[h][w];
	static boolean reached[][] = new boolean[h][w];
	static int town_num[][] = new int[h][w];
	static int ans = 0;
	static int town = 0;
	static int now = 0;
	static int goal = 0;
	static int start = 0;
	
	public static void main(String[] args) {
		for(int i=0;i<h;i++) {
			String s = scan.next();
			for(int j=0;j<w;j++) {
				maze[i][j] = s.charAt(j);
			}
		}
		
		maze[c_h][c_w] = 's';
		maze[d_h][d_w] = 'g';

		for(int i=0;i<h;i++) {
			for(int j=0;j<w;j++) {
				if(reached[i][j] == false && maze[i][j] != '#') {
					search(i,j,town+1);
					town++;
				}
			}
		}
		
		List<Integer>[] edge = new ArrayList[town];
		boolean gone[] = new boolean[town];
		for(int i=0;i<town;i++) {
			edge[i] = new ArrayList<>();
		}
		
		for(int i=1;i<=town;i++) {
			for(int j=i+1;j<=town;j++) {
				if(connect(i,j)) {
					edge[i-1].add(j);
					edge[j-1].add(i);
				}
			}
		}
		
		if(start == goal) {
			System.out.println(ans);
			return;
		}else {
			Deque<Integer> queue = new ArrayDeque<>();
			queue.offer(start);
			while(!queue.isEmpty()) {
				int oppai = queue.poll();
				gone[oppai] = true;
				System.out.println(oppai);
				if(oppai == goal) {
					System.out.println(ans);
					return;
				}
				for(int boin : edge[oppai]) {
				    if(!gone[boin-1]) {
				    	gone[boin-1] = true;
				    	queue.offer(boin-1);
				    }
				}
				ans++;
			}
			
			System.out.println(-1);
			return;
		}
		
		
		
	}
	
	static void search(int x,int y,int town) {
		if(x<0 || h<=x || y<0 || w<=y || maze[x][y] == '#') {
			return;
		}
		if(reached[x][y]) {
			return;
		}
		
		reached[x][y] = true;
		town_num[x][y] = town;
		if(maze[x][y] == 'g') {
			goal = town-1;
		}else if(maze[x][y] == 's'){
			start = town-1;
		}
		
		search(x+1,y,town); //right
		search(x-1,y,town); //left
		search(x,y+1,town); //up
		search(x,y-1,town); //down
	}
	
	static boolean connect (int a,int b) {
		for(int i=0;i<h;i++) {
			for(int j=0;j<w;j++) {
				if(town_num[i][j] == a) {
					for(int k=i-2;k<=i+2;k++) {
						for(int l=j-2;l<=j+2;l++) {
							if(k<h && k>=0 && l<w && l>= 0 && town_num[k][l] == b ) {
								return true;
							}
						}
					}
				}
			}
		}
		
		return false;
	}
	
	
	public static int gcd(int x,int y) {
		if(x%y == 0) {
			return y;
		}else {
			return gcd(y,x%y);
		}
	}
}
 





Compiler output:
Main.java:2: error: package javax.xml.soap does not exist
import javax.xml.soap.Node;
                     ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,k,ans=2147483647,x1,y_1,x2,y2,d[1005],v[500005][500005];
bool f[10005][10005],n[10005][10005],vi[10005];
char c;
void dfs(int x,int y){
	if(x>1&&v[x-1][y]==0&&n[x-1][y]==0){
		n[x-1][y]=1;
		v[x-1][y]=k;
		dfs(x-1,y);
		n[x-1][y]=0;
	}
	if(x<a&&v[x+1][y]==0&&n[x+1][y]==0){
		n[x+1][y]=1;
		v[x+1][y]=k;
		dfs(x+1,y);
		n[x+1][y]=0;
	}
	if(y>1&&v[x][y-1]==0&&n[x][y-1]==0){
		n[x][y-1]=1;
		v[x][y-1]=k;
		dfs(x,y-1);
		n[x][y-1]=0;
	}
	if(y<b&&v[x][y+1]==0&&n[x][y+1]==0){
		n[x][y+1]=1;
		v[x][y+1]=k;
		dfs(x,y+1);
		n[x][y+1]=0;
	}
}
int main(){
	scanf("%d %d\n",&a,&b);
	scanf("%d %d\n",&x2,&y2);
	scanf("%d %d",&x1,&y_1);
	for(int i=1;i<=a;i++){
		scanf("\n");
		for(int j=1;j<=b;j++){
			scanf("%c",&c);
			if(c=='#')n[i][j]=1;
		}
	}
	for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++){
			if(v[i][j]==0&&n[i][j]==0){
				k++;
				v[i][j]=k;
				n[i][j]=1;
				dfs(i,j);
				n[i][j]=0;
			}
		}
	}
	for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++){
			for(int i1=max(1,i-2);i1<=min(a,i+2);i1++){
				for(int j1=max(1,j-2);j1<=min(b,j+2);j1++){
					if(v[i][j]!=0&&v[i1][j1]!=0&&v[i][j]!=v[i1][j1]){
						f[v[i][j]][v[i1][j1]]=1;
						f[v[i1][j1]][v[i][j]]=1;
					}
				}
			}
		}
	}
	memset(d,0x3f,sizeof(d));
	d[v[x1][y_1]]=0;
	for(int i=1;i<k;i++){
		int x3=0;
		for(int j=1;j<=k;j++){
			if(!vi[j]&&(x3==0||d[j]<d[x3]))x3=j;
		}
		vi[x3]=1;
		for(int j=1;j<=k;j++){
			if(f[x3][j])d[j]=min(d[j],d[x3]+1);
		}
	}
	if(d[v[x2][y2]]==0x3f3f3f3f){
		printf("-1");
	}else printf("%d",d[v[x2][y2]]);
	
}

Compiler output:
/tmp/ccOdjYQd.o: in function `dfs(int, int)':
a.cc:(.text+0x65): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0xfd): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x193): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x1fb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x25c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x28c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x2f4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x35a): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccOdjYQd.o
a.cc:(.text+0x38a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

char field[1005][1005];
ll h,w,ch,cw,dh,dw;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {1,0,-1,0};
int dist[1005][1005];
bool seen[1005][1005];

int main(){
	cin >> h >> w >> ch >> cw >> dh >> dw;
	ch--,cw--,dh--,dw--;
	rep(i,h) rep(j,w) cin >> field[i][j];
	seen[ch][cw] = true;
	queue<pair<int,int>> que;
	que.push(make_pair(ch,cw));
	while(!que.empty()){
		auto p = que.front(); que.pop();
		rep(i,4){
			rep(j,4){
				int ny = p.first + dy[i];
				int nx = p.first + dx[j];
				if(seen[ny][nx] == true;) continue;
				if(field[ny][nx] == '.'){
					dist[ny][nx] = dist[p.first][p.second];
					seen[ny][nx] = true;
					que.push(make_pair(ny, nx));
				}else{
					rep(k, 4){
						rep(l,4){
							int nny = ny + dy[k];
							int nnx = nx + dx[l];
							if(dist[nny][nnx] != 0) continue;
							if(field[nny][nnx] == '.') {
								dist[nny][nnx] = dist[p.first][p.second] + 1;
								seen[ny][nx] = true;
								que.push(make_pair(ny, nx));
							}
						}
					}
				}
			}
		}
	}
	if(!seen[dh][dw]) cout << -1 << endl;
	else cout << dist[dh][dw] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:57: error: expected primary-expression before ')' token
   27 |                                 if(seen[ny][nx] == true;) continue;
      |                                                         ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;	

public class Main {
	
	int[] dx = {0, 0, 1, -1, -2, -2, -2, -2, -2, 2, 2, 2, 2, 2};
	int[] dy = {1, -1, 0, 0, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2};
	int flag = 0;
	int min = Integer.MAX_VALUE;
	
	void dfs(int i, int j, int[][] visited, int di, int dj, char[][] arr, int h, int w, int ct) {
		if (visited[i][j] == 1) return;
		if (i==di && j==dj) {
			flag=1;
			//System.out.println("Ct : " + di + " " + dj);
			if (ct < min) {
				min = ct;
			}
			visited[i][j] = 1;
			return;
		}
		visited[i][j] = 1;
		
		for (int k=0;k<14;k++) {
			int newi = i + dx[k]; 
			int newj = j + dy[k];
			if (newi>=0 && newj>=0 && newi<h && newj<w && visited[newi][newj]==0 && arr[newi][newj] == '.') {
				if (newi==-2 || newi==2 || newj==-2 || newj==2) {
					dfs(newi, newj, visited, di, dj, arr, h, w, ct+1);
				} else {
					dfs(newi, newj, visited, di, dj, arr, h, w, ct);
				}
			}
		}
		visited[i][j] = 0;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		codeforces c = new codeforces();
	
		int h,w;
		int ch,cw;
		int dh, dw;
		h = sc.nextInt();
		w = sc.nextInt();
		ch = sc.nextInt();
		cw = sc.nextInt();
		dh = sc.nextInt();
		dw = sc.nextInt();
		ch--;
		cw--;
		dh--;
		dw--;
		
		char[][] arr = new char[h][w];
		for (int i=0;i<h;i++) {
				String str = sc.next();
				arr[i] = str.toCharArray();
		}
		
		if (arr[ch][cw] == '#' || arr[dh][dw] == '#') {
			System.out.println("-1");
		} else {
			int[][] visited = new int[h][w];
			c.dfs(ch, cw, visited, dh, dw, arr, h, w, 0);
			if (c.flag == 0) {
				System.out.println(-1);	
			} else {
				System.out.println(c.min);
			}
		}
	}
}


Compiler output:
Main.java:41: error: cannot find symbol
		codeforces c = new codeforces();
		^
  symbol:   class codeforces
  location: class Main
Main.java:41: error: cannot find symbol
		codeforces c = new codeforces();
		                   ^
  symbol:   class codeforces
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int MOD = 1000000009;
const long long INF = 1LL << 60;

void dfs(vector<string>& G, int y, int x) {
    int H = G.size();
    int W = G[0].size();
    G[y][x] = -1;
    for (int i = 0; i < 8; ++i) {
        int ny = y + dy[i];
        int nx = x + dx[i];
        if (ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
        if (G[ny][nx] != 1) continue;
        dfs(G, ny, nx);
    }
}

int main() {
    int H, W;
    cin >> H >> W;
    pint C;
    cin >> C.first >> C.second;
    C.first--, C.second--;
    pint D;
    cin >> D.first >> D.second;
    D.first--, D.second--;
    vector<string> S(H);
    for (int i = 0; i < H; ++i) cin >> S[i];
    vector<vector<int>> warp(H, vector<int>(W, -1));
    warp[C.first][C.second] = 0;
    queue<pint> que;
    que.push(C);
    while (!que.empty()) {
        auto yx = que.front();
        que.pop();
        for (int i = 0; i < 4; ++ i) {
            int ny = yx.first + dy[i];
            int nx = yx.second + dx[i];
            if (0 > ny || H <= ny || 0 > nx || W <= nx) continue;
            if (S[ny][nx] == '#') {
                for (int a = -2; a <= 2; ++a) {
                    for (int b = -2; b <= 2; ++b) {
                        if (a == 0 && b == 0) continue;
                        int ty = yx.first + a;
                        int tx = yx.second + b;
                        if (0 > ty || H <= ty || 0 > tx || W <= tx) continue;
                        if (S[ty][tx] == '#') continue;
                        if (warp[ty][tx] != -1) continue;
                        warp[ty][tx] = warp[yx.first][yx.second] + 1;
                        que.push({ty, tx});
                    }
                }
                continue;
            };
            if (warp[ny][nx] <= warp[yx.first][yx.second) continue;
            warp[ny][nx] = warp[yx.first][yx.second];
            que.push({ny, nx});
        }
    }
    cout << warp[D.first][D.second] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:57: error: expected ']' before ')' token
   62 |             if (warp[ny][nx] <= warp[yx.first][yx.second) continue;
      |                                                         ^
      |                                                         ]
Language: C++

#include <iostream>
#include <vector>
#include <string>

//マップ
std::vector<std::string> S;
//マップサイズ
int H, W;
//いけるかどうか
std::vector<std::vector<bool>> seen(1001, std::vector(1001, false));
int warp = 0;
int Ch, Cw;
int Dh, Dw;


// 四方向への移動ベクトル
               // {→, ↑ , ←, ↓}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

void warping(int h, int w)
{
    warp++;
    // warp先を全探索 
    for(int x = -2; x <= 2; x++)
    {
        for(int y = -2; y <= 2; y++)
        {
            int nh = h + x;
            int nw = w + y;
            if((x == 0) && (y == 0))
            {
                continue;
            }

            if(S[nh][nw] == '#')
            {
                continue;
            }

            dfs(nh, nw);
        }
    }
}

void dfs(int h, int w)
{
    seen[h][w] = true;

    // 四方向を探索
    for (int dir = 0; dir < 4; ++dir) {
        int nh = h + dx[dir];
        int nw = w + dy[dir];

        // 場外アウトしたり、移動先が壁の場合はスルー
        if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;
        if (S[nh][nw] == '#') continue;

        // 移動先が探索済みの場合
        if (seen[nh][nw]) continue;

        // 再帰的に探索
        dfs(nh, nw);
    }

    warping(h, w);
}

int main()
{

    std::cin >> H >> W;

    std::cin >> Ch >> Cw;
    Ch--; Cw--;

    std::cin >> Dh >> Dw;
    Dh--; Dw--;

    S.resize(H);
    for(int i = 0; i < H; i++)
    {
        std::cin >> S[i];
    }

    //1行けるところまで向かう　
    dfs(Ch, Cw);

    if(seen[Dh][Dw] != true)
    {
        warp = -1;
    }

    std::cout << warp;

    return 0;
}

Compiler output:
a.cc: In function 'void warping(int, int)':
a.cc:41:13: error: 'dfs' was not declared in this scope
   41 |             dfs(nh, nw);
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
ios::sync_with_stdio(false);
cin.tie(nullptr);
int main() {
    int h, w;
    int ch, cw;
    int dh, dw;
    cin >> h >> w >> ch >> cw >> dh >> dw;
    ch--;
    cw--;
    dh--;
    dw--;

    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);
        }
    }

    vector<vector<int>> x(h, vector<int>(w, INT_MAX));

    queue<vector<int>> que;
    que.emplace(vector<int>{ch, cw, 0});

    while (!que.empty()) {
        int cur_y, cur_x, cnt;
        vector<int> cur = que.front();
        que.pop();
        cur_y = cur.at(0);
        cur_x = cur.at(1);
        cnt = cur.at(2);

        if (cur_y < 0 || h <= cur_y || cur_x < 0 || w <= cur_x) {
            continue;
        }

        if (s.at(cur_y).at(cur_x) == '#') {
            continue;
        }


        if (x.at(cur_y).at(cur_x) <= cnt) {
            continue;
        }

        x.at(cur_y).at(cur_x) = cnt;

        vector<pair<int, int>> y = {make_pair(0, 1), make_pair(0, -1), make_pair(1, 0), make_pair(-1, 0)};
        for (auto iter = y.begin(); iter < y.end(); iter++) {
            int next_y = cur_y + (*iter).first;
            int next_x = cur_x + (*iter).second;
            que.emplace(vector<int>{next_y, next_x, cnt});
        }

        for (int i = -2; i < 3; i++) {
            for (int j = -2; j < 3; j++) {
                if (abs(i) <= 1 && abs(j) <= 1 && !(abs(i) == 1 && abs(j) == 1)) {
                    continue;
                }
                int next_y = cur_y + i;
                int next_x = cur_x + j;
                que.emplace(vector<int>{next_y, next_x, cnt + 1});
            }
        }
    }

    if (x.at(dh).at(dw) == INT_MAX) {
        cout << -1 << endl;
    }
    else {
        cout << x.at(dh).at(dw) << endl;
    }

    return 0;
}

Compiler output:
a.cc:3:1: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
    3 | ios::sync_with_stdio(false);
      | ^~~
a.cc:4:1: error: 'cin' does not name a type
    4 | cin.tie(nullptr);
      | ^~~