I'm trying to solve it using BIT (each index is a color) and dfs, the output for node 1 is correct with me I'm trying to do rerooting technique on the tree to get the answer for the rest of nodes.
any idea ?
help on "Distinct Colors" CSES problem
I'm trying to solve it using BIT (each index is a color) and dfs, the output for node 1 is correct with me I'm trying to do rerooting technique on the tree to get the answer for the rest of nodes.
any idea ?
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en1 | It_Wasnt_Me | 2020-07-14 22:56:08 | 304 | Initial revision (published) |