F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2025-01-10 18:04:09, Gzip enabled