Skip to content

Commit ea7b882

Browse files
committed
modify code
1 parent 176ad1d commit ea7b882

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/class174/Code05_Lcm1.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ public static boolean check(int x, int y, int a, int b) {
117117
}
118118

119119
public static void compute(int l, int r) {
120-
// 重建并查集,目前没有任何连通性
121-
build();
122120
// 重要剪枝
123121
// 保证每条查询只在一个边的序列块中处理
124122
cursiz = 0;
@@ -128,6 +126,8 @@ public static void compute(int l, int r) {
128126
}
129127
}
130128
if (cursiz > 0) {
129+
// 重建并查集,目前没有任何连通性
130+
build();
131131
// 本题直接排序能通过,就不写归并了
132132
sort(edge, eb, 1, l - 1);
133133
for (int i = 1, j = 1; i <= cursiz; i++) {

src/class174/Code05_Lcm2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@
9898
//}
9999
//
100100
//void compute(int l, int r) {
101-
// build();
102101
// cursiz = 0;
103102
// for (int i = 1; i <= q; i++) {
104103
// if (ea[edge[l]] <= qa[query[i]] && (r + 1 > m || qa[query[i]] < ea[edge[r + 1]])) {
105104
// cur[++cursiz] = query[i];
106105
// }
107106
// }
108107
// if (cursiz > 0) {
108+
// build();
109109
// sort(edge + 1, edge + l, [&](int x, int y) { return eb[x] < eb[y]; });
110110
// for (int i = 1, j = 1; i <= cursiz; i++) {
111111
// while (j < l && eb[edge[j]] <= qb[cur[i]]) {

0 commit comments

Comments
 (0)