Language: C++

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

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

int main() {
  int h, w;
  cin >> n >> w;
  int si, sj;
  cin >> si >> sj;
  int ti, tj;
  cin >> ti >> tj;
  --si; --sj; --ti; --tj;
  vector<storing> s(h);
  for(int i=0; i<h; i++) cin >> s[i];
  
  const int INF = 1e9;
  vector<vector<int> > dist(h,vector<int>(w,INF) );
  deque<pair<int,int> > q;
  dist[si][sj] = 0;
  q.emplace_back(si,sj);
  
  while(!q.enpty() ){
    int i = q.front().first;
    int j = q.front().second;
    q.pop_front();
    int d = dist[i][j];
    
  for(int v=0;v<4;v++){
    int ni = i+di[v], nj = j+dj[v];
    if(ni < 0 || ni >= h || nj<0 || nj>=w) continue;
    if(s[ni][nj] == '#') continue;
    if(dist[ni][nj] <= d) continue;
    dist[ni][nj] = d;
    q.emplace_front(ni,nj);
  }
  
    for(int ei = -2; ei <=2;++ei){
      for(int ej=-2;ej<=2;++ej){
        int ni = i+ei, nj = j+ej;
        if(ni < 0 || ni >= h || nj<0 || nj>=w) continue;
        if(s[ni][nj]=='#') continue;
        fi(dist[ni][nj] <= d+1) continue;
        dist[ni][nj] = d+1;
        q.emplace_back(ni,nj);
      }
    }
  }
  int ans = dist[ti][tj];
  if(ans == INF) ans = -1;
  cout << ans << endl;
  return 0;
      
}


Compiler output:
a.cc:5:11: error: redefinition of 'const int dj []'
    5 | const int dj[] = {0,-1,0,1};
      |           ^~
a.cc:4:11: note: 'const int dj [4]' previously defined here
    4 | const int dj[] = {-1,0,1,0};
      |           ^~
a.cc: In function 'int main()':
a.cc:9:10: error: 'n' was not declared in this scope
    9 |   cin >> n >> w;
      |          ^
a.cc:15:10: error: 'storing' was not declared in this scope; did you mean 'stdin'?
   15 |   vector<storing> s(h);
      |          ^~~~~~~
      |          stdin
a.cc:15:17: error: template argument 1 is invalid
   15 |   vector<storing> s(h);
      |                 ^
a.cc:15:17: error: template argument 2 is invalid
a.cc:16:34: error: invalid types 'int[int]' for array subscript
   16 |   for(int i=0; i<h; i++) cin >> s[i];
      |                                  ^
a.cc:24:12: error: 'class std::deque<std::pair<int, int> >' has no member named 'enpty'; did you mean 'empty'?
   24 |   while(!q.enpty() ){
      |            ^~~~~
      |            empty
a.cc:31:16: error: 'di' was not declared in this scope; did you mean 'ni'?
   31 |     int ni = i+di[v], nj = j+dj[v];
      |                ^~
      |                ni
a.cc:32:29: error: 'nj' was not declared in this scope; did you mean 'ni'?
   32 |     if(ni < 0 || ni >= h || nj<0 || nj>=w) continue;
      |                             ^~
      |                             ni
a.cc:33:9: error: invalid types 'int[int]' for array subscript
   33 |     if(s[ni][nj] == '#') continue;
      |         ^
a.cc:33:14: error: 'nj' was not declared in this scope; did you mean 'ni'?
   33 |     if(s[ni][nj] == '#') continue;
      |              ^~
      |              ni
a.cc:34:17: error: 'nj' was not declared in this scope; did you mean 'ni'?
   34 |     if(dist[ni][nj] <= d) continue;
      |                 ^~
      |                 ni
a.cc:35:14: error: 'nj' was not declared in this scope; did you mean 'ni'?
   35 |     dist[ni][nj] = d;
      |              ^~
      |              ni
a.cc:43:13: error: invalid types 'int[int]' for array subscript
   43 |         if(s[ni][nj]=='#') continue;
      |             ^
a.cc:44:9: error: 'fi' was not declared in this scope; did you mean 'ni'?
   44 |         fi(dist[ni][nj] <= d+1) continue;
      |         ^~
      |         ni