I have applied union by rank to find cycle in the graph and bfs to find the length of it.....but it gives TLE for 2nd subtask beacause everytime I need to apply bfs to find the length of node between two node for plus or minus....how should I do for 100 points
Hey,all I am getting difficulty in 2 subtask just got 20 points.
Submission Info:
Sub-Task Task # Result
(time)
1 0 AC
(0.000000)
1 1 AC
(0.000000)
1 2 AC
(0.000000)
1 3 AC
(0.000000)
Can someone help what to do when approaches to 3*10^5;
Any help would be appreciated.:)
Lol i was about to tell albertimmy MNMX for EQUILIBR but I got 100 AC in equilibr before we exchanged more messages...good for me :P
PS anyone looking for equilibr...its a very simple solution...dont overthink it...it took me 2 days of constant fight mathematics to realize that its so direct...so dont overt think it