aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2020-08-21 15:15:12 -0500
committerAnthony Wang2020-08-21 15:15:12 -0500
commit0ba24fbd071e3333282837ceeb52e349c8aec183 (patch)
treef915d6bbc703be2205b3633f39c6fadedee139ea
parent038733ca900e6531ba757331bf352d1d2af8b675 (diff)
bitset uses less memory
-rw-r--r--Graph/centroid.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Graph/centroid.cpp b/Graph/centroid.cpp
index 3676d25..32d5a19 100644
--- a/Graph/centroid.cpp
+++ b/Graph/centroid.cpp
@@ -1,5 +1,6 @@
namespace centroid {
- int sz[MN], cpar[MN], vis[MN];
+ int sz[MN], cpar[MN];
+ bitset<MN> vis;
void dfs(vector<int> * G, int u, int p = 0) {
sz[u] = 1;
for (int v : G[u]) if (v != p && !vis[v]) dfs(G, v, u), sz[u] += sz[v];