Can anybody explain what is the runtime of Union/Find approach. I used union by size approach.
Plz help me out in thisā¦i thought a lot on this problem and finally did itā¦though i got a WA i canāt figure out what was wrong with my codeā¦i wrote a c program which can be seen at
http://www.codechef.com/viewsolution/1900728
please suggest me in whatcase my code giving wrong answerā¦http://www.codechef.com/viewsolution/1976048
y *= size[i];
Here the value of y can cross the limit of int and hence wrong answer. Make y long long int and you should be fine.
Thank you so much!
url:- http://www.codechef.com/viewsolution/1930307
I m getting WA cna someone help in finding a test case where my code fails??
thank u in advanceā¦
can any one tell me whats wrong with this codeā¦
its running on my pc but giving compilation error
http://ww2.codechef.com/viewsolution/2076377
Please help . Getting Wrong answers for even test case!!!
link to my code -> http://ideone.com/lU40Sl
well sorry for reviving such an old topic but there seems to be an error with my implementation,i dont know why i am getting a TLE here is my submission http://www.codechef.com/viewsolution/2779075 i have used a dfs and a linked list approach could anyone illuminate my mistake.
I m getting SIGSEGV but i dont know why i am getting thisā¦
intializing like this mark=vector(n,0) i am getting correct answerā¦
but when i try to do vector mart(n,0) i am getting SIGSEGVā¦
what is wrong with thisā¦plz answer meā¦
http://www.codechef.com/viewsolution/4372844
Please star my projects and contribute if you are interested.
Can someone please point out the mistake in this code?
Code-(https://www.codechef.com/viewsolution/15077459)
Thanks
such a nice problem, thank you codechef.
Used union find but kept getting TLE. Code:https://ideone.com/gDZvZc
Would be really helpful if someone could point out the mistake in this.
very good question ā¦