| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1302102 | mikolaj00 | Robot (JOI21_ho_t4) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct Edge
{
int v, c;
ll p;
friend bool operator<(Edge const& e1, Edge const& e2)
{
return make_tuple(e1.v, e1.c, e1.p) < make_tuple(e2.v, e2.c, e2.p);
}
};
struct Node
{
int v, from, c;
ll p;
friend bool operator<(Node const& n1, Node const& n2)
{
return make_tuple(n1.v, n1.from, n1.c, n1.p) < make_tuple(n2.v, n2.from, n2.c, n2.p);
}
};
struct NodeHash
{
size_t operator()(Node const& n)
{
return hash(make_tuple(n.v, n.from, n.c, n.p));
}
};
vector<vector<Edge>> g;
vector<unordered_map<int, int>> cnt;
vector<unordered_map<int, ll>> cost;
ll dijkstra()
{
priority_queue<pair<ll, Node>, vector<pair<ll, Node>>, greater<pair<ll, Node>>> pq;
pq.push({0LL, {1, 0, 0, 0LL}});
unordered_map<Node, ll, NodeHash> dist;
dist[{1, 0, 0, 0LL}] = 0LL;
unordered_set<Node, NodeHash> processed;
while (!pq.empty())
{
auto[d, u] = pq.top();
pq.pop();
if (u.v == g.size()-1)
return d;
if (processed.count(u))
continue;
processed.insert(u);
for (auto e : g[u.v])
{
if (e.v == u.from)
continue;
ll w = e.p;
Node v = {e.v, u.v, e.c, e.p};
if (!dist.count(v) || dist[u] + w < dist[v])
{
pq.push({dist[u] + w, v});
dist[v] = dist[u] + w;
}
}
for (auto e : g[u.v])
{
if (e.v == u.from)
continue;
ll w = cost[u.v][e.c] - e.p;
if (u.c == e.c)
w -= u.p;
Node v = {e.v, u.v, 0, 0LL};
if (!dist.count(v) || dist[u] + w < dist[v])
{
pq.push({dist[u] + w, v});
dist[v] = dist[u] + w;
}
}
}
return -1LL;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
g = vector<vector<Edge>>(n+1);
cnt = vector<unordered_map<int, int>>(n+1);
cost = vector<unordered_map<int, ll>>(n+1);
for (int i = 0; i < m; i++)
{
int a, b, c;
ll p;
cin >> a >> b >> c >> p;
g[a].push_back({b, c, p});
g[b].push_back({a, c, p});
cnt[a][c]++;
cnt[b][c]++;
cost[a][c] += p;
cost[b][c] += p;
}
ll ans = dijkstra();
cout << ans;
}
컴파일 시 표준 에러 (stderr) 메시지
Main.cpp: In member function 'size_t NodeHash::operator()(const Node&)':
Main.cpp:31:54: error: class template argument deduction failed:
31 | return hash(make_tuple(n.v, n.from, n.c, n.p));
| ^
Main.cpp:31:54: error: no matching function for call to 'hash(std::tuple<int, int, int, long long int>)'
In file included from /usr/include/c++/13/string_view:42,
from /usr/include/c++/13/bits/basic_string.h:47,
from /usr/include/c++/13/string:54,
from /usr/include/c++/13/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
from Main.cpp:1:
/usr/include/c++/13/bits/functional_hash.h:59:12: note: candidate: 'template<class _Tp> hash()-> std::hash<_Tp>'
59 | struct hash;
| ^~~~
/usr/include/c++/13/bits/functional_hash.h:59:12: note: template argument deduction/substitution failed:
Main.cpp:31:54: note: candidate expects 0 arguments, 1 provided
31 | return hash(make_tuple(n.v, n.from, n.c, n.p));
| ^
/usr/include/c++/13/bits/functional_hash.h:59:12: note: candidate: 'template<class _Tp> hash(std::hash<_Tp>)-> std::hash<_Tp>'
59 | struct hash;
| ^~~~
/usr/include/c++/13/bits/functional_hash.h:59:12: note: template argument deduction/substitution failed:
Main.cpp:31:54: note: 'std::tuple<int, int, int, long long int>' is not derived from 'std::hash<_Tp>'
31 | return hash(make_tuple(n.v, n.from, n.c, n.p));
| ^
In file included from /usr/include/c++/13/bits/hashtable.h:35,
from /usr/include/c++/13/bits/unordered_map.h:33,
from /usr/include/c++/13/unordered_map:41,
from /usr/include/c++/13/functional:63,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_M_hash_code(const _Key&) const [with _Key = Node; _Value = std::pair<const Node, long long int>; _ExtractKey = std::__detail::_Select1st; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true; __hash_code = long unsigned int]':
/usr/include/c++/13/bits/hashtable_policy.h:840:45: required from 'std::__detail::_Map_base<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true>::mapped_type& std::__detail::_Map_base<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits, true>::operator[](key_type&&) [with _Key = Node; _Val = long long int; _Alloc = std::allocator<std::pair<const Node, long long int> >; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; mapped_type = long long int; key_type = Node]'
/usr/include/c++/13/bits/unordered_map.h:991:20: required from 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&&) [with _Key = Node; _Tp = long long int; _Hash = NodeHash; _Pred = std::equal_to<Node>; _Alloc = std::allocator<std::pair<const Node, long long int> >; mapped_type = long long int; key_type = Node]'
Main.cpp:45:24: required from here
/usr/include/c++/13/bits/hashtable_policy.h:1308:23: error: static assertion failed: hash function must be invocable with an argument of key type
1308 | static_assert(__is_invocable<const _Hash&, const _Key&>{},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/hashtable_policy.h:1308:23: note: 'std::__is_invocable<const NodeHash&, const Node&>()' evaluates to false
/usr/include/c++/13/bits/hashtable_policy.h:1310:25: error: no match for call to '(const NodeHash) (const Node&)'
1310 | return _M_hash()(__k);
| ~~~~~~~~~^~~~~
Main.cpp:29:12: note: candidate: 'size_t NodeHash::operator()(const Node&)' (near match)
29 | size_t operator()(Node const& n)
| ^~~~~~~~
Main.cpp:29:12: note: passing 'const NodeHash*' as 'this' argument discards qualifiers
/usr/include/c++/13/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_M_hash_code(const _Key&) const [with _Key = Node; _Value = Node; _ExtractKey = std::__detail::_Identity; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true; __hash_code = long unsigned int]':
/usr/include/c++/13/bits/hashtable.h:1700:46: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::const_iterator std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::find(const key_type&) const [with _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; const_iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::const_iterator; key_type = Node]'
/usr/include/c++/13/bits/hashtable.h:1749:23: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::count(const key_type&) const [with _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; size_type = long unsigned int; key_type = Node]'
/usr/include/c++/13/bits/unordered_set.h:693:26: required from 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type std::unordered_set<_Value, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Value = Node; _Hash = NodeHash; _Pred = std::equal_to<Node>; _Alloc = std::allocator<Node>; size_type = long unsigned int; key_type = Node]'
Main.cpp:57:28: required from here
/usr/include/c++/13/bits/hashtable_policy.h:1308:23: error: static assertion failed: hash function must be invocable with an argument of key type
1308 | static_assert(__is_invocable<const _Hash&, const _Key&>{},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/hashtable_policy.h:1308:23: note: 'std::__is_invocable<const NodeHash&, const Node&>()' evaluates to false
/usr/include/c++/13/bits/hashtable_policy.h:1310:25: error: no match for call to '(const NodeHash) (const Node&)'
1310 | return _M_hash()(__k);
| ~~~~~~~~~^~~~~
Main.cpp:29:12: note: candidate: 'size_t NodeHash::operator()(const Node&)' (near match)
29 | size_t operator()(Node const& n)
| ^~~~~~~~
Main.cpp:29:12: note: passing 'const NodeHash*' as 'this' argument discards qualifiers
In file included from /usr/include/c++/13/string:49:
/usr/include/c++/13/bits/stl_function.h: In instantiation of 'constexpr bool std::equal_to<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Node]':
/usr/include/c++/13/bits/hashtable_policy.h:1715:16: required from 'bool std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _Traits>::_M_key_equals(const _Key&, const std::__detail::_Hash_node_value<_Value, typename _Traits::__hash_cached::value>&) const [with _Key = Node; _Value = Node; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>; typename _Traits::__hash_cached = std::__detail::_Hashtable_traits<true, true, true>::__hash_cached]'
/usr/include/c++/13/bits/hashtable.h:1695:29: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::const_iterator std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::find(const key_type&) const [with _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; const_iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::const_iterator; key_type = Node]'
/usr/include/c++/13/bits/hashtable.h:1749:23: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::count(const key_type&) const [with _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; size_type = long unsigned int; key_type = Node]'
/usr/include/c++/13/bits/unordered_set.h:693:26: required from 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type std::unordered_set<_Value, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Value = Node; _Hash = NodeHash; _Pred = std::equal_to<Node>; _Alloc = std::allocator<Node>; size_type = long unsigned int; key_type = Node]'
Main.cpp:57:28: required from here
/usr/include/c++/13/bits/stl_function.h:378:20: error: no match for 'operator==' (operand types are 'const Node' and 'const Node')
378 | { return __x == __y; }
| ~~~~^~~~~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:67,
from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/stl_iterator.h:534:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
534 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:534:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::reverse_iterator<_IteratorL>'
378 | { return __x == __y; }
| ~~~~^~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1678:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
1678 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1678:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::move_iterator<_IteratorL>'
378 | { return __x == __y; }
| ~~~~^~~~~~
In file included from /usr/include/c++/13/string:43:
/usr/include/c++/13/bits/allocator.h:237:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' (reversed)
237 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/13/bits/allocator.h:237:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::allocator<_CharT>'
378 | { return __x == __y; }
| ~~~~^~~~~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:64:
/usr/include/c++/13/bits/stl_pair.h:812:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
812 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:812:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::pair<_T1, _T2>'
378 | { return __x == __y; }
| ~~~~^~~~~~
/usr/include/c++/13/bits/stl_iterator.h:593:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorL>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}'
593 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:593:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::reverse_iterator<_IteratorL>'
378 | { return __x == __y; }
| ~~~~^~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1748:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1748 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1748:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::move_iterator<_IteratorL>'
378 | { return __x == __y; }
| ~~~~^~~~~~
In file included from /usr/include/c++/13/bits/char_traits.h:42,
from /usr/include/c++/13/string:42:
/usr/include/c++/13/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/13/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_function.h:378:20: note: 'const Node' is not derived from 'const std::fpos<_StateT>'
378 | { return __x == __y; }
| ~~~~^~~~~~
/usr/include/c++/13/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_M_hash_code_tr(const _Kt&) const [with _Kt = Node; _Key = Node; _Value = Node; _ExtractKey = std::__detail::_Identity; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true; __hash_code = long unsigned int]':
/usr/include/c++/13/bits/hashtable.h:2264:44: required from 'std::pair<typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_M_insert_unique(_Kt&&, _Arg&&, const _NodeGenerator&) [with _Kt = const Node&; _Arg = const Node&; _NodeGenerator = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<Node, true> > >; _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::iterator; typename _Traits::__constant_iterators = std::__detail::_Hashtable_traits<true, true, true>::__constant_iterators]'
/usr/include/c++/13/bits/hashtable.h:904:27: required from 'std::pair<typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_M_insert_unique_aux(_Arg&&, const _NodeGenerator&) [with _Arg = const Node&; _NodeGenerator = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<Node, true> > >; _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::iterator; typename _Traits::__constant_iterators = std::__detail::_Hashtable_traits<true, true, true>::__constant_iterators]'
/usr/include/c++/13/bits/hashtable.h:916:31: required from 'std::pair<typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_M_insert(_Arg&&, const _NodeGenerator&, std::true_type) [with _Arg = const Node&; _NodeGenerator = std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<Node, true> > >; _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; typename std::__detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::iterator; typename _Traits::__constant_iterators = std::__detail::_Hashtable_traits<true, true, true>::__constant_iterators; std::true_type = std::integral_constant<bool, true>]'
/usr/include/c++/13/bits/hashtable_policy.h:933:22: required from 'std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::__ireturn_type std::__detail::_Insert_base<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::insert(const value_type&) [with _Key = Node; _Value = Node; _Alloc = std::allocator<Node>; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<Node>; _Hash = NodeHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, true, true>; __ireturn_type = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::__ireturn_type; value_type = Node]'
/usr/include/c++/13/bits/unordered_set.h:429:27: required from 'std::pair<typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _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 _Tp&> > >::value, true, true> >::iterator, bool> std::unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(const value_type&) [with _Value = Node; _Hash = NodeHash; _Pred = std::equal_to<Node>; _Alloc = std::allocator<Node>; typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _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 _Tp&> > >::value, true, true> >::iterator = std::__detail::_Insert_base<Node, Node, std::allocator<Node>, std::__detail::_Identity, std::equal_to<Node>, NodeHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::iterator; value_type = Node]'
Main.cpp:59:25: required from here
/usr/include/c++/13/bits/hashtable_policy.h:1317:25: error: static assertion failed: hash function must be invocable with an argument of key type
1317 | static_assert(__is_invocable<const _Hash&, const _Kt&>{},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/hashtable_policy.h:1317:25: note: 'std::__is_invocable<const NodeHash&, const Node&>()' evaluates to false
/usr/include/c++/13/bits/hashtable_policy.h:1319:27: error: no match for call to '(const NodeHash) (const Node&)'
1319 | return _M_hash()(__k);
| ~~~~~~~~~^~~~~
Main.cpp:29:12: note: candidate: 'size_t NodeHash::operator()(const Node&)' (near match)
29 | size_t operator()(Node const& n)
| ^~~~~~~~
Main.cpp:29:12: note: passing 'const NodeHash*' as 'this' argument discards qualifiers