Why is my code giving Runtime Error?

Revision en1, by arnav2004, 2022-01-20 23:24:49

I was solving this problem Problem Link

Here is my code

Now I don't want to know the logic of how to solve the problem or whether my logic is wrong or not.

It's just that when I am compiling this code is giving RE (Specifically : Runtime error: exit code is 2147483647)

Now when I comment out the line in which I unite two sets (Mentioned in the code), it does not give RE.

But I don't know how can my unite function be wrong(It's just merging two sets [DSU]).

Can anyone tell me the flaw?

Thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English arnav2004 2022-01-21 10:35:08 147
en1 English arnav2004 2022-01-20 23:24:49 2445 Initial revision (published)