I am trying to solve this problem but i am getting wa in test no 5 please someone can help me through this… can someone please spot out where i am making mistake …
i have provided proper explanation in my code …link is below
Thanks in Advane
I am trying to solve this problem but i am getting wa in test no 5 please someone can help me through this… can someone please spot out where i am making mistake …
i have provided proper explanation in my code …link is below
Thanks in Advane
the problem is you are sorting (because of set)after doing mod of the factors and also the no of nodes
thanks to both of you i realised my fault … and i hope i will not repeat that stupid mistake …
Thanks for giving your precious time and saving my day…
first of all take all things in long long
compute carefully modular multiplication , and modular add .
more refer_my_solution