Need help with GEARS!!!!

closed account (jy6DLyTq)
it will be 0
i have a doubt...
if we set speed of any gear ...then it is for that test case only or for the rest also??
it is for that test case only , until the value of teeth connceted to that node doesn't updated by any other value.
means as the node connected to this teeth has updated it's teeth value then it will affect all of the connected teeth speed, so the speed changes everytime whenever type 2 query gets called.
can u explain how result for last case is 0??
as 123 nodes form a cycle ,so they all gets blocked by one another and hence now if we connect the node 4 to 1 it's speed is also zero because it is written in the question that if the new node is connected to the node which is already blocked then this blocked node will also block the new connected node and so the answer is zero.
@michael
check your pm
@zyan1zyan can u suggest me too please!!
@blackmamba
check your pm
yes u are right..
can someone tell whether an even cycle will be blocked?
can anyone help me with gears problem???
@Kr002 check your pm.
can someone give little to reduce complexity...i am getting tle for second subtask!!
@helpinghand
No, even cycle will never gets blocked , you have to keep track of odd cycle , this is main thing in the Gears problem. whenever you get odd cycle then all their connected nodes gets blocked and the new nodes which are going to connect with these nodes will also gets blocked.
OK.
hey man why r u providing http links they are not safe.
Topic archived. No new replies allowed.