Language: C++

#include <bits/stdc++.h>
#define INT long long int
#define MOD 1000000007
using namespace std;
string s;
INT n, m, S, T, d[200020], chk[200020];
vector<INT> G[200020], G2[200020];
queue<INT> q;
unordered_map<INT, unordered_map<INT, INT> > dd[200020];
void dfs(int x, int y, int z)
{
    if( z == 3 )
    {
        dd[x][y] = z;
        G2[x].push_back(y);
        return;
    }
    for(int w : G[y])
    {
        if( dd[x][w] ) continue;
        dfs(x, w, z+1);
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(int i = 0 ; i < m ; i++ )
    {
        INT x, y;
        cin>>x>>y;
        G[x].push_back(y);
    }
    cin>>S>>T;
    for(int i = 1 ; i <= n ; i++ )
        dfs(i, i, 0);
    q.push(S);
    chk[S] = 1;
    while( !q.empty() )
    {
        S = q.front(); q.pop();
        if( S == T ) return cout<<chk[S]-1<<endl, 0;
        for(int w : G2[S])
            if( !chk[w] )
                q.push(w), chk[w] = chk[S]+1;
    }
    cout<<"-1\n";
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:14:20: error: no match for 'operator=' (operand types are 'std::unordered_map<long long int, std::unordered_map<long long int, long long int> >::mapped_type' {aka 'std::unordered_map<long long int, long long int>'} and 'int')
   14 |         dd[x][y] = z;
      |                    ^
In file included from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/unordered_map.h:279:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >]'
  279 |       operator=(const unordered_map&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:279:17: note:   no known conversion for argument 1 from 'int' to 'const std::unordered_map<long long int, long long int>&'
  279 |       operator=(const unordered_map&) = default;
      |                 ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >]'
  283 |       operator=(unordered_map&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:17: note:   no known conversion for argument 1 from 'int' to 'std::unordered_map<long long int, long long int>&&'
  283 |       operator=(unordered_map&&) = default;
      |                 ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type>) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type = std::pair<const long long int, long long int>]'
  297 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const long long int, long long int> >'
  297 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:20:22: error: could not convert 'dd[x].std::unordered_map<long long int, std::unordered_map<long long int, long long int> >::operator[](((std::unordered_map<long long int, std::unordered_map<long long int, long long int> >::key_type)w))' from 'std::unordered_map<long long int, std::unordered_map<long long int, long long int> >::mapped_type' {aka 'std::unordered_map<long long int, long long int>'} to 'bool'
   20 |         if( dd[x][w] ) continue;
      |                      ^
      |                      |
      |                      std::unordered_map<long long int, std::unordered_map<long long int, long long int> >::mapped_type {aka std::unordered_map<long long int, long long int>}