can anyone help me by telling why my code https://ideone.com/4Y97gD for gss1 is giving tle.
just made a few optimistations,using shift operators for multiplication,division and fast io.
Your solution: https://ide.geeksforgeeks.org/p33MepdgpI
I dont think so,as ur logic is absolutely right.Even if u remove shift operators it’ll still get accepted.Majority of time is consumed due to I/O.U could try coding the iterative version.
when i removed shift operators i got tle.
U could remove the fast io,it’ll still get accepted (just use ‘\n’ instead of endl)
thanks didn’t knew that endl could make program that slow.