Submission #693655

# Submission time Handle Problem Language Result Execution time Memory
693655 2023-02-03T06:29:15 Z nianny Growing Vegetable is Fun 3 (JOI19_ho_t3) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define DBGRUN(stmt) stmt
#define DBG1(x) cout << #x << ": " << (x) << endl
#define DBG2(x, y) cout << #x << ": " << (x) << ", " << #y << ": " << (y) << endl
#define DBG3(x, y, z) cout << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << endl
#define DBG4(w, x, y, z) cout << #w << ": " << (w) << ", " << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << endl
#define DBG_ARR(a, e) cout << #a << ": "; for (int i = 0; i < e; i++) cout << a[i] << ' '; cout << endl
#define DBG_ARR2D(a, s1, e1, s2, e2) cout << #a << ": " << endl; for (int i = s1; i < e1; i++) { for (int j = s2; j < e2; j++) cout << a[i][j] << ' '; cout << '\n'; }cout << endl
#define DBG_VEC(v) cout << #v << ": "; for (auto i : v) cout << i << ' '; cout << endl
#define DBG_HERE cout << "reached line: " << __LINE__ << endl
#else
#define DBGRUN(stmt)
#define DBG1(x)
#define DBG2(x, y)
#define DBG3(x, y, z)
#define DBG4(w, x, y, z)
#define DBG_ARR(a, e)
#define DBG_ARR2D(a, s1, e1, s2, e2)
#define DBG_VEC(v)
#define DBG_HERE
#endif
#define int long long
#define f first
#define s second
#define pii pair<int, int>
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a)) 
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c); --(a))
#define ALLV(v) v.begin(), v.end() 
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v)) 
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz)) 
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
template <typename A, typename B> ostream& operator<<(ostream& out, const pair<A, B>& a) { out << "(" << a.first << ", " << a.second << ")"; return out; }
template<typename ...Ts, size_t ...Is> ostream& println_tuple_impl(ostream& os, tuple<Ts...> tuple, index_sequence<Is...>) { static_assert(sizeof...(Is) == sizeof...(Ts), "Indices must have same number of elements as tuple types!"); static_assert(sizeof...(Ts) > 0, "Cannot insert empty tuple into stream."); auto last = sizeof...(Ts) - 1; os << "("; return ((os << get<Is>(tuple) << (Is != last ? ", " : ")\n")), ...); }
template<typename ...Ts> ostream& operator<<(ostream& os, const tuple<Ts...>& tuple) { return println_tuple_impl(os, tuple, index_sequence_for<Ts...>{}); }
    
int N, R, G, Y;
unordered_map<tuple<int, int, int, int>, int> memo;
vector<int> rPos, gPos, yPos;
string S, A;
    
int dp(int RR, int GG, int YY, int lastUsed) {
    if (memo.find({ RR, GG, YY, lastUsed }) != memo.end())
        return memo[{RR, GG, YY, lastUsed}];
    if (RR == R && GG == G && YY == Y) return 0;
    int res = 1e18;
    // int idx = RR + GG + YY;
    
    if (RR < R && lastUsed != 0) {
        int nearestR = rPos[RR], ad = 0;
        // ad += max(GG - (upper_bound(gPos.begin(), gPos.end(), nearestR) - gPos.begin()), 0ll);
        // ad += max(YY - (upper_bound(yPos.begin(), yPos.end(), nearestR) - yPos.begin()), 0ll);
        int newRes = dp(RR + 1, GG, YY, 0) + ad;
        // DBG2(idx, lastUsed);
        // DBG3(ad, max(nearestR - idx, 0ll), newRes);
        res = min(res, newRes);
    }
    
    if (GG < G && lastUsed != 1) {
        int nearestG = gPos[GG], ad = 0;
        // ad += max(RR - (upper_bound(rPos.begin(), rPos.end(), nearestG) - rPos.begin()), 0ll);
        // ad += max(YY - (upper_bound(yPos.begin(), yPos.end(), nearestG) - yPos.begin()), 0ll);
        int newRes = dp(RR, GG + 1, YY, 1) + ad;
        res = min(res, newRes);
    }
    
    if (YY < Y && lastUsed != 2) {
        int nearestY = yPos[YY], ad = 0;
        // ad += max(RR - (upper_bound(rPos.begin(), rPos.end(), nearestY) - rPos.begin()), 0ll);
        // ad += max(GG - (upper_bound(gPos.begin(), gPos.end(), nearestY) - gPos.begin()), 0ll);
        int newRes = dp(RR, GG, YY + 1, 2) + ad;
        // DBG2(idx, lastUsed);
        // DBG3(ad, max(nearestY - idx, 0ll), newRes);
        res = min(res, newRes);
    }
    
    memo[{RR, GG, YY, lastUsed}] = res;
    return res;
}
    
void dp2(int RR, int GG, int YY, int lastUsed) {
    if (RR == R && GG == G && YY == Y) return;
    int res = 1e18;
    char c;
    tuple<int, int, int, int> t = { -1, -1, -1, -1 };
    
    if (RR < R && lastUsed != 0) {
        if (memo[{RR + 1, GG, YY, 0}] < res) {
            res = memo[{RR + 1, GG, YY, 0}];
            t = { RR + 1, GG, YY, 0 };
            c = 'R';
        }
    }
    
    if (GG < G && lastUsed != 1) {
        if (memo[{RR, GG + 1, YY, 1}] < res) {
            res = memo[{RR, GG + 1, YY, 1}];
            t = { RR, GG + 1, YY, 1 };
            c = 'G';
        }
    }
    
    if (YY < Y && lastUsed != 2) {
        if (memo[{RR, GG, YY + 1, 2}] < res) {
            res = memo[{RR, GG, YY + 1, 2}];
            t = { RR, GG, YY + 1, 2 };
            c = 'Y';
        }
    }
    A += c;
    
    int a, b, cc, d;
    tie(a, b, cc, d) = t;
    DBG2(a + b + cc, res);
    dp2(a, b, cc, d);
}
    
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin >> N >> S;
    FOR(i, 0, N) {
        if (S[i] == 'R') {
            R++;
            rPos.push_back(i);
        }
        if (S[i] == 'G') {
            G++;
            gPos.push_back(i);
        }
        if (S[i] == 'Y') {
            Y++;
            yPos.push_back(i);
        }
    }
    int res = dp(0, 0, 0, -1);
    if (res >= 1e18) cout << -1;
    else {
        cout << res;
        // DBGRUN(dp2(0, 0, 0, -1));
        // DBG1(A);
    }
}

Compilation message

joi2019_ho_t3.cpp:42:47: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::tuple<long long int, long long int, long long int, long long int>; _Tp = long long int; _Hash = std::hash<std::tuple<long long int, long long int, long long int, long long int> >; _Pred = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int> >]'
   42 | unordered_map<tuple<int, int, int, int>, int> memo;
      |                                               ^~~~
In file included from /usr/include/c++/10/unordered_map:47,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.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::tuple<long long int, long long int, long long int, long long int>; _Tp = long long int; _Hash = std::hash<std::tuple<long long int, long long int, long long int, long long int> >; _Pred = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int> >]' 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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _Alloc = std::allocator<std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _Alloc = std::allocator<std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long int>; _Value = std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long int> >::hash()'
In file included from /usr/include/c++/10/string_view:42,
                 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/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 joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h:1112:7: error: use of deleted function 'std::hash<std::tuple<long long int, long long int, long long int, long long int> >::~hash()'
 1112 |       _Hashtable_ebo_helper() = default;
      |       ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/string_view:42,
                 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/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 joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/functional_hash.h:101:12: note: 'std::hash<std::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long 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/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.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::tuple<long long int, long long int, long long int, long long 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::tuple<long long int, long long int, long long int, long long int> >, true>::~_Hashtable_ebo_helper()' is implicitly deleted because the default definition would be ill-formed:
 1109 |     struct _Hashtable_ebo_helper<_Nm, _Tp, true>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1109:12: error: use of deleted function 'std::hash<std::tuple<long long int, long long int, long long int, long long int> >::~hash()'
/usr/include/c++/10/bits/hashtable_policy.h:1791:5: error: use of deleted function 'std::__detail::_Hash_code_base<std::tuple<long long int, long long int, long long int, long long int>, std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>, std::__detail::_Select1st, std::hash<std::tuple<long long int, long long int, long long int, long long int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
 1791 |     _Hashtable_base() = default;
      |     ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1341:12: note: 'std::__detail::_Hash_code_base<std::tuple<long long int, long long int, long long int, long long int>, std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>, std::__detail::_Select1st, std::hash<std::tuple<long long int, long long int, long long int, long long 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:
 1341 |     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1342 |       _Default_ranged_hash, true>
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1341:12: error: use of deleted function 'std::__detail::_Hashtable_ebo_helper<1, std::hash<std::tuple<long long int, long long int, long long int, long long int> >, true>::~_Hashtable_ebo_helper()'
In file included from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/hashtable.h:451:7: error: use of deleted function 'std::__detail::_Hashtable_base<std::tuple<long long int, long long int, long long int, long long int>, std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>, std::__detail::_Select1st, std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >, std::hash<std::tuple<long long int, long long int, long long int, long long int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable_base()'
  451 |       _Hashtable() = default;
      |       ^~~~~~~~~~
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h:1725:10: note: 'std::__detail::_Hashtable_base<std::tuple<long long int, long long int, long long int, long long int>, std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>, std::__detail::_Select1st, std::equal_to<std::tuple<long long int, long long int, long long int, long long int> >, std::hash<std::tuple<long long int, long long int, long long int, long long int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::~_Hashtable_base()' is implicitly deleted because the default definition would be ill-formed:
 1725 |   struct _Hashtable_base
      |          ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable_policy.h:1725:10: error: use of deleted function 'std::__detail::_Hash_code_base<std::tuple<long long int, long long int, long long int, long long int>, std::pair<const std::tuple<long long int, long long int, long long int, long long int>, long long int>, std::__detail::_Select1st, std::hash<std::tuple<long long int, long long int, long long int, long long int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::~_Hash_code_base()'
joi2019_ho_t3.cpp: In function 'long long int dp(long long int, long long int, long long int, long long int)':
joi2019_ho_t3.cpp:54:13: warning: unused variable 'nearestR' [-Wunused-variable]
   54 |         int nearestR = rPos[RR], ad = 0;
      |             ^~~~~~~~
joi2019_ho_t3.cpp:64:13: warning: unused variable 'nearestG' [-Wunused-variable]
   64 |         int nearestG = gPos[GG], ad = 0;
      |             ^~~~~~~~
joi2019_ho_t3.cpp:72:13: warning: unused variable 'nearestY' [-Wunused-variable]
   72 |         int nearestY = yPos[YY], ad = 0;
      |             ^~~~~~~~
joi2019_ho_t3.cpp: In function 'int32_t main()':
joi2019_ho_t3.cpp:28:30: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   28 | #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
      |                              ^
joi2019_ho_t3.cpp:127:5: note: in expansion of macro 'FOR'
  127 |     FOR(i, 0, N) {
      |     ^~~
In file included from /usr/include/c++/10/bits/hashtable.h:35,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from joi2019_ho_t3.cpp:1:
/usr/include/c++/10/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Va