0_0_25560631_10808.cpp:1:1: error: 'import' does not name a type
import java.util.Scanner;
^
0_0_25560631_10808.cpp:4:8: error: expected unqualified-id before '[' token
int[] nodes;
^
0_0_25560631_10808.cpp:25:1: error: expected ';' after class definition
}
^
0_0_25560631_10808.cpp: In constructor 'TreeSet::TreeSet(int)':
0_0_25560631_10808.cpp:7:9: error: 'nodes' was not declared in this scope
nodes = new int[n + 1];
^
0_0_25560631_10808.cpp: In member function 'void TreeSet::insert(int, int)':
0_0_25560631_10808.cpp:16:23: error: 'nodes' was not declared in this scope
if (fx != fy) nodes[fx] = fy;
^
0_0_25560631_10808.cpp: In member function 'int TreeSet::find(int)':
0_0_25560631_10808.cpp:20:13: error: 'nodes' was not declared in this scope
if (nodes[x] != x) {
^
0_0_25560631_10808.cpp:23:16: error: 'nodes' was not declared in this scope
return nodes[x];
^
0_0_25560631_10808.cpp: At global scope:
0_0_25560631_10808.cpp:27:1: error: expected unqualified-id before 'public'
public class Main {
^
|