답안 #883214

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
883214 2023-12-04T19:39:40 Z MilosMilutinovic 유괴 2 (JOI17_abduction2) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w, q;
  cin >> h >> w >> q;
  vector<int> a(h);
  for (int i = 0; i < h; i++) {
    cin >> a[i];
  }
  vector<int> b(w);
  for (int i = 0; i < w; i++) {
    cin >> b[i];
  }
  const int L = 20;
  vector<vector<int>> maxa(h, vector<int>(L));
  vector<vector<int>> maxb(w, vector<int>(L));
  for (int i = 0; i < h; i++) {
    maxa[i][0] = a[i];
  }
  for (int i = 0; i < w; i++) {
    maxb[i][0] = b[i];
  }
  for (int j = 1; j < L; j++) {
    for (int i = 0; i + (1 << j) <= h; i++) {
      maxa[i][j] = max(maxa[i][j - 1], maxa[i + (1 << (j - 1))][j - 1]);
    }
  }
  for (int j = 1; j < L; j++) {
    for (int i = 0; i + (1 << j) <= w; i++) {
      maxb[i][j] = max(maxb[i][j - 1], maxb[i + (1 << (j - 1))][j - 1]);
    }
  }
  vector<int> logs(max(h, w) + 1);
  for (int i = 2; i <= max(h, w); i++) {
    logs[i] = logs[i >> 1] + 1;
  }
  auto MaxA = [&](int L, int R) {
    int k = logs[R - L + 1];
    return max(maxa[L][k], maxa[R - (1 << k) + 1][k]);
  };
  auto MaxB = [&](int L, int R) {
    int k = logs[R - L + 1];
    return max(maxb[L][k], maxb[R - (1 << k) + 1][k]);
  };
  auto Go = [&](int x, int y, int dir) {
    if (dir == 0) {
      // up
      if (x == 0) {
        return make_pair(x, y);
      }
      x--;
      {
        if (MaxA(0, x) < b[y]) {
          return make_pair(0, y);
        }
        int low = 0, high = x, pos = x;
        while (low <= high) {
          int mid = low + high >> 1;
          if (MaxA(mid, x) >= b[y]) {
            pos = mid;
            low = mid + 1;
          } else {
            high = mid - 1;
          }
        }
        return make_pair(pos, y);
      }
      /* while (x > 0 && a[x] < b[y]) {
        x -= 1;
      }
      return make_pair(x, y); */
    }
    if (dir == 1) {
      // down
      if (x == h - 1) {
        return make_pair(x, y);
      }
      x += 1;
      {
        if (MaxA(x, h - 1) < b[y]) {
          return make_pair(h - 1, y);
        }
        int low = x, high = h - 1, pos = h - 1;
        while (low <= high) {
          int mid = low + high >> 1;
          if (MaxA(x, mid) >= b[y]) {
            pos = mid;
            high = mid - 1;
          } else {
            low = mid + 1;
          }
        }
        return make_pair(pos, y);
      } 
      /* while (x + 1 < h && a[x] < b[y]) {
        x += 1;
      }
      return make_pair(x, y); */
    }
    if (dir == 2) {
      // left
      if (y == 0) {
        return make_pair(x, y);
      }
      y -= 1;
      {
        if (MaxB(0, y) < a[x]) {
          return make_pair(x, 0);
        }
        int low = 0, high = y, pos = y;
        while (low <= high) {
          int mid = low + high >> 1;
          if (MaxB(mid, y) >= a[x]) {
            pos = mid;
            low = mid + 1;
          } else {
            high = mid - 1;
          }
        }
        return make_pair(x, pos);
      } 
      /* while (y > 0 && a[x] > b[y]) {
        y -= 1;
      }
      return make_pair(x, y); */
    }
    if (dir == 3) {
      // right
      if (y == w - 1) {
        return make_pair(x, y);
      }
      y += 1;
      {
        if (MaxB(y, w - 1) < a[x]) {
          return make_pair(x, w - 1);
        }
        int low = y, high = w - 1, pos = y;
        while (low <= high) {
          int mid = low + high >> 1;
          if (MaxB(y, mid) >= a[x]) {
            pos = mid;
            high = mid - 1;
          } else {
            low = mid + 1;
          }
        }
        return make_pair(x, pos);
      } 
      /* while (y + 1 < w && a[x] > b[y]) {
        y += 1;
      }
      return make_pair(x, y); */
    }
    assert(false);
    return make_pair(-1, -1);
  };
  vector<unordered_map<pair<int, int>, bool>> was(4);
  vector<unordered_map<pair<int, int>, int>> dp(4);
  function<int(int, int, int)> Solve = [&](int x, int y, int dir) {
    if (dir == 0) {
      if (a[x] < b[y]) {
        return 0;
      }
    }
    if (dir == 1) {
      if (a[x] < b[y]) {
        return 0;
      }
    }
    if (dir == 2) {
      if (a[x] > b[y]) {
        return 0;
      }
    }
    if (dir == 3) {
      if (a[x] > b[y]) {
        return 0;
      }
    }
    pair<int, int> curr = {x, y};
    if (was[dir][curr]) {
      return dp[dir][curr];
    }
    was[dir][curr] = true;
    if (dir == 0 || dir == 1) {
      {
        pair<int, int> nxt = Go(x, y, 2);
        if (nxt.first != x || nxt.second != y) {
          dp[dir][curr] = max(dp[dir][curr], Solve(nxt.first, nxt.second, 2) + abs(nxt.first - x) + abs(nxt.second - y));
        }
      }
      {
        pair<int, int> nxt = Go(x, y, 3);
        if (nxt.first != x || nxt.second != y) {
          dp[dir][curr] = max(dp[dir][curr], Solve(nxt.first, nxt.second, 3) + abs(nxt.first - x) + abs(nxt.second - y));
        }
      }
    } 
    if (dir == 2 || dir == 3) {
      {
        pair<int, int> nxt = Go(x, y, 0);
        if (nxt.first != x || nxt.second != y) {
          dp[dir][curr] = max(dp[dir][curr], Solve(nxt.first, nxt.second, 0) + abs(nxt.first - x) + abs(nxt.second - y));
        }
      }
      {
        pair<int, int> nxt = Go(x, y, 1);
        if (nxt.first != x || nxt.second != y) {
          dp[dir][curr] = max(dp[dir][curr], Solve(nxt.first, nxt.second, 1) + abs(nxt.first - x) + abs(nxt.second - y));
        }
      }
    }
    return dp[dir][curr];
  };
  while (q--) {
    int x, y;
    cin >> x >> y;
    --x; --y;
    int res = 1;
    for (int dir = 0; dir < 4; dir++) {
      pair<int, int> cell = Go(x, y, dir);
      int nx = cell.first;
      int ny = cell.second;
      if (nx != x || ny != y) {
        res = max(res, Solve(nx, ny, dir) + abs(x - nx) + abs(y - ny));
      }
    }
    cout << res << '\n';
    for (int dir = 0; dir < 4; dir++) {
      was[dir].clear();
      dp[dir].clear();
    }
  }
  return 0;
}

Compilation message

abduction2.cpp: In lambda function:
abduction2.cpp:62:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   62 |           int mid = low + high >> 1;
      |                     ~~~~^~~~~~
abduction2.cpp:89:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   89 |           int mid = low + high >> 1;
      |                     ~~~~^~~~~~
abduction2.cpp:116:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  116 |           int mid = low + high >> 1;
      |                     ~~~~^~~~~~
abduction2.cpp:143:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  143 |           int mid = low + high >> 1;
      |                     ~~~~^~~~~~
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_M_hash_code(const _Key&) const [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code = long unsigned int]':
/usr/include/c++/10/bits/hashtable_policy.h:707:45:   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 = std::pair<int, int>; _Pair = std::pair<const std::pair<int, int>, bool>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _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 = bool; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::key_type = std::pair<int, int>]'
/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 = std::pair<int, int>; _Tp = bool; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = bool; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::pair<int, int>]'
abduction2.cpp:185:22:   required from here
/usr/include/c++/10/bits/hashtable_policy.h:1377:16: error: static assertion failed: hash function must be invocable with an argument of key type
 1377 |  static_assert(__is_invocable<const _H1&, const _Key&>{},
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1379:16: error: no match for call to '(const std::hash<std::pair<int, int> >) (const std::pair<int, int>&)'
 1379 |  return _M_h1()(__k);
      |         ~~~~~~~^~~~~
/usr/include/c++/10/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_M_hash_code(const _Key&) const [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code = long unsigned int]':
/usr/include/c++/10/bits/hashtable_policy.h:707:45:   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 = std::pair<int, int>; _Pair = std::pair<const std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _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 = int; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::key_type = std::pair<int, int>]'
/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 = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::pair<int, int>]'
abduction2.cpp:186:26:   required from here
/usr/include/c++/10/bits/hashtable_policy.h:1377:16: error: static assertion failed: hash function must be invocable with an argument of key type
 1377 |  static_assert(__is_invocable<const _H1&, const _Key&>{},
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1379:16: error: no match for call to '(const std::hash<std::pair<int, int> >) (const std::pair<int, int>&)'
 1379 |  return _M_h1()(__k);
      |         ~~~~~~~^~~~~
In file included from /usr/include/c++/10/bits/alloc_traits.h:33,
                 from /usr/include/c++/10/ext/alloc_traits.h:34,
                 from /usr/include/c++/10/bits/basic_string.h:40,
                 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/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/stl_construct.h: In instantiation of 'void std::_Construct(_Tp*, _Args&& ...) [with _Tp = std::unordered_map<std::pair<int, int>, bool>; _Args = {}]':
/usr/include/c++/10/bits/stl_uninitialized.h:567:18:   required from 'static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = std::unordered_map<std::pair<int, int>, bool>*; _Size = long unsigned int; bool _TrivialValueType = false]'
/usr/include/c++/10/bits/stl_uninitialized.h:623:20:   required from '_ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = std::unordered_map<std::pair<int, int>, bool>*; _Size = long unsigned int]'
/usr/include/c++/10/bits/stl_uninitialized.h:685:44:   required from '_ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, std::allocator<_Tp>&) [with _ForwardIterator = std::unordered_map<std::pair<int, int>, bool>*; _Size = long unsigned int; _Tp = std::unordered_map<std::pair<int, int>, bool>]'
/usr/include/c++/10/bits/stl_vector.h:1606:36:   required from 'void std::vector<_Tp, _Alloc>::_M_default_initialize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::unordered_map<std::pair<int, int>, bool>; _Alloc = std::allocator<std::unordered_map<std::pair<int, int>, bool> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
/usr/include/c++/10/bits/stl_vector.h:512:9:   required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::unordered_map<std::pair<int, int>, bool>; _Alloc = std::allocator<std::unordered_map<std::pair<int, int>, bool> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::unordered_map<std::pair<int, int>, bool> >]'
abduction2.cpp:161:52:   required from here
/usr/include/c++/10/bits/stl_construct.h:109:7: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = bool; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >]'
  109 |     { ::new(static_cast<void*>(__p)) _Tp(std::forward<_Args>(__args)...); }
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/unordered_map:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/unordered_map.h:141:7: note: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = bool; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >]' is implicitly deleted because the default definition would be ill-formed:
  141 |       unordered_map() = default;
      |       ^~~~~~~~~~~~~
/usr/include/c++/10/bits/unordered_map.h:141:7: error: use of deleted function 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _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>]'
In file included from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/hashtable.h:451:7: note: 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _Alloc = std::allocator<std::pair<const std::pair<int, int>, bool> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _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>]' is implicitly deleted because the default definition would be ill-formed:
  451 |       _Hashtable() = default;
      |       ^~~~~~~~~~
/usr/include/c++/10/bits/hashtable.h:451:7: error: use of deleted function 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>]'
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: note: 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::pair<int, int> >; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>]' is implicitly deleted because the default definition would be ill-formed:
 1791 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: error: use of deleted function 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing]'
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: note: 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base() [with _Key = std::pair<int, int>; _Value = std::pair<const std::pair<int, int>, bool>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::pair<int, int> >; _H2 = std::__detail::_Mod_range_hashing]' is implicitly deleted because the default definition would be ill-formed:
 1368 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<int, int> >]'
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: note: 'std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<int, int> >]' is implicitly deleted because the default definition would be ill-formed:
 1112 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: error: use of deleted function 'std::hash<std::pair<int, int> >::hash()'
In file included from /usr/include/c++/10/bits/basic_string.h:6787,
                 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/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<int, int> >::hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:101:12: error: no matching function for call to 'std::__hash_enum<std::pair<int, int>, false>::__hash_enum()'
/usr/include/c++/10/bits/functional_hash.h:82:7: note: candidate: 'std::__hash_enum<_Tp, <anonymous> >::__hash_enum(std::__hash_enum<_Tp, <anonymous> >&&) [with _Tp = std::pair<int, int>; bool <anonymous> = false]'
   82 |       __hash_enum(__hash_enum&&);
      |       ^~~~~~~~~~~
/usr/include/c++/10/bits/functional_hash.h:82:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/10/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<int, int>; bool <anonymous> = false]' is private within this context
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: error: use of deleted function 'std::hash<std::pair<int, int> >::~hash()'
 1112 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/bits/basic_string.h:6787,
                 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/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<int, int> >::~hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/10/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<int, int>; bool <anonymous> = false]' is private within this context
/usr/include/c++/10/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:117,
                 from abduction2.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h:1368:7: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<int, int> >, true>::~_Hashtable_ebo_helper()'
 1368 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1109:12: note: 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<int, int> >, true>::~_Hashtable_ebo_helper()' is implicitly de