Problem candyboxes
User thisusernameistaken
Submission Time 2024-01-23 21:00:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

candyboxes.cpp: In function ‘void unite(long long int, long long int)’:
candyboxes.cpp:22:2: error: ‘sz’ was not declared in this scope
22 | sz[x]+=sz[y];
| ^~
candyboxes.cpp:23:2: error: ‘sum’ was not declared in this scope
23 | sum[x]+=sum[y];
| ^~~
candyboxes.cpp: In function ‘void rollback(long long int, long long int)’:
candyboxes.cpp:30:2: error: ‘sz’ was not declared in this scope
30 | sz[tx]--; sz[y]++;
| ^~
candyboxes.cpp:31:2: error: ‘sum’ was not declared in this scope
31 | sum[tx]-=x; sum[y]+=x;
| ^~~
candyboxes.cpp: In function ‘int main()’:
candyboxes.cpp:40:3: error: ‘sz’ was not declared in this scope
40 | sz[j]=1;
| ^~
candyboxes.cpp:41:3: error: ‘sum’ was not declared in this scope
41 | sum[j]=i;
| ^~~
candyboxes.cpp:59:10: error: ‘sz’ was not declared in this scope
59 | cout<<sz[find(x)]<<' '<<sum[find(x)]<