diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2024-08-04 15:58:47 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2024-08-04 15:58:47 +0200 |
| commit | 1ad495344f764e979e93f394f76716cf527c2940 (patch) | |
| tree | d5810ece067e94123fd0ffa5659e752755da2616 /content/datastructures/lichao.cpp | |
| parent | e46ead1681b24c75624c33f167c530e633e40440 (diff) | |
more tests
Diffstat (limited to 'content/datastructures/lichao.cpp')
| -rw-r--r-- | content/datastructures/lichao.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/content/datastructures/lichao.cpp b/content/datastructures/lichao.cpp index f66778e..646ad68 100644 --- a/content/datastructures/lichao.cpp +++ b/content/datastructures/lichao.cpp @@ -11,10 +11,10 @@ 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(sz(xs)), cap(2 << __lg(n)), seg(2 * cap, id) {} void _insert(Fun f, int l, int r, int i) { - while (i < 2*cap){ + while (i < 2 * cap) { int m = (l+r)/2; if (m >= n) {r = m; i = 2*i; continue;} Fun &g = seg[i]; @@ -26,7 +26,7 @@ struct Lichao { void _segmentInsert(Fun f, int l, int r, int a, int b, int i) { if (l <= a && b <= r) _insert(f, a, b, i); - else if (a < r && l < b){ + else if (a < r && l < b) { int m = (a+b)/2; _segmentInsert(f, l, r, a, m, 2*i); _segmentInsert(f, l, r, m, b, 2*i+1); |
