I don’t why I am getting TLE on submission of HOLI problem on SPOJ. I have used the dfs approach to solve the problem.
code : https://ide.codingblocks.com/s/225904
thanks in advance.
I don’t why I am getting TLE on submission of HOLI problem on SPOJ. I have used the dfs approach to solve the problem.
code : https://ide.codingblocks.com/s/225904
thanks in advance.
@Yash-Mittal-2335533069896503
You used map for graph and visited
That is not efficient since query and update is logn
Since you already know the max size you need to use static vectors or arrays
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.