/in/foo.cc:18:11: error: expected identifier before '(' token
void union(int x, int y){
^
/in/foo.cc:18:12: error: expected unqualified-id before 'int'
void union(int x, int y){
^~~
/in/foo.cc:18:12: error: expected ')' before 'int'
/in/foo.cc: In function 'bool check(int)':
/in/foo.cc:28:26: error: 'n' was not declared in this scope
for(int u = x + 1; u <= n; ++u){
^
/in/foo.cc:32:4: error: expected primary-expression before 'union'
union(u,v);
^~~~~
/in/foo.cc:36:26: error: 'n' was not declared in this scope
for(int i = x + 1; i <= n; ++i){
^
/in/foo.cc:39:15: error: 'n' was not declared in this scope
return ans < n/2;
^