diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2024-08-13 01:51:19 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2024-08-13 01:51:32 +0200 |
| commit | f33aca8fca567c9f318bdd120f20765414ecdf0d (patch) | |
| tree | 2ff7a9961644f01849c0ac94f5c04aac181623dd /content | |
| parent | af07c941cb58bb73cffc12161e9f263819575e82 (diff) | |
change style
Diffstat (limited to 'content')
| -rw-r--r-- | content/datastructures/persistent.cpp | 2 | ||||
| -rw-r--r-- | content/graph/virtualTree.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/content/datastructures/persistent.cpp b/content/datastructures/persistent.cpp index 7d15342..f26680d 100644 --- a/content/datastructures/persistent.cpp +++ b/content/datastructures/persistent.cpp @@ -7,7 +7,7 @@ struct persistent { : time(time), data(1, {2*time, value}) {}
T get(int t) {
- return prev(upper_bound(all(data), pair{2*t+1, T{}}))->second;
+ return prev(upper_bound(all(data),pair{2*t+1, T{}}))->second;
}
int set(T value) {
diff --git a/content/graph/virtualTree.cpp b/content/graph/virtualTree.cpp index 27d2d6c..6233b27 100644 --- a/content/graph/virtualTree.cpp +++ b/content/graph/virtualTree.cpp @@ -3,13 +3,13 @@ vector<int> in, out; void virtualTree(vector<int> ind) { // indices of used nodes sort(all(ind), [&](int x, int y) {return in[x] < in[y];}); - for (int i = 0, n = sz(ind); i < n - 1; i++) { - ind.push_back(lca(ind[i], ind[i + 1])); + for (int i = 1, n = sz(ind); i < n; i++) { + ind.push_back(lca(ind[i - 1], ind[i])); } sort(all(ind), [&](int x, int y) {return in[x] < in[y];}); ind.erase(unique(all(ind)), ind.end()); - int n = ind.size(); + int n = sz(ind); vector<vector<int>> tree(n); vector<int> st = {0}; for (int i = 1; i < n; i++) { |
