Problem subgraphs
User CKCodeBreaker55
Submission Time 2025-05-22 12:57:39
Score 0
Max Time N/A
Max Memory N/A

Compile Error

subgraphs.cpp: In function ‘long long int root(long long int, long long int*)’:
subgraphs.cpp:8:44: error: expected primary-expression before ‘]’ token
8 | return parent[x] = root(parent[x], parent[]);
| ^
subgraphs.cpp: In function ‘bool isConnected(long long int, long long int)’:
subgraphs.cpp:12:15: error: too few arguments to function ‘long long int root(long long int, long long int*)’
12 | return root(x) == root(y);
| ^
subgraphs.cpp:5:5: note: declared here
5 | int root(int x, int parent[])
| ^~~~
subgraphs.cpp:12:26: error: too few arguments to function ‘long long int root(long long int, long long int*)’
12 | return root(x) == root(y);
| ^
subgraphs.cpp:5:5: note: declared here
5 | int root(int x, int parent[])
| ^~~~
subgraphs.cpp: In function ‘void connect(long long int, long long int)’:<