From 1880ccb6d85c6eb79e724593457877bab431951c Mon Sep 17 00:00:00 2001 From: Gloria Mundi Date: Sat, 16 Nov 2024 21:17:29 +0100 Subject: get rid of all() and sz() --- content/datastructures/monotonicConvexHull.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'content/datastructures/monotonicConvexHull.cpp') diff --git a/content/datastructures/monotonicConvexHull.cpp b/content/datastructures/monotonicConvexHull.cpp index 2bdeccf..295acc4 100644 --- a/content/datastructures/monotonicConvexHull.cpp +++ b/content/datastructures/monotonicConvexHull.cpp @@ -12,15 +12,14 @@ struct Envelope { } void add(ll m, ll b) { - while (sz(ls) > 1 && bad(ls.end()[-2], ls.back(), {m, b})) { - ls.pop_back(); - } + while (ssize(ls) > 1 + && bad(ls.end()[-2], ls.back(), {m,b})) ls.pop_back(); ls.push_back({m, b}); - ptr = min(ptr, (int)sz(ls) - 1); + ptr = min(ptr, (int)ssize(ls) - 1); } ll query(ll x) { - while (ptr < sz(ls)-1 && ls[ptr + 1](x) < ls[ptr](x)) ptr++; + while (ptr < ssize(ls)-1 && ls[ptr+1](x) < ls[ptr](x)) ptr++; return ls[ptr](x); } }; -- cgit v1.2.3