|
|
вернуться в форумHow to be fast? Greetings! I have just solved this problem with DP on a tree via DFS, but it appeared to be much too slow (0.25s), though I expected a better result. There's a tree in this problem, so totally solution must be O(N). May any precial tricks be there or I just did something wrong? Re: How to be fast? You need only 2 DFS. This solution get AC in 0.08s. |
|
|