Hello Codeforces, I've been trying to learn how to run a DP with the convexhull optimization and I have seen this code for a line container (KTH pdf):
struct Line {
mutable long long k, m, p;
bool operator<(const Line& o) const {
return Q ? p < o.p : k < o.k;
}
};
struct LineContainer : multiset<Line> {..}
So depending in the value of Q the comparator function will do different things, how does multiset cope with this? and how does it affect the complexity of this container?
Thank you very much for the help!