Skip to content

Commit e591c66

Browse files
committed
update complexity
1 parent 5e7bd34 commit e591c66

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

library/trees/edge_centroid_decomp_uncommon/contour_range_query.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include "../../data_structures/bit.hpp"
3-
#include "sum_adjacent.hpp"
43
#include "../edge_cd.hpp"
4+
#include "sum_adjacent.hpp"
55
//! https://judge.yosupo.jp/problem/vertex_add_range_contour_sum_on_tree
66
struct contour_range_query {
77
int n;
@@ -10,8 +10,8 @@ struct contour_range_query {
1010
vector<array<BIT, 2>> bits;
1111
//! @param adj unrooted, undirected tree
1212
//! @param a a[v] = initial number for node v
13-
//! @time O(n log1.5 n)
14-
//! @space O(n log1.5 n) for `info` and `bits`
13+
//! @time O(n logφ n)
14+
//! @space O(n logφ n) for `info` and `bits`
1515
contour_range_query(const vector<vi>& adj,
1616
const vector<ll>& a):
1717
n(sz(a)), sum_a(adj, a), info(n) {
@@ -34,7 +34,7 @@ struct contour_range_query {
3434
}
3535
//! @param v node
3636
//! @param delta number to add to node v's number
37-
//! @time O(log1.5(n) * log2(n))
37+
//! @time O(logφ(n) * log2(n))
3838
//! @space O(1)
3939
void update(int v, ll delta) {
4040
sum_a.update(v, delta);
@@ -46,7 +46,7 @@ struct contour_range_query {
4646
//! @returns sum of node u's number over all u such that
4747
//! l
4848
//! <= dist_edges(u, v) < r
49-
//! @time O(log1.5(n) * log2(n))
49+
//! @time O(logφ(n) * log2(n))
5050
//! @space O(1)
5151
ll query(int v, int l, int r) {
5252
ll sum = 0;

library/trees/edge_centroid_decomp_uncommon/contour_range_update.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include "../../data_structures/bit_uncommon/rupq.hpp"
3-
#include "sum_adjacent.hpp"
43
#include "../edge_cd.hpp"
4+
#include "sum_adjacent.hpp"
55
//! https://judge.yosupo.jp/problem/vertex_get_range_contour_add_on_tree
66
struct contour_range_update {
77
int n;
@@ -11,8 +11,8 @@ struct contour_range_update {
1111
vector<array<bit_rupq, 2>> bits;
1212
//! @param adj unrooted, undirected tree
1313
//! @param a a[v] = initial number for node v
14-
//! @time O(n log1.5 n)
15-
//! @space O(n log1.5 n) for `info` and `bits`
14+
//! @time O(n logφ n)
15+
//! @space O(n logφ n) for `info` and `bits`
1616
contour_range_update(const vector<vi>& adj,
1717
const vector<ll>& a):
1818
n(sz(a)), a(a), sum_a(adj, vector<ll>(n)), info(n) {
@@ -34,7 +34,7 @@ struct contour_range_update {
3434
}
3535
//! @param v,l,r,delta add delta to all nodes u such
3636
//! that l <= dist_edges(v, u) < r
37-
//! @time O(log1.5(n) * log2(n))
37+
//! @time O(logφ(n) * log2(n))
3838
//! @space O(1)
3939
void update(int v, int l, int r, ll delta) {
4040
if (l <= 0 && 0 < r) a[v] += delta;
@@ -48,7 +48,7 @@ struct contour_range_update {
4848
}
4949
//! @param v node
5050
//! @returns number of node v
51-
//! @time O(log1.5(n) * log2(n))
51+
//! @time O(logφ(n) * log2(n))
5252
//! @space O(1)
5353
ll query(int v) {
5454
ll sum = a[v] + sum_a.query(v);

library/trees/edge_centroid_decomp_uncommon/count_paths_per_length.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! @param adj unrooted, connected tree
55
//! @returns array `num_paths` where `num_paths[i]` = # of
66
//! paths in tree with `i` edges. `num_paths[1]` = # edges
7-
//! @time O(n * log1.5(n) * log2(n))
7+
//! @time O(n * logφ(n) * log2(n))
88
//! @space this function allocates/returns various vectors
99
//! which are each O(n)
1010
vector<ll> count_paths_per_length(const vector<vi>& adj) {

0 commit comments

Comments
 (0)