Https://ide.codingblocks.com/s/188702 only one test case passing Regious Peopleli
Please send link of the question
There are two mistakes in your code:
- use long long int datatype for large values.
- there may be some vertices which are not connected to any of the other vertices. So, we will build temple there.
I have made corrections in your code:https://ide.codingblocks.com/s/188834
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.