Dominant Path Queries

Revision en1, by ExtraStageLover, 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.

History

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