fork download
  1. void union(int a, int b) {
  2. a = FindRoot(a); //without new variables
  3. b = FindRoot(b);
  4. if (a == b)
  5. return;
  6. if (rand() % 2)
  7. root[a] = b;
  8. else
  9. root[b] = a;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:11: error: expected identifier before '(' token
 void union(int a, int b) {
           ^
prog.cpp:1:12: error: expected unqualified-id before 'int'
 void union(int a, int b) {
            ^
prog.cpp:1:12: error: expected ')' before 'int'
stdout
Standard output is empty