summaryrefslogtreecommitdiff
path: root/content/datastructures/lichao.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /content/datastructures/lichao.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'content/datastructures/lichao.cpp')
-rw-r--r--content/datastructures/lichao.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/datastructures/lichao.cpp b/content/datastructures/lichao.cpp
index c20c61d..bdbf5f9 100644
--- a/content/datastructures/lichao.cpp
+++ b/content/datastructures/lichao.cpp
@@ -1,5 +1,6 @@
vector<ll> xs; // IMPORTANT: Initialize before constructing!
-int findX(int i) { return lower_bound(all(xs), i) - begin(xs); }
+int findX(int i) {
+ return ranges::lower_bound(xs, i) - begin(xs); }
struct Fun { // Default: Linear function. Change as needed.
ll m, c;
@@ -11,7 +12,7 @@ struct Lichao {
static constexpr Fun id = {0, INF}; // {0, -INF}
int n, cap;
vector<Fun> seg;
- Lichao() : n(sz(xs)), cap(2 << __lg(n)), seg(2 * cap, id) {}
+ Lichao() : n(ssize(xs)), cap(2 << __lg(n)), seg(2 * cap, id) {}
void _insert(Fun f, int l, int r, int i) {
while (i < 2 * cap) {