pipes.cpp: In function 'int main()':
pipes.cpp:47:18: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
47 | if(rand()%2==0 and d1.join(u, v) || d2.join(u, v)) {
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
pipes.cpp:56:40: warning: iteration 70009 invokes undefined behavior [-Waggressive-loop-optimizations]
56 | for(int i = 1;i<=N;i++)d1.e[i]=d2.e[i]=0;
| ~~~~~~~^~
pipes.cpp:56:17: note: within this loop
56 | for(int i = 1;i<=N;i++)d1.e[i]=d2.e[i]=0;
| ~^~~
pipes.cpp:56:40: warning: 'void* __builtin_memset(void*, int, long unsigned int)' forming offset [280040, 280043] is out of the bounds [0, 280040] of object 'd2' with type 'dsu' [-Warray-bounds]
56 | for(int i = 1;i<=N;i++)d1.e[i]=d2.e[i]=0;
| ~~~~~~~^~
pipes.cpp:15:7: note: 'd2' declared here
15 | } d1, d2;
| ^~
pipes.cpp:56:32: warning: 'void* __builtin_memset(void*, int, long unsigned int)' forming offset [280040, 280043] is out of the bounds [0, 280040] of object 'd1' with type 'dsu' [-Warray-bounds]
56 | for(int i = 1;i<=N;i++)d1.e[i]=d2.e[i]=0;
| ~~~~~~~^~~~~~~~~~
pipes.cpp:15:3: note: 'd1' declared here
15 | } d1, d2;
| ^~