Hello all,
I'm solving Problem using dfs and dp.
Here is the accepted solution https://cses.fi/paste/0ce952848211df07881291/ logic above is to store u->v to store the child who gives best result
Here is the incorrect solution https://cses.fi/paste/7036dbe274524616881807/ logic above is to store u->v to store parent and backtrack to parent
since the test cases are long i can't debug the code myself.
the code start from line 381.
Please anyone can help me why it is giving wrong output.