From f33aca8fca567c9f318bdd120f20765414ecdf0d Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 13 Aug 2024 01:51:19 +0200 Subject: change style --- content/datastructures/persistent.cpp | 2 +- content/graph/virtualTree.cpp | 6 +++--- tcr.pdf | Bin 691136 -> 691284 bytes 3 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 in, out; void virtualTree(vector 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> tree(n); vector st = {0}; for (int i = 1; i < n; i++) { diff --git a/tcr.pdf b/tcr.pdf index 5ebfcb9..b096438 100644 Binary files a/tcr.pdf and b/tcr.pdf differ -- cgit v1.2.3