제출 #216754

#제출 시각아이디문제언어결과실행 시간메모리
216754combi1k1청소 (JOI20_sweeping)C++14
컴파일 에러
0 ms0 KiB
//this solution is referred from comment of 300iq: //https://codeforces.com/blog/entry/74871?#comment-590823 #include<bits/stdc++.h> using namespace std; #define ll long long #define ld double #define sz(x) (int)x.size() #define all(x) x.begin(),x.end() #define pb emplace_back #define X first #define Y second const int N = 2e6 + 5; typedef pair<int,int> ii; typedef pair<int,ii> pii; struct Node { Node *l, *r; Node *par; ii key; int pri, nCh; int lzX, lzY; Node(int x = 0,int y = 0) : l(0), r(0), par(0), key(ii(x,y)), pri(rand() << 16 ^ rand()), nCh(1), lzX(-1), lzY(-1) {} } *p[N]; int Siz(Node *x) { if (x) return x -> nCh; else return 0; } void app(Node *x,int a,int b) { if (a >= 0) (x -> key).X = x -> lzX = a; if (b >= 0) (x -> key).Y = x -> lzY = b; } void pull(Node *x) { x -> nCh = 1; x -> nCh += Siz(x -> l); x -> nCh += Siz(x -> r); if (x -> l) x -> l -> par = x; if (x -> r) x -> r -> par = x; } void push(Node *x) { if (x -> l) app(x -> l,x -> lzX,x -> lzY); if (x -> r) app(x -> r,x -> lzX,x -> lzY); x -> lzX = -1; x -> lzY = -1; } Node *join(Node *x,Node *y) { if (!x) return y; if (!y) return x; if (x -> pri > y -> pri) { push(x); x -> r = join(x -> r,y); pull(x); return x; } else { push(y); y -> l = join(x,y -> l); pull(y); return y; } } void split(Node *x,Node*&l,Node*&r,ii v) { if (!x) { l = r = 0; return; } push(x); if (v.X < (x -> key).X) { split(x -> l,l,x -> l,v); pull(r = x); return; } if (v.Y < (x -> key).Y) { split(x -> l,l,x -> l,v); pull(r = x); return; } split(x -> r,x -> r,r,v); pull(l = x); } vector<Node*> vec; void dfs(Node *x) { if(!x) return; push(x); dfs(x -> l); dfs(x -> r); x -> l = 0; x -> r = 0; x -> par = 0; vec.pb(x); } struct Group { Node *Rt; int x, y; }; bool operator < (const Group&a,const Group&b) { ii tmp1(-a.y,a.Rt -> pri); ii tmp2(-b.y,b.Rt -> pri); return tmp1 < tmp2; } priority_queue<Group> pq[N]; int tr[N << 2]; #define lch i << 1 #define rch i << 1 | 1 void upd(int i,int l,int r,int p) { if (l > p) return; if (r < p) return; if (l == r) { if (pq[l].size()) tr[i] = pq[l].top().y; else tr[i] = 1e9 + 7; return; } int m = (l + r) / 2; upd(lch,l,m,p); ++m; upd(rch,m,r,p); tr[i] = min(tr[lch],tr[rch]); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(time(NULL)); int n; cin >> n; int m; cin >> m; int q; cin >> q; vector<pii> Que; vector<int> val; for(int i = 0 ; i < m ; ++i) { int x; cin >> x; int y; cin >> y; Que.pb(4,ii(x,y)); val.pb(x); } for(int i = 0 ; i < q ; ++i) { int t; cin >> t; int x; cin >> x; int y = n - x; if (t == 4) cin >> y; if (t == 2) swap(x,y); Que.pb(t,ii(x,y)); if (t != 1) val.pb(x); } sort(all(val)); val.erase(unique(all(val)),val.end()); auto add = [&](Node *R) { if(!R) return; Group G; G.Rt = R; while (R -> l) push(R), R = R -> l; G.x = (R -> key).X; G.y = (R -> key).Y; int p = upper_bound(all(val),G.x) - val.begin(); pq[p].push(G); if (pq[p].top() == G) upd(1,1,sz(val),p); }; fill(tr + 1,tr + 4 * sz(val),1e9 + 7); int tot = 0; for(pii T : Que) { int t = T.X; int x = T.Y.X; int y = T.Y.Y; if (t == 1) { vector<Node*> Path; for(Node* a = p[x] ; a -> par ; Path.pb(a = a -> par)); reverse(all(Path)); for(Node* a : Path) push(a); cout << (p[x] -> key).X << " "; cout << (p[x] -> key).Y << "\n"; continue; } if (t == 4) { add(p[++tot] = new Node(x,y)); continue; } vector<Node*> tmp; while (tr[1] <= y) { int i = 1; int l = 1; int r = sz(val); while (l < r) { int m = (l + r) / 2; if (tr[lch] <= y) i = lch, r = m; else i = rch, l = m + 1; } if (val[l - 1] > x) break; while (pq[l].size()) { if(pq[l].top().y > y) break; Group G = pq[l].top(); pq[l].pop(); Node *a; Node *b; split(G.Rt,a,b,ii(x,y)); add(b); if (a) a -> par = 0; if (b) b -> par = 0; assert(a); tmp.pb(a); } upd(1,1,sz(val),l); } for(Node *a : tmp) { if (t == 2) app(a,x,-1); if (t == 3) app(a,-1,y); } Node *Rt = tmp[0]; tmp.erase( tmp.begin()); for(Node *a : tmp) { vec.clear(); dfs(a); for(Node *x : vec) { Node *y; split(Rt,Rt,y,x -> key); Rt = join(Rt,x); Rt = join(Rt,y); } } add(Rt); } }

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

sweeping.cpp: In lambda function:
sweeping.cpp:186:25: error: no match for 'operator==' (operand types are 'const value_type {aka const Group}' and 'Group')
         if (pq[p].top() == G)
             ~~~~~~~~~~~~^~~~
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:940: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:940:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1013: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:1013:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1093: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:1093:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1173: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:1173:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'Group' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1247: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:1247:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1321: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:1321:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'Group' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1401: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:1401:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
         if (pq[p].top() == G)
                            ^
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 sweeping.cpp:3:
/usr/include/c++/7/bits/regex.h:1920:5: note: candidate: template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const std::__cxx11::match_results<_BiIter, _Alloc>&, const std::__cxx11::match_results<_BiIter, _Alloc>&)
     operator==(const match_results<_Bi_iter, _Alloc>& __m1,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1920:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/iosfwd:40:0,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/bits/postypes.h:216:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::fpos<_StateT>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/stl_pair.h:443:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^~~~~~~~
/usr/include/c++/7/bits/stl_pair.h:443:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::pair<_T1, _T2>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/stl_iterator.h:299:5: note: candidate: template<class _Iterator> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator==(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:299:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::reverse_iterator<_Iterator>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/stl_iterator.h:337:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator==(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:337:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::reverse_iterator<_Iterator>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/stl_iterator.h:1118:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator==(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1118:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::move_iterator<_IteratorL>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/stl_iterator.h:1124:5: note: candidate: template<class _Iterator> bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator==(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1124:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::move_iterator<_IteratorL>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:41:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/allocator.h:146:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_T2>&)
     operator==(const allocator<_T1>&, const allocator<_T2>&)
     ^~~~~~~~
/usr/include/c++/7/bits/allocator.h:146:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::allocator<_CharT>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:41:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/allocator.h:152:5: note: candidate: template<class _Tp> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_CharT>&)
     operator==(const allocator<_Tp>&, const allocator<_Tp>&)
     ^~~~~~~~
/usr/include/c++/7/bits/allocator.h:152:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::allocator<_CharT>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/basic_string.h:5997:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:5997:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/basic_string.h:6005:5: note: candidate: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const std::__cxx11::basic_string<_CharT>&, const std::__cxx11::basic_string<_CharT>&)
     operator==(const basic_string<_CharT>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:6005:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   'const value_type {aka const Group}' is not derived from 'const std::__cxx11::basic_string<_CharT>'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/basic_string.h:6019:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const _CharT* __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/basic_string.h:6019:5: note:   template argument deduction/substitution failed:
sweeping.cpp:186:28: note:   mismatched types 'const _CharT*' and 'Group'
         if (pq[p].top() == G)
                            ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from sweeping.cpp:3:
/usr/include/c++/7/bits/basic_string.h:6031:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator==(const basic_string<_CharT