Submission #659933

#TimeUsernameProblemLanguageResultExecution timeMemory
659933lunchboxZamjene (COCI16_zamjene)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include <unordered_map> #include <algorithm> // #include "debugging.hpp" using std::cout; using std::endl; using std::vector; using ll = long long; struct Hash { const ll MOD1 = 1e9 + 7; const ll MOD2 = 1e9 + 9; ll h1, h2; Hash(ll h1, ll h2) : h1(h1), h2(h2) { } Hash() : h1(0), h2(0) { } Hash operator+(const Hash& o) { return Hash((h1 + o.h1) % MOD1, (h2 + o.h2) % MOD2); } Hash operator-(const Hash& o) { return Hash((h1 - o.h1 + MOD1) % MOD1, (h2 - o.h2 + MOD2) % MOD2); } Hash& operator=(const Hash& h) { h1 = h.h1; h2 = h.h2; return *this; } Hash exp(const ll& n) { return Hash(h1 * n % MOD1, h2 * n % MOD2); } inline vector<Hash> zero_pairs() { return { Hash(MOD1 - h1, MOD2 - h2), Hash(-h1, -h2), Hash(-h1, MOD2 - h2), Hash(MOD1 - h1, -h2), }; } long long hash() const { return h1 * MOD2 + h2; } }; bool operator!=(const Hash& h1, const Hash& h2) { return h1.h1 != h2.h1 || h1.h2 != h2.h2; } bool operator<(const Hash& h1, const Hash& h2) { return h1.h1 != h2.h1 ? h1.h1 < h2.h1 : h1.h2 < h2.h2; } std::ostream& operator<<(std::ostream& out, const Hash& h) { return out << '(' << h.h1 << ' ' << h.h2 << ')'; } namespace std { template<> struct hash<Hash> { size_t operator()(const Hash& p) const { return p.hash(); } }; } class DominikArray { private: const ll POW = 1e6 + 3; vector<int> arr; vector<int> sorted; vector<int> parent; vector<int> size; int bad_num = 0; // # of bad components (used for type 3) std::unordered_map<int, Hash> elem_pow; // raise to the power of the value // the current hash of a component vector<Hash> hash; // the needed hash for a component to be able to be sorted vector<Hash> req_hash; // the hash differences of the bad components std::unordered_map<Hash, ll> bad_diff; ll cloud_pairs = 0; // # of valid component pairs (used for type 4) int get_top(int n) { return parent[n] == n ? n : (parent[n] = get_top(parent[n])); } /** checks if a component is unsortable (n is a top node) */ inline bool is_unsortable(int n) { return hash[n] != req_hash[n]; } /** * if a component is bad, add it to the bad log * and update data accordingly */ void add_if_bad(int n) { if (is_unsortable(n)) { // one more bad component bad_num++; Hash diff = req_hash[n] - hash[n]; bad_diff[diff] += size[n]; for (const Hash& zp : diff.zero_pairs()) { cloud_pairs += bad_diff[zp] * size[n]; } } } void remove_if_bad(int n) { if (is_unsortable(n)) { bad_num--; Hash diff = req_hash[n] - hash[n]; bad_diff[diff] -= size[n]; for (const Hash& zp : diff.zero_pairs()) { cloud_pairs -= bad_diff[zp] * size[n]; } } } public: DominikArray(vector<int> arr) : arr(arr), parent(arr.size()), size(arr.size(), 1), hash(arr.size()), req_hash(arr.size()) { sorted = arr; std::sort(sorted.begin(), sorted.end()); // perform coordinate compression Hash curr_hsh(1, 1); for (int i : sorted) { if (!elem_pow.count(i)) { elem_pow[i] = curr_hsh; curr_hsh = curr_hsh.exp(POW); } } // set up DSU and the hashes for (int i = 0; i < arr.size(); i++) { parent[i] = i; hash[i] = elem_pow[arr[i]]; req_hash[i] = elem_pow[sorted[i]]; add_if_bad(i); } } void swap(int a, int b) { int top_a = get_top(a); int top_b = get_top(b); // temporarily take them out of the bad log (if applicable) remove_if_bad(top_a); remove_if_bad(top_b); // change the hashes of the two components hash[top_a] = hash[top_a] + elem_pow[arr[b]] - elem_pow[arr[a]]; hash[top_b] = hash[top_b] + elem_pow[arr[a]] - elem_pow[arr[b]]; // add the back (if applicable) add_if_bad(top_a); add_if_bad(top_b); std::swap(arr[a], arr[b]); } void link(int a, int b) { a = get_top(a); b = get_top(b); if (a == b) { return; } if (size[a] < size[b]) { return link(b, a); } remove_if_bad(a); remove_if_bad(b); // standard dsu operations size[a] += size[b]; parent[b] = a; // add the hash of the smaller component to the bigger one hash[a] = hash[a] + hash[b]; req_hash[a] = req_hash[a] + req_hash[b]; // since b's merged into a, we just add a back (if applicable) add_if_bad(a); } bool sortable() { // for everything to be sortable, there can't be any bad components return bad_num == 0; } ll needed_pair_num() { return cloud_pairs; } }; // https://oj.uz/problem/view/COCI16_zamjene (input omitted due to length) int main() { std::ios::sync_with_stdio(false); std::cin.tie(NULL); int arr_len; int query_num; std::cin >> arr_len >> query_num; vector<int> arr(arr_len); for (int& i : arr) { std::cin >> i; } DominikArray array(arr); for (int q = 0; q < query_num; q++) { int type; std::cin >> type; int a, b; // not necessarily used (queries of type 3 & 4) switch (type) { case 1: std::cin >> a >> b; array.swap(--a, --b); break; case 2: std::cin >> a >> b; array.link(--a, --b); break; case 3: cout << (array.sortable() ? "DA" : "NE") << '\n'; break; case 4: cout << array.needed_pair_num() << '\n'; break; }; } }

Compilation message (stderr)

zamjene.cpp: In constructor 'DominikArray::DominikArray(std::vector<int>)':
zamjene.cpp:142:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  142 |             for (int i = 0; i < arr.size(); i++) {
      |                             ~~^~~~~~~~~~~~
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h: In instantiation of 'constexpr bool std::equal_to<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Hash]':
/usr/include/c++/10/bits/hashtable_policy.h:1804:12:   required from 'bool std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_M_equals(const _Key&, std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::__hash_code, std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::__node_type*) const [with _Key = Hash; _Value = std::pair<const Hash, long long int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<Hash>; _H1 = std::hash<Hash>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::__hash_code = long unsigned int; std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::__node_type = std::__detail::_Hashtable_base<Hash, std::pair<const Hash, long long int>, std::__detail::_Select1st, std::equal_to<Hash>, std::hash<Hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::__node_type]'
/usr/include/c++/10/bits/hashtable.h:1580:23:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_base* std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_find_before_node(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const key_type&, std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__hash_code) const [with _Key = Hash; _Value = std::pair<const Hash, long long int>; _Alloc = std::allocator<std::pair<const Hash, long long int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<Hash>; _H1 = std::hash<Hash>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_base = std::_Hashtable<Hash, std::pair<const Hash, long long int>, std::allocator<std::pair<const Hash, long long int> >, std::__detail::_Select1st, std::equal_to<Hash>, std::hash<Hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::__node_base; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = long unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::key_type = Hash; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__hash_code = long unsigned int]'
/usr/include/c++/10/bits/hashtable.h:693:28:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type* std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_find_node(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const key_type&, std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__hash_code) const [with _Key = Hash; _Value = std::pair<const Hash, long long int>; _Alloc = std::allocator<std::pair<const Hash, long long int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<Hash>; _H1 = std::hash<Hash>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type = std::_Hashtable<Hash, std::pair<const Hash, long long int>, std::allocator<std::pair<const Hash, long long int> >, std::__detail::_Select1st, std::equal_to<Hash>, std::hash<Hash>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::__node_type; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = long unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::key_type = Hash; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__hash_code = long unsigned int]'
/usr/include/c++/10/bits/hashtable_policy.h:709:50:   required from 'std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::mapped_type& std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::operator[](const key_type&) [with _Key = Hash; _Pair = std::pair<const Hash, long long int>; _Alloc = std::allocator<std::pair<const Hash, long long int> >; _Equal = std::equal_to<Hash>; _H1 = std::hash<Hash>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::mapped_type = long long int; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::key_type = Hash]'
/usr/include/c++/10/bits/unordered_map.h:984:20:   required from 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = Hash; _Tp = long long int; _Hash = std::hash<Hash>; _Pred = std::equal_to<Hash>; _Alloc = std::allocator<std::pair<const Hash, long long int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = long long int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = Hash]'
zamjene.cpp:108:30:   required from here
/usr/include/c++/10/bits/stl_function.h:356:20: error: no match for 'operator==' (operand types are 'const Hash' and 'const Hash')
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/iosfwd:40,
                 from /usr/include/c++/10/ios:38,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/postypes.h:222:5: note: candidate: 'template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)'
  222 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/10/bits/postypes.h:222:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::fpos<_StateT>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:466:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)'
  466 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:466:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::pair<_T1, _T2>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:360:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)'
  360 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:360:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::reverse_iterator<_Iterator>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:398:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
  398 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:398:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::reverse_iterator<_Iterator>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1427:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
 1427 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1427:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::move_iterator<_IteratorL>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1495:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)'
 1495 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1495:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::move_iterator<_IteratorL>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/string:41,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/allocator.h:206:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_T2>&)'
  206 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/10/bits/allocator.h:206:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'const Hash' is not derived from 'const std::allocator<_CharT>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/basic_string.h:48,
                 from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/string_view:490:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(std::basic_string_view<_CharT, _Traits>, std::basic_string_view<_CharT, _Traits>)'
  490 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/10/string_view:490:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'Hash' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  356 |       { return __x == __y; }
      |                ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/basic_string.h:48,
                 from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/string_view:496:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(std::basic_string_view<_CharT, _Traits>, std::__type_identity_t<std::basic_string_view<_CharT, _Traits> >)'
  496 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/10/string_view:496:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/10/string:48,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/ostream:38,
                 from /usr/include/c++/10/iostream:39,
                 from zamjene.cpp:1:
/usr/include/c++/10/bits/stl_function.h:356:20: note:   'Hash' is not derived from 'std::basic_string_view<_CharT, _Traits>