Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef int ll; //int:2*10**9
typedef long double ld;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define vec2(name,i,j) vector<vector<ll>> name(i,vector<ll>(j))
#define vec2f(name,i,j,k) vector<vector<ll>> name(i,vector<ll>(j,k))
#define vec3(name,i,j,k) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k)))
#define vec3f(name,i,j,k,l) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k,l)))
#define vec4(name,i,j,k,l) vector<vector<vector<vector<ll>>>> name(i,vector<vector<vector<ll>>>(j,vector<vector<ll>>(k,vector<ll>(l))))
#define vec4f(name,i,j,k,l,m) vector<vector<vector<vector<ll>>>> name(i,vector<vector<vector<ll>>>(j,vector<vector<ll>>(k,vector<ll>(l,m))))
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.141592653
#define INF 100000000 //8
#define N 210000

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

int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll h, w, k; cin >> h >> w >> k;
    ll xs, ys, xg, yg; cin >> xs >> ys >> xg >> yg;
    vec3f(pond,h+2,w+2,4,-1);
    FOR(i,1,h)FOR(j,1,w)FOR(m,0,3) pond[i][j][m]=INF;
    REP(i,h){
        string s; cin >> s;
        REP(j,w) if(s[j]=='@') REP(m,4) pond[i+1][j+1][m]=-1;
    }
    priority_queue<vector<ll>,vector<vector<ll>>,greater<vector<ll>>> q;
    q.push({0,0,-1,xs,ys});
    pond[xs][ys][0]=0;
    pond[xs][ys][1]=0;
    pond[xs][ys][2]=0;
    pond[xs][ys][3]=0;
    while(q.size()>0){
        ll l = q.top().at(0);
        ll z = q.top().at(1);
        ll dir = q.top().at(2);
        ll x = q.top().at(3);
        ll y = q.top().at(4);
        if (pond[x][y]==INF) pond[x][y]=l;
        cout << l << "pick" << z << " " << dir << " " << x << " " << y << endl;
        if (z==k){
            REP(i,4)if (pond[x+dx[i]][y+dy[i]][i]==INF){
                pond[x+dx[i]][y+dy[i]][i]=l+1;
                q.push({l+1,1,i,x+dx[i],y+dy[i]});
            }
        }
        else {
            REP(i,4)if (pond[x+dx[i]][y+dy[i]][i]==INF){
                if (i==dir){
                    ll p = 1;
                    while(p<=k-z){
                        if (pond[x+p*dx[i]][y+p*dy[i]][i]!=INF){
                            break;
                        }
                        else{
                            pond[x+p*dx[i]][y+p*dy[i]][i]=l;
                            q.push({l,z+p,dir,x+p*dx[i],y+p*dy[i]});
                        }
                        p++;
                    }
                }
                else{
                    q.push({l+1,1,i,x+dx[i],y+dy[i]});
                }
            }
        }
        q.pop();
    }
    ll ans = INF;
    REP(i,4) ans = min(ans,pond[xg][yg][i]);
    if (ans==INF) cout << -1 << endl;
    else cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:23: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int')
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1103 |     operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1199 |     operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1274 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1366 |     operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1441 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1534 |     operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1613 |     operator==(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
 2186 |     operator==(const match_results<_Bi_iter, _Alloc>& __m1,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1033 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::pair<_T1, _T2>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  441 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  486 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1667 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note:   template argument deduction/substitution failed:
a.cc:20:13: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>'
   20 | #define INF 100000000 //8
      |             ^~~~~~~~~
a.cc:48:25: note: in expansion of macro 'INF'
   48 |         if (pond[x][y]==INF) pond[x][y]=l;
      |                         ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1737 |     operator==(const move_iterator<_Iterator>& __x