제출 #208209

#제출 시각아이디문제언어결과실행 시간메모리
208209ToMmyDongSplit the Attractions (IOI19_split)C++14
컴파일 에러
0 ms0 KiB
#include "split.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define eb emplace_back #define SZ(i) int(i.size()) #define X first #define Y second #ifdef tmd #define debug(...) fprintf(stderr,"%d (%s) = ",__LINE__,#__VA_ARGS__);_do(__VA_ARGS__); template<typename T> void _do (T &&x){cerr<<x<<endl;} template<typename T, typename ...S> void _do (T &&x, S &&...y) {cerr<<x<<",";_do(y...);} template<typename IT> ostream &printRng (IT bg, IT ed, ostream &os) { os<<"{"; for (IT it=bg; it!=ed; it++) { if (it!=bg) { os<<","; } os<<(*it); } return os<<"}"; } template<typename T> ostream &operator << (ostream &os, vector<T> &vec) { return printRng(vec.begin(), vec.end(), os); } #else #define debug(...) #endif // tmd const int MAXN = 100005; const int MAXM = 200005; vector<int> edge[MAXN], tree[MAXN], btree[MAXN]; vector<pair<int,int> > gp; bool vis[MAXN]; int sz[MAXN]; int N; pair<int,int> msplit = {1, MAXN+1}; void span (int nd) { vis[nd] = true; sz[nd] = 1; for (auto v : edge[nd]) { if (!vis[v]) { span(v); sz[nd] += sz[v]; btree[nd].emplace_back(v); btree[v].emplace_back(nd); int cur = min(sz[v], N-sz[v]); if (cur >= gp[0].first && cur < msplit.second) { msplit = {v, cur}; } } } } void dfsSZ (int nd, int par) { sz[nd] = 1; for (auto v : btree[nd]) { if (v != par) { dfsSZ(v, nd); sz[nd] += sz[v]; } } } pii dfsCen (int nd, int par) { int mx = N - sz[nd]; pii bst = {1, N}; for (auto v : btree[nd]) { if (v != par) { pii res = dfsCen(v, nd); if (res.Y < bst.Y) { bst = res; } mx = max(mx, sz[v]); } } if (mx < bst.Y) { bst = {nd, mx}; } return bst; } int centroid () { return dfsCen(0,-1).first; } vector<int> inv (const vector<int> &s) { memset(vis, 0, sizeof(vis)); for (const auto v : s) { vis[v] = true; } vector<int> res; for (int i=0; i<N; i++) { if (!vis[i]) { res.emplace_back(i); } } return res; } bool inSet[MAXN]; void dfsN (int nd, int par, vector<int> &res, int &cnt, int g) { if (cnt < g) { cnt++; res.emplace_back(nd); for (auto v : btree[nd]) { if (v != par && inSet[v]) { dfsN(v, nd, res, cnt, g); } } } } vector<int> trim (const vector<int> &s, int g) { memset(inSet, 0, sizeof(inSet)); for (auto v : s) { inSet[v] = true; } vector<int> ret; int cnt = 0; dfsN(s.front(), -1, ret, cnt, g); return ret; } struct Subtree { int sz; vector<int> element; Subtree () { sz = 0; } }; vector<Subtree> child; void dfsSub (int nd, int par, Subtree &cur) { cur.sz++; cur.element.eb(nd); for (auto v : btree[nd]) { if (par != v) { dfsSub(v, nd, cur); } } } int id[MAXN]; vector<int> sedg[MAXN]; int A; bool vs[MAXN]; void dfsAns (int nd, vector<int> &res, int &wsum) { if (wsum >= A) { return; } vs[nd] = true; res.eb(nd); wsum += child[nd].sz; for (auto v : sedg[nd]) { dfsAns(v, res, wsum); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { N = n; gp = {{a,1}, {b,2}, {c,3}}; sort(gp.begin(), gp.end()); A = gp[0].first; int m = p.size(); for (int i=0; i<m; i++) { int u = p[i]; int v = q[i]; edge[u].emplace_back(v); edge[v].emplace_back(u); } span(0); int cen = centroid(); debug(cen); int mx = 0; for (auto v : btree[cen]) { Subtree cur; dfsSub(v, cen, cur); for (auto el : cur.element) { id[el] = child.size(); } debug(v, cur.element); if (cur.sz >= gp[0].first) { mx = child.size(); } child.eb(cur); } vector<int> aset, bset; if (child[mx].sz >= gp[0].first) { aset = child[mx].element; bset = inv(aset); if (aset.size() > bset.size()) { swap(aset, bset); } assert(aset.size() >= gp[0].first); assert(bset.size() >= gp[1].first); } else { int cc = SZ(child); for (int i=0; i<m; i++) { int u = p[i]; int v = q[i]; if (u == cen || v == cen) { continue; } if (id[u] != id[v]) { sedg[u].eb(v); sedg[v].eb(u); } } bool fnd = false; for (int i=0; i<cc; i++) { if (!vs[i]) { vector<int> vec; int wsum = 0; dfsAns(i, vec, wsum); debug(vec, wsum); if (wsum >= gp[0].first) { for (auto v : vec) { for (auto nd : child[v].element) { aset.eb(nd); } } bset = inv(aset); fnd = true; break; } } } if (!fnd) { return vector<int>(n,0); } } if (aset.size() > bset.size()) { swap(aset, bset); } assert(aset >= gp[0].first); assert(bset >= gp[1].first); aset = trim(aset,gp[0].first); bset = trim(bset,gp[1].first); vector<int> ret(n, gp[2].second); for (auto v : aset) { ret[v] = gp[0].second; } for (auto v : bset) { ret[v] = gp[1].second; } return ret; }

컴파일 시 표준 에러 (stderr) 메시지

In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:217:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         assert(aset.size() >= gp[0].first);
                ~~~~~~~~~~~~^~~~~~~~~~
split.cpp:218:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         assert(bset.size() >= gp[1].first);
                ~~~~~~~~~~~~^~~~~~~~~~
split.cpp:264:17: error: no match for 'operator>=' (operand types are 'std::vector<int>' and 'int')
     assert(aset >= gp[0].first);
            ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:984:5: note: candidate: template<class _BiIter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)
     operator>=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:984:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1068:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>=(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)
     operator>=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1068:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1148:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)
     operator>=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1148:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1222:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator>=(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)
     operator>=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1222:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1296:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)
     operator>=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1296:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1376:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator>=(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)
     operator>=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1376:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from split.cpp:2:
/usr/include/c++/7/bits/regex.h:1456:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)
     operator>=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1456:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/future:39:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:105,
                 from split.cpp:2:
/usr/include/c++/7/thread:297:3: note: candidate: bool std::operator>=(std::thread::id, std::thread::id)
   operator>=(thread::id __x, thread::id __y) noexcept
   ^~~~~~~~
/usr/include/c++/7/thread:297:3: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::thread::id'
In file included from /usr/include/c++/7/forward_list:38:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:104,
                 from split.cpp:2:
/usr/include/c++/7/bits/forward_list.h:1413:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator>=(const std::forward_list<_Tp, _Alloc>&, const std::forward_list<_Tp, _Alloc>&)
     operator>=(const forward_list<_Tp, _Alloc>& __lx,
     ^~~~~~~~
/usr/include/c++/7/bits/forward_list.h:1413:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::forward_list<_Tp, _Alloc>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95:0,
                 from split.cpp:2:
/usr/include/c++/7/valarray:1189:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__greater_equal, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__greater_equal, _Tp>::result_type> std::operator>=(const _Tp&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(>=, __greater_equal)
 ^
/usr/include/c++/7/valarray:1189:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95:0,
                 from split.cpp:2:
/usr/include/c++/7/valarray:1189:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__greater_equal, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__greater_equal, _Tp>::result_type> std::operator>=(const std::valarray<_Tp>&, const _Tp&)
 _DEFINE_BINARY_OPERATOR(>=, __greater_equal)
 ^
/usr/include/c++/7/valarray:1189:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::valarray<_Tp>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95:0,
                 from split.cpp:2:
/usr/include/c++/7/valarray:1189:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__greater_equal, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__greater_equal, _Tp>::result_type> std::operator>=(const std::valarray<_Tp>&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(>=, __greater_equal)
 ^
/usr/include/c++/7/valarray:1189:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::valarray<_Tp>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/valarray:592:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95,
                 from split.cpp:2:
/usr/include/c++/7/bits/valarray_after.h:419:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__greater_equal, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__greater_equal, typename _Dom1::value_type>::result_type> std::operator>=(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
     ^
/usr/include/c++/7/bits/valarray_after.h:419:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/valarray:592:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95,
                 from split.cpp:2:
/usr/include/c++/7/bits/valarray_after.h:419:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__greater_equal, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__greater_equal, typename _Dom1::value_type>::result_type> std::operator>=(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
     ^
/usr/include/c++/7/bits/valarray_after.h:419:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/valarray:592:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95,
                 from split.cpp:2:
/usr/include/c++/7/bits/valarray_after.h:419:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__greater_equal, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__greater_equal, typename _Dom1::value_type>::result_type> std::operator>=(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
     ^
/usr/include/c++/7/bits/valarray_after.h:419:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/valarray:592:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95,
                 from split.cpp:2:
/usr/include/c++/7/bits/valarray_after.h:419:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__greater_equal, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__greater_equal, typename _Dom1::value_type>::result_type> std::operator>=(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)
     _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
     ^
/usr/include/c++/7/bits/valarray_after.h:419:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/valarray:592:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95,
                 from split.cpp:2:
/usr/include/c++/7/bits/valarray_after.h:419:5: note: candidate: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__greater_equal, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__greater_equal, typename _Dom1::value_type>::result_type> std::operator>=(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
     ^
/usr/include/c++/7/bits/valarray_after.h:419:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/stack:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89,
                 from split.cpp:2:
/usr/include/c++/7/bits/stl_stack.h:335:5: note: candidate: template<class _Tp, class _Seq> bool std::operator>=(const std::stack<_Tp, _Seq>&, const std::stack<_Tp, _Seq>&)
     operator>=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
     ^~~~~~~~
/usr/include/c++/7/bits/stl_stack.h:335:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::stack<_Tp, _Seq>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/set:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87,
                 from split.cpp:2:
/usr/include/c++/7/bits/stl_multiset.h:941:5: note: candidate: template<class _Key, class _Compare, class _Alloc> bool std::operator>=(const std::multiset<_Key, _Compare, _Alloc>&, const std::multiset<_Key, _Compare, _Alloc>&)
     operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_multiset.h:941:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from split.cpp:2:
split.cpp:264:26: note:   'std::vector<int>' is not derived from 'const std::multiset<_Key, _Compare, _Alloc>'
     assert(aset >= gp[0].first);
                          ^
In file included from /usr/include/c++/7/set:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87,
                 from