Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
lli mod=1000000007;
typedef pair<lli,pair<lli,lli>> ppi;
lli zero_x[]={-1,0,1,0};
lli zero_y[]={0,-1,0,1};
lli one_x[]={-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,1,1,1,1,1,2,2,2,2,2};
lli one_y[]={-2,-1,0,1,2,-2,-1,0,1,2,-2,-1,1,2,-2,-1,0,1,2,-2,-1,0,1,2};
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    lli h,w;
    cin>>h>>w;
    lli ch,cw,dh,dw;
    cin>>ch>>cw>>dh>>dw;
    string mat[h];
    for(lli i=0;i<h;++i)
        cin>>mat[i];
    queue<ppi,vector<ppi>,greater<ppi>> q;
    q.push({0,{ch-1,cw-1}});
    lli vis[h][w]; 
    vis[ch-1][cw-1]=1;
    lli cost[h][w];
    cost[ch-1][cw-1]=0;
    for(lli i=0;i<h;++i)
        for(lli j=0;j<w;++j)
            cost[i][j]=LLONG_MAX;
    while(!q.empty()){
        lli curr=q.front().first;
        lli r=q.top().second.first;
        lli c=q.top().second.second;
        //cout<<r<<" "<<c<<" "<<curr<<endl;
        q.pop();
        for(lli i=0;i<4;++i){
            lli next_r=r+zero_x[i];
            lli next_c=c+zero_y[i];
            if(next_r>=0&&next_r<h&&next_c>=0&&next_c<w&&(cost[next_r][next_c]>curr)&&mat[next_r][next_c]=='.'){
                cost[next_r][next_c]=curr;
                q.push({curr,{next_r,next_c}});
            }
        }
        for(lli i=0;i<24;++i){
            lli next_r=r+one_x[i];
            lli next_c=c+one_y[i];
            if(next_r>=0&&next_r<h&&next_c>=0&&next_c<w&&(cost[next_r][next_c]>(curr+1))&&mat[next_r][next_c]=='.'){
                cost[next_r][next_c]=curr+1;
                q.push({curr+1,{next_r,next_c}});
            }
        }
    }
    if(cost[dh-1][dw-1]==LLONG_MAX)
        cout<<-1<<endl;
    else
        cout<<cost[dh-1][dw-1]<<endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: wrong number of template arguments (3, should be at least 1)
   21 |     queue<ppi,vector<ppi>,greater<ppi>> q;
      |                                      ^~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: provided for 'template<class _Tp, class _Sequence> class std::queue'
   96 |     class queue
      |           ^~~~~
a.cc:22:7: error: request for member 'push' in 'q', which is of non-class type 'int'
   22 |     q.push({0,{ch-1,cw-1}});
      |       ^~~~
a.cc:30:14: error: request for member 'empty' in 'q', which is of non-class type 'int'
   30 |     while(!q.empty()){
      |              ^~~~~
a.cc:31:20: error: request for member 'front' in 'q', which is of non-class type 'int'
   31 |         lli curr=q.front().first;
      |                    ^~~~~
a.cc:32:17: error: request for member 'top' in 'q', which is of non-class type 'int'
   32 |         lli r=q.top().second.first;
      |                 ^~~
a.cc:33:17: error: request for member 'top' in 'q', which is of non-class type 'int'
   33 |         lli c=q.top().second.second;
      |                 ^~~
a.cc:35:11: error: request for member 'pop' in 'q', which is of non-class type 'int'
   35 |         q.pop();
      |           ^~~
a.cc:41:19: error: request for member 'push' in 'q', which is of non-class type 'int'
   41 |                 q.push({curr,{next_r,next_c}});
      |                   ^~~~
a.cc:49:19: error: request for member 'push' in 'q', which is of non-class type 'int'
   49 |                 q.push({curr+1,{next_r,next_c}});
      |                   ^~~~