Submission #347730

#TimeUsernameProblemLanguageResultExecution timeMemory
347730ryanseeRectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include "rect.h" #include "bits/stdc++.h" using namespace std; #define FAST ios_base::sync_with_stdio(false); cin.tie(0); #define pb push_back #define eb emplace_back #define ins insert #define f first #define s second #define cbr cerr<<"hi\n" #define mmst(x, v) memset((x), v, sizeof ((x))) #define siz(x) ll(x.size()) #define all(x) (x).begin(), (x).end() #define lbd(x,y) (lower_bound(all(x),y)-x.begin()) #define ubd(x,y) (upper_bound(all(x),y)-x.begin()) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //can be used by calling rng() or shuffle(A, A+n, rng) inline long long rand(long long x, long long y) { return rng() % (y+1-x) + x; } //inclusivesss string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); } using ll=int; using ld=long double; #define FOR(i,s,e) for(ll i=s;i<=ll(e);++i) #define DEC(i,s,e) for(ll i=s;i>=ll(e);--i) using pi=pair<short,short>; using spi=pair<ll,pi>; using dpi=pair<pi,pi>; long long LLINF = 1e18; int INF = 1e9+1e6; #define MAXN (2503) ll r, c, A[MAXN][MAXN]; struct grid { short r, l, u, d; } G[MAXN][MAXN], P[MAXN][MAXN]; unordered_set<dpi> s; short tmp[MAXN]; struct _st { short st[12][MAXN]; void build() { FOR(i,1,MAXN-1) st[0][i]=tmp[i]; FOR(h,1,11) for(ll i=1;i+(1<<h)-1<MAXN;++i) { st[h][i] = min(st[h-1][i], st[h-1][i+(1<<(h-1))]); } } int lg2(int x) { return 31 ^ __builtin_clz(x); // ll has 2^64 - 1 so 63 bits } short query(int x, int y) { // inclusive in this case int p = lg2(y-x+1); return min(st[p][x], st[p][y-(1<<p)+1]); } } R[MAXN], L[MAXN], U[MAXN], D[MAXN]; // #define gc getchar_unlocked // inline ll in() { // char ch=gc(); // ll x=0; // while(ch<'0'||ch>'9') ch=gc(); // while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch&15),ch=gc(); // return x; // } int main2() { // FAST // r=in(), c=in(); // FOR(i,1,r) FOR(j,1,c) A[i][j]=in(); vector<pair<int, short>> v; FOR(j,1,c) { v.clear(); vector<pair<ll, short>>().swap(v); DEC(i,r,1) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); G[i][j].d = v.size() ? v.back().s : r + 1; v.eb(A[i][j], i); } } FOR(j,1,c) { v.clear(); vector<pair<ll, short>>().swap(v); FOR(i,1,r) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); G[i][j].u = v.size() ? v.back().s : 0; v.eb(A[i][j], i); } } FOR(i,1,r) { v.clear(); vector<pair<ll, short>>().swap(v); DEC(j,c,1) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); G[i][j].r = v.size() ? v.back().s : c + 1; v.eb(A[i][j], j); } } FOR(i,1,r) { v.clear(); vector<pair<ll, short>>().swap(v); FOR(j,1,c) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); G[i][j].l = v.size() ? v.back().s : 0; v.eb(A[i][j], j); } } FOR(j,1,c) { v.clear(); vector<pair<ll, short>>().swap(v); DEC(i,r,1) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); P[i][j].d = v.size() ? v.back().s : r + 1; v.eb(A[i][j], i); } } FOR(j,1,c) { v.clear(); vector<pair<ll, short>>().swap(v); FOR(i,1,r) { while(v.size() && v.back().f <= A[i][j]) v.pop_back(); P[i][j].u = v.size() ? v.back().s : 0; v.eb(A[i][j], i); } } FOR(i,1,r) { v.clear(); vector<pair<ll, short>>().swap(v); DEC(j,c,1) { while(v.size() && v.back().f < A[i][j]) v.pop_back(); P[i][j].r = v.size() ? v.back().s : c + 1; v.eb(A[i][j], j); } } FOR(i,1,r) { v.clear(); vector<pair<ll, short>>().swap(v); FOR(j,1,c) { while(v.size() && v.back().f <= A[i][j]) v.pop_back(); P[i][j].l = v.size() ? v.back().s : 0; v.eb(A[i][j], j); } } // FOR(i,1,r) { // FOR(j,0,MAXN-1) tmp[j] = A[i][j]; // row[i].build(); // } // FOR(j,1,c) { // FOR(i,0,MAXN-1) tmp[i] = A[i][j]; // col[j].build(); // } FOR(i,1,r) { FOR(j,0,MAXN-1) tmp[j] = -G[i][j].u; U[i].build(); FOR(j,0,MAXN-1) tmp[j] = G[i][j].d; D[i].build(); } FOR(j,1,c) { FOR(i,0,MAXN-1) tmp[i] = G[i][j].r; R[j].build(); FOR(i,0,MAXN-1) tmp[i] = -G[i][j].l; L[j].build(); } int ans = 0; v.clear(); vector<pair<ll, short>>().swap(v); FOR(i,1,r)FOR(j,1,c){ short r1,c1,r2,c2; r1 = P[i][j].u, r2 = P[i][j].d, c1 = P[i][j].l, c2 = P[i][j].r; if(r1 == 0 || r2 == r + 1 || c1 == 0 || c2 == c+1 || s.find(dpi(pi(r1, c1),pi(r2, c2))) != s.end()) continue; s.ins(dpi(pi(r1, c1),pi(r2, c2))); bool okay = 1; // FOR(r,r1+1,r2-1) okay &= A[r][c1] > A[i][j], okay &= A[r][c2] > A[i][j], // okay &= G[r][c1].r >= c2, okay &= G[r][c2].l <= c1; // okay &= col[c1].query(r1+1, r2-1) > A[i][j], okay &= col[c2].query(r1+1, r2-1) > A[i][j]; okay &= R[c1].query(r1+1, r2-1) >= c2, okay &= -L[c2].query(r1+1, r2-1) <= c1; // FOR(c,c1+1,c2-1) okay &= A[r1][c] > A[i][j], okay &= A[r2][c] > A[i][j], // okay &= G[r1][c].d >= r2, okay &= G[r2][c].u <= r1; // okay &= row[r1].query(c1+1, c2-1) > A[i][j], okay &= row[r2].query(c1+1, c2-1) > A[i][j]; okay &= D[r1].query(c1+1, c2-1) >= r2, okay &= -U[r2].query(c1+1, c2-1) <= r1; ans += okay; // if(okay) { // cerr<<r1<<' '<<c1<<' '<<r2<<' '<<c2<<' '<<i<<' '<<j<<'\n'; // } } return ans; } long long count_rectangles(std::vector<std::vector<int> > a) { r = siz(a), c = siz(a[0]); FOR(i,1,r)FOR(j,1,c)A[i][j]=a[i-1][j-1]; a.clear(), vector<vector<int>>().swap(a); return main2(); }

Compilation message (stderr)

rect.cpp:11:11: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Hash = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Pred = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >]'
   11 | #define s second
      |           ^~~~~~
rect.cpp:37:20: note: in expansion of macro 's'
   37 | unordered_set<dpi> s;
      |                    ^
In file included from /usr/include/c++/9/unordered_set:47,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:118,
                 from rect.cpp:3:
/usr/include/c++/9/bits/unordered_set.h:135:7: note: 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Hash = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Pred = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >]' is implicitly deleted because the default definition would be ill-formed:
  135 |       unordered_set() = default;
      |       ^~~~~~~~~~~~~
/usr/include/c++/9/bits/unordered_set.h:135:7: error: use of deleted function 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short 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, true, true>]'
In file included from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable.h:414:7: note: 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable() [with _Key = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short 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, true, true>]' is implicitly deleted because the default definition would be ill-formed:
  414 |       _Hashtable() = default;
      |       ^~~~~~~~~~
/usr/include/c++/9/bits/hashtable.h:414:7: error: use of deleted function 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]'
In file included from /usr/include/c++/9/bits/hashtable.h:35,
                 from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable_policy.h:1822:5: note: 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base() [with _Key = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, true, true>]' is implicitly deleted because the default definition would be ill-formed:
 1822 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1822: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<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H2 = std::__detail::_Mod_range_hashing]'
/usr/include/c++/9/bits/hashtable_policy.h:1373: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<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H2 = std::__detail::_Mod_range_hashing]' is implicitly deleted because the default definition would be ill-formed:
 1373 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1373: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<std::pair<short int, short int>, std::pair<short int, short int> > >]'
/usr/include/c++/9/bits/hashtable_policy.h:1096:7: note: 'std::__detail::_Hashtable_ebo_helper<_Nm, _Tp, true>::_Hashtable_ebo_helper() [with int _Nm = 1; _Tp = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >]' is implicitly deleted because the default definition would be ill-formed:
 1096 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1096:7: error: use of deleted function 'std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >::hash()'
In file included from /usr/include/c++/9/bits/stl_bvector.h:61,
                 from /usr/include/c++/9/vector:68,
                 from rect.h:5,
                 from rect.cpp:1:
/usr/include/c++/9/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >::hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/9/bits/functional_hash.h:101:12: error: no matching function for call to 'std::__hash_enum<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, false>::__hash_enum()'
/usr/include/c++/9/bits/functional_hash.h:82:7: note: candidate: 'std::__hash_enum<_Tp, <anonymous> >::__hash_enum(std::__hash_enum<_Tp, <anonymous> >&&) [with _Tp = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; bool <anonymous> = false]'
   82 |       __hash_enum(__hash_enum&&);
      |       ^~~~~~~~~~~
/usr/include/c++/9/bits/functional_hash.h:82:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/9/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; bool <anonymous> = false]' is private within this context
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/9/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/9/bits/hashtable.h:35,
                 from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable_policy.h:1096:7: error: use of deleted function 'std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >::~hash()'
 1096 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/bits/stl_bvector.h:61,
                 from /usr/include/c++/9/vector:68,
                 from rect.h:5,
                 from rect.cpp:1:
/usr/include/c++/9/bits/functional_hash.h:101:12: note: 'std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >::~hash()' is implicitly deleted because the default definition would be ill-formed:
  101 |     struct hash : __hash_enum<_Tp>
      |            ^~~~
/usr/include/c++/9/bits/functional_hash.h:101:12: error: 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; bool <anonymous> = false]' is private within this context
/usr/include/c++/9/bits/functional_hash.h:83:7: note: declared private here
   83 |       ~__hash_enum();
      |       ^
In file included from /usr/include/c++/9/bits/hashtable.h:35,
                 from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable_policy.h:1373:7: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, true>::~_Hashtable_ebo_helper()'
 1373 |       _Hash_code_base() = default;
      |       ^~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1093:12: note: 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, true>::~_Hashtable_ebo_helper()' is implicitly deleted because the default definition would be ill-formed:
 1093 |     struct _Hashtable_ebo_helper<_Nm, _Tp, true>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1093:12: error: use of deleted function 'std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >::~hash()'
/usr/include/c++/9/bits/hashtable_policy.h:1822:5: error: use of deleted function 'std::__detail::_Hash_code_base<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::__detail::_Identity, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
 1822 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1346:12: note: 'std::__detail::_Hash_code_base<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::__detail::_Identity, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()' is implicitly deleted because the default definition would be ill-formed:
 1346 |     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1347 |       _Default_ranged_hash, true>
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1346:12: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, true>::~_Hashtable_ebo_helper()'
In file included from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable.h:414:7: error: use of deleted function 'std::__detail::_Hashtable_base<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::__detail::_Identity, std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::~_Hashtable_base()'
  414 |       _Hashtable() = default;
      |       ^~~~~~~~~~
In file included from /usr/include/c++/9/bits/hashtable.h:35,
                 from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from rect.cpp:3:
/usr/include/c++/9/bits/hashtable_policy.h:1770:10: note: 'std::__detail::_Hashtable_base<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::__detail::_Identity, std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::~_Hashtable_base()' is implicitly deleted because the default definition would be ill-formed:
 1770 |   struct _Hashtable_base
      |          ^~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1770:10: error: use of deleted function 'std::__detail::_Hash_code_base<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, std::__detail::_Identity, std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
/usr/include/c++/9/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<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _ExtractKey = std::__detail::_Identity; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short 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++/9/bits/hashtable.h:1417:19:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::find(const key_type&) [with _Key = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _ExtractKey = std::__detail::_Identity; _Equal = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _H1 = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short 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, true, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, true, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::key_type = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >]'
/usr/include/c++/9/bits/unordered_set.h:650:29:   required from 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::iterator std::unordered_set<_Value, _Hash, _Pred, _Alloc>::find(const key_type&) [with _Value = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >; _Hash = std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Pred = std::equal_to<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; _Alloc = std::allocator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::iterator = std::__detail::_Node_iterator<std::pair<std::pair<short int, short int>, std::pair<short int, short int> >, true, true>; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_type = std::pair<std::pair<short int, short int>, std::pair<short int, short int> >]'
rect.cpp:177:89:   required from here
/usr/include/c++/9/bits/hashtable_policy.h:1382:16: error: static assertion failed: hash function must be invocable with an argument of key type
 1382 |  static_assert(__is_invocable<const _H1&, const _Key&>{},
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/hashtable_policy.h:1384:16: error: no match for call to '(const std::hash<std::pair<std::pair<short int, short int>, std::pair<short int, short int> > >) (const std::pair<std::pair<short int, short int>, std::pair<short int, short int> >&)'
 1384 |  return _M_h1()(__k);
      |         ~~~~~~~^~~~~
In file included from /usr/include/c++/9/unordered_map:46,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:117,
                 from /var/local/lib/is