Skip to content

Commit d0f629c

Browse files
committed
modify code
1 parent 5f5eb82 commit d0f629c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/class183/Code01_CentroidDecomposition1.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class Code01_CentroidDecomposition1 {
3333
public static int[] dis = new int[MAXN];
3434
public static int[] arr = new int[MAXV];
3535
public static int[] que = new int[MAXV];
36-
public static boolean[] judge = new boolean[MAXV];
36+
public static boolean[] pre = new boolean[MAXV];
3737
public static int cnta;
3838
public static int cntq;
3939

@@ -139,25 +139,25 @@ public static void calc(int u) {
139139
getDistance(v, u, w);
140140
for (int k = cnta; k > 0; k--) {
141141
for (int l = 1; l <= m; l++) {
142-
if (query[l] >= arr[k]) {
143-
ans[l] |= judge[query[l] - arr[k]];
142+
if (query[l] - arr[k] >= 0) {
143+
ans[l] |= pre[query[l] - arr[k]];
144144
}
145145
}
146146
}
147147
for (int k = cnta; k > 0; k--) {
148148
que[++cntq] = arr[k];
149-
judge[arr[k]] = true;
149+
pre[arr[k]] = true;
150150
}
151151
}
152152
}
153153
for (int i = cntq; i > 0; i--) {
154-
judge[que[i]] = false;
154+
pre[que[i]] = false;
155155
}
156156
}
157157

158158
public static void solve(int u) {
159159
vis[u] = true;
160-
judge[0] = true;
160+
pre[0] = true;
161161
calc(u);
162162
for (int e = head[u]; e > 0; e = nxt[e]) {
163163
int v = to[e];

src/class183/Code01_CentroidDecomposition2.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//int dis[MAXN];
2929
//int arr[MAXV];
3030
//int que[MAXV];
31-
//bool judge[MAXV];
31+
//bool pre[MAXV];
3232
//int cnta;
3333
//int cntq;
3434
//
@@ -80,25 +80,25 @@
8080
// getDistance(v, u, w);
8181
// for (int k = cnta; k > 0; k--) {
8282
// for (int l = 1; l <= m; l++) {
83-
// if (query[l] >= arr[k]) {
84-
// ans[l] |= judge[query[l] - arr[k]];
83+
// if (query[l] - arr[k] >= 0) {
84+
// ans[l] |= pre[query[l] - arr[k]];
8585
// }
8686
// }
8787
// }
8888
// for (int k = cnta; k > 0; k--) {
8989
// que[++cntq] = arr[k];
90-
// judge[arr[k]] = true;
90+
// pre[arr[k]] = true;
9191
// }
9292
// }
9393
// }
9494
// for (int i = cntq; i > 0; i--) {
95-
// judge[que[i]] = false;
95+
// pre[que[i]] = false;
9696
// }
9797
//}
9898
//
9999
//void solve(int u) {
100100
// vis[u] = true;
101-
// judge[0] = true;
101+
// pre[0] = true;
102102
// calc(u);
103103
// for (int e = head[u]; e > 0; e = nxt[e]) {
104104
// int v = to[e];

0 commit comments

Comments
 (0)