Submission #473597

#TimeUsernameProblemLanguageResultExecution timeMemory
473597NicolaAbusaad2014Split the sequence (APIO14_sequence)C++11
Compilation error
0 ms0 KiB
/** * Prof.Nicola **/ #include <bits/stdc++.h> using namespace std; #define endl "\n" #define mp make_pair #define F first #define S second #define REP(i,l,r) for(long long i=(l);i<(r);i++) #define PER(i,l,r) for(long long i=(r)-1;i>=(l);i--) const long dx[4]={1,0,-1,0},dz[4]={0,1,0,-1}; const long double pi=3.14159265359; const long long mod=1e9+7; long long p(long long x){while(x&(x-1)){x=x&(x-1);}return x;} long long squared(long long x){return (x*x)%mod;} long long power(long long x,long long p){if(p==0){return 1;}if(p%2==1){return (power(x,p-1)*x)%mod;}return squared(power(x,p/2));} long long inv(long long x){return power(x,mod-2);} template<class T>void re(T&x){cin>>x;} template<class T1,class T2> void re(pair<T1,T2>&x){re(x.first);re(x.second);} template<class T>void re(vector<T>&x){for(long i=0;i<x.size();i++){re(x[i]);}} template<class T>void re(deque<T>&x){for(long i=0;i<x.size();i++){re(x[i]);}} template<class T>void out(T x){cout<<x<<" ";} template<class T1,class T2>void out(pair<T1,T2>x){out(x.first);out(x.second);cout<<endl;} template<class T>void out(vector<T>x,long l=0,long r=0){if(!r){r=x.size();}for(long i=l;i<r;i++){out(x[i]);}cout<<endl;} template<class T>void out(deque<T>x,long l=0,long r=0){if(!r){r=x.size();}for(long i=l;i<r;i++){out(x[i]);}cout<<endl;} template<class T>void out(set<T>x){while(!x.empty()){out(*x.begin());x.erase(*x.begin());}cout<<endl;} template<class T1,class T2>void out(map<T1,T2>x){while(!x.empty()){out(*x.begin());x.erase(x.begin()->first);}cout<<endl;} template<class T>void out(queue<T>x){while(!x.empty()){out(x.front());x.pop();}cout<<endl;} template<class T>void out(priority_queue<T>x){while(!x.empty()){out(x.top());x.pop();}cout<<endl;} template<class T>void out(stack<T>x){while(!x.empty()){out(x.top());x.pop();}cout<<endl;} template<class T>T cross(complex<T>x,complex<T>z){return (conj(x)*z).imag();} template<class T>T dot(complex<T>x,complex<T>z){return (conj(x)*z).real();} set<long long>::iterator T; long long vLE(long long x,vector<long long>&VT,long l=0,long r=-1){if(r==-1){r=VT.size()-1;}if(VT[l]>x){return -1;}long long z=p(r-l);while(z){if(l+z<=r&&VT[l+z]<=x){l+=z;}z/=2;}return l;} long long vL(long long x,vector<long long>&VT,long l=0,long r=-1){if(r==-1){r=VT.size()-1;}if(VT[l]>=x){return -1;}long long z=p(r-l);while(z){if(l+z<=r&&VT[l+z]<x){l+=z;}z/=2;}return l;} long long vGE(long long x,vector<long long>&VT,long l=0,long r=-1){if(r==-1){r=VT.size()-1;}if(VT[l]>=x){return l;}l=vL(x,VT,l,r);if(l==r){return -1;}return l+1;} long long vG(long long x,vector<long long>&VT,long l=0,long r=-1){if(r==-1){r=VT.size()-1;}if(VT[l]>x){return l;}l=vLE(x,VT,l,r);if(l==r){return -1;}return l+1;} long long sLE(long long x,set<long long>&ST){if(ST.count(x)){return x;}if(*ST.begin()>x){return -1;}ST.insert(x);T=ST.find(x);T--;ST.erase(x);return *T;} long long sL(long long x,set<long long>&ST){if(*ST.begin()>=x){return -1;}if(ST.count(x)){T=ST.find(x);T--;return *T;}ST.insert(x);T=ST.find(x);T--;ST.erase(x);return *T;} long long sGE(long long x,set<long long>&ST){if(ST.count(x)){return x;}if(*ST.rbegin()<x){return -1;}ST.insert(x);T=ST.find(x);T++;ST.erase(x);return *T;} long long sG(long long x,set<long long>&ST){if(*ST.rbegin()<=x){return -1;}if(ST.count(x)){T=ST.find(x);T++;return *T;}ST.insert(x);T=ST.find(x);T++;ST.erase(x);return *T;} typedef long long ll; struct Line { mutable ll k, m, p ,idx; bool operator<(const Line& o) const { return k < o.k; } bool operator<(ll x) const { return p < x; } }; struct LineContainer : multiset<Line, less<>> { static const ll inf = LLONG_MAX; ll div(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); } bool isect(iterator x, iterator y) { if (y == end()) return x->p = inf, 0; if (x->k == y->k) x->p = x->m > y->m ? inf : -inf; else x->p = div(y->m - x->m, x->k - y->k); return x->p >= y->p; } void add(ll k, ll m, ll idx) { auto z = insert({k, m, 0, idx}), y = z++, x = y; while (isect(y, z)) z = erase(z); if (x != begin() && isect(--x, y)) isect(x, y = erase(y)); while ((y = x) != begin() && (--x)->p >= y->p) isect(x, erase(y)); } pair<ll,int> query(ll x) { assert(!empty()); auto l = *lower_bound(x); return mp(l.k * x + l.m,l.idx); } }; vector<long long>pre; long long f(int l,int r) { if(l==0){ return pre[r]; } return pre[r]-pre[l-1]; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n,k,z,mx=-1,x; cin>>n>>k; vector<long long>v(n); pre.resize(n); re(v); pre[0]=v[0]; REP(i,1,n){ pre[i]=pre[i-1]+v[i]; } v.clear(); vector<LineContainer>sol(k+1); vector<vector<int> >from(n,vector<int>(k+1)); pair<long long,int>p; sol[0].add(0,0,0); REP(i,1,n){ PER(j,1,k+1){ if(j>i){ continue; } p=sol[j-1].query(f(i,n-1)); from[i][j]=p.second; z=p.first+(f(0,i-1)*f(i,n-1)); sol[j].add(-f(0,i-1),z,i); if(j==k){ if(z>mx){ mx=z; x=i; } } } } cout<<mx<<endl; REP(i,0,k){ cout<<x<<" "; x=from[x][k-i]; } return 0; }

Compilation message (stderr)

sequence.cpp:51:47: error: wrong number of template arguments (0, should be 1)
   51 |     struct LineContainer : multiset<Line, less<>> {
      |                                               ^
In file included from /usr/include/c++/10/string:48,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/stl_function.h:381:12: note: provided for 'template<class _Tp> struct std::less'
  381 |     struct less : public binary_function<_Tp, _Tp, bool>
      |            ^~~~
sequence.cpp:51:48: error: template argument 2 is invalid
   51 |     struct LineContainer : multiset<Line, less<>> {
      |                                                ^~
sequence.cpp:55:17: error: 'iterator' is not a type
   55 |      bool isect(iterator x, iterator y) {
      |                 ^~~~~~~~
sequence.cpp:55:29: error: 'iterator' is not a type
   55 |      bool isect(iterator x, iterator y) {
      |                             ^~~~~~~~
sequence.cpp: In member function 'bool LineContainer::isect(int, int)':
sequence.cpp:56:20: error: no matching function for call to 'end()'
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/c++/10/bits/range_access.h:36,
                 from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/initializer_list:101:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
  101 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/10/initializer_list:101:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:71:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
   71 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/10/bits/range_access.h:71:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:81:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
   81 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/10/bits/range_access.h:81:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:100:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
  100 |     end(_Tp (&__arr)[_Nm])
      |     ^~~
/usr/include/c++/10/bits/range_access.h:100:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from sequence.cpp:4:
/usr/include/c++/10/valarray:1234:5: note: candidate: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
 1234 |     end(valarray<_Tp>& __va)
      |     ^~~
/usr/include/c++/10/valarray:1234:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from sequence.cpp:4:
/usr/include/c++/10/valarray:1244:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
 1244 |     end(const valarray<_Tp>& __va)
      |     ^~~
/usr/include/c++/10/valarray:1244:5: note:   template argument deduction/substitution failed:
sequence.cpp:56:20: note:   candidate expects 1 argument, 0 provided
   56 |       if (y == end()) return x->p = inf, 0;
      |                    ^
sequence.cpp:56:31: error: base operand of '->' is not a pointer
   56 |       if (y == end()) return x->p = inf, 0;
      |                               ^~
sequence.cpp:57:12: error: base operand of '->' is not a pointer
   57 |       if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
      |            ^~
sequence.cpp:57:20: error: base operand of '->' is not a pointer
   57 |       if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
      |                    ^~
sequence.cpp:57:26: error: base operand of '->' is not a pointer
   57 |       if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
      |                          ^~
sequence.cpp:57:33: error: base operand of '->' is not a pointer
   57 |       if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
      |                                 ^~
sequence.cpp:57:40: error: base operand of '->' is not a pointer
   57 |       if (x->k == y->k) x->p = x->m > y->m ? inf : -inf;
      |                                        ^~
sequence.cpp:58:13: error: base operand of '->' is not a pointer
   58 |       else x->p = div(y->m - x->m, x->k - y->k);
      |             ^~
sequence.cpp:58:24: error: base operand of '->' is not a pointer
   58 |       else x->p = div(y->m - x->m, x->k - y->k);
      |                        ^~
sequence.cpp:58:31: error: base operand of '->' is not a pointer
   58 |       else x->p = div(y->m - x->m, x->k - y->k);
      |                               ^~
sequence.cpp:58:37: error: base operand of '->' is not a pointer
   58 |       else x->p = div(y->m - x->m, x->k - y->k);
      |                                     ^~
sequence.cpp:58:44: error: base operand of '->' is not a pointer
   58 |       else x->p = div(y->m - x->m, x->k - y->k);
      |                                            ^~
sequence.cpp:59:15: error: base operand of '->' is not a pointer
   59 |       return x->p >= y->p;
      |               ^~
sequence.cpp:59:23: error: base operand of '->' is not a pointer
   59 |       return x->p >= y->p;
      |                       ^~
sequence.cpp: In member function 'void LineContainer::add(ll, ll, ll)':
sequence.cpp:62:16: error: 'insert' was not declared in this scope; did you mean 'isect'?
   62 |       auto z = insert({k, m, 0, idx}), y = z++, x = y;
      |                ^~~~~~
      |                isect
sequence.cpp:63:20: error: 'y' was not declared in this scope
   63 |       while (isect(y, z)) z = erase(z);
      |                    ^
sequence.cpp:63:31: error: 'erase' was not declared in this scope
   63 |       while (isect(y, z)) z = erase(z);
      |                               ^~~~~
sequence.cpp:64:11: error: 'x' was not declared in this scope
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |           ^
sequence.cpp:64:22: error: no matching function for call to 'begin()'
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/c++/10/bits/range_access.h:36,
                 from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/initializer_list:90:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   90 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/10/initializer_list:90:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:51:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   51 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/10/bits/range_access.h:51:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:61:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
   61 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/10/bits/range_access.h:61:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:90:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])'
   90 |     begin(_Tp (&__arr)[_Nm])
      |     ^~~~~
/usr/include/c++/10/bits/range_access.h:90:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from sequence.cpp:4:
/usr/include/c++/10/valarray:1214:5: note: candidate: 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
 1214 |     begin(valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/10/valarray:1214:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from sequence.cpp:4:
/usr/include/c++/10/valarray:1224:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
 1224 |     begin(const valarray<_Tp>& __va)
      |     ^~~~~
/usr/include/c++/10/valarray:1224:5: note:   template argument deduction/substitution failed:
sequence.cpp:64:22: note:   candidate expects 1 argument, 0 provided
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                      ^
sequence.cpp:64:38: error: 'y' was not declared in this scope
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                                      ^
sequence.cpp:64:55: error: 'erase' was not declared in this scope
   64 |       if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
      |                                                       ^~~~~
sequence.cpp:65:15: error: 'y' was not declared in this scope
   65 |       while ((y = x) != begin() && (--x)->p >= y->p)
      |               ^
sequence.cpp:65:19: error: 'x' was not declared in this scope
   65 |       while ((y = x) != begin() && (--x)->p >= y->p)
      |                   ^
sequence.cpp:65:31: error: no matching function for call to 'begin()'
   65 |       while ((y = x) != begin() && (--x)->p >= y->p)
      |                               ^
In file included from /usr/include/c++/10/bits/range_access.h:36,
                 from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/initializer_list:90:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
   90 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/10/initializer_list:90:5: note:   template argument deduction/substitution failed:
sequence.cpp:65:31: note:   candidate expects 1 argument, 0 provided
   65 |       while ((y = x) != begin() && (--x)->p >= y->p)
      |                               ^
In file included from /usr/include/c++/10/string:54,
                 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 sequence.cpp:4:
/usr/include/c++/10/bits/range_access.h:51:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
   51 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/10/bits/range_access.h:51:5: note:   template argument deduction/substitution failed:
sequence.cpp:65:31: note:   candidate expects 1 argument, 0 provided
   65 |       while ((y = x) != begin() && (--x)->p >= y->p)
      |                               ^
In file included from /usr/include/c++/10/s