0_0_30494882_4543\Main.java:1: 错误: 需要';'
import java.util.Scanner
^
0_0_30494882_4543\Main.java:2: 错误: 需要class, interface或enum
public Class UnionFindm {
^
0_0_30494882_4543\Main.java:4: 错误: 需要class, interface或enum
private int[] weight;
^
0_0_30494882_4543\Main.java:5: 错误: 需要class, interface或enum
private int size;
^
0_0_30494882_4543\Main.java:6: 错误: 需要class, interface或enum
private int nums;
^
0_0_30494882_4543\Main.java:7: 错误: 需要class, interface或enum
public UnionFindm(int size)
^
0_0_30494882_4543\Main.java:10: 错误: 需要class, interface或enum
this.nums = size;
^
0_0_30494882_4543\Main.java:11: 错误: 需要class, interface或enum
this.parent = new int[size];
^
0_0_30494882_4543\Main.java:12: 错误: 需要class, interface或enum
this.weight = new int[size];
^
0_0_30494882_4543\Main.java:13: 错误: 需要class, interface或enum
for(int i=0; i<size; i++)
^
0_0_30494882_4543\Main.java:13: 错误: 需要class, interface或enum
for(int i=0; i<size; i++)
^
0_0_30494882_4543\Main.java:13: 错误: 需要class, interface或enum
for(int i=0; i<size; i++)
^
0_0_30494882_4543\Main.java:16: 错误: 需要class, interface或enum
weight[i] = 1;
^
0_0_30494882_4543\Main.java:17: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:20: 错误: 需要class, interface或enum
public int find(int index)
^
0_0_30494882_4543\Main.java:25: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:27: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:29: 错误: 需要class, interface或enum
public void unionElement(int a, int b)
^
0_0_30494882_4543\Main.java:32: 错误: 需要class, interface或enum
int rE = find(b);
^
0_0_30494882_4543\Main.java:33: 错误: 需要class, interface或enum
if(lE == rE)
^
0_0_30494882_4543\Main.java:36: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:40: 错误: 需要class, interface或enum
weight[lE] +=weight[rE];
^
0_0_30494882_4543\Main.java:41: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:45: 错误: 需要class, interface或enum
weight[rE] +=weight[lE];
^
0_0_30494882_4543\Main.java:46: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:48: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:49: 错误: 需要class, interface或enum
public int getNums()
^
0_0_30494882_4543\Main.java:52: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:53: 错误: 需要class, interface或enum
public static void main(String []args) {
^
0_0_30494882_4543\Main.java:55: 错误: 需要class, interface或enum
int size = s.nextInt();
^
0_0_30494882_4543\Main.java:56: 错误: 需要class, interface或enum
UnionFindm uf = new UnionFindm(size);
^
0_0_30494882_4543\Main.java:57: 错误: 需要class, interface或enum
int r_nums = s.nextInt();
^
0_0_30494882_4543\Main.java:58: 错误: 需要class, interface或enum
for(int i = 0; i<uf.nums; i++)
^
0_0_30494882_4543\Main.java:58: 错误: 需要class, interface或enum
for(int i = 0; i<uf.nums; i++)
^
0_0_30494882_4543\Main.java:58: 错误: 需要class, interface或enum
for(int i = 0; i<uf.nums; i++)
^
0_0_30494882_4543\Main.java:61: 错误: 需要class, interface或enum
int second = s.nextInt()-1;
^
0_0_30494882_4543\Main.java:62: 错误: 需要class, interface或enum
uf.unionElement(first, second);
^
0_0_30494882_4543\Main.java:63: 错误: 需要class, interface或enum
}
^
0_0_30494882_4543\Main.java:65: 错误: 需要class, interface或enum
}
^
39 个错误
|