Dominant Path Queries

Revision en1, by Epilogue, 2023-10-03 19:52:51

Hi!. I'm solving a problem. Given a tree with N nodes with colors and q queries. For each query given two integers (u, v), answer if the path(u, v) on the tree is dominant. A path is called dominant when the most frequently occuring element appears strictly more than pathlength / 2.

Are there any offline, online solutions for this? If you have any ideas please comment bellow.


  Rev. Lang. By When Δ Comment
en1 English Epilogue 2023-10-03 19:52:51 404 Initial revision (published)