[HELP] Tree problem

Правка en1, от baddestguy, 2020-06-25 14:48:47

Given a tree with n nodes and n-1 edges, each edge has an integer value that maps to a character from A to Z. For each shortest paths between nodes determine if the sequence of characters of edges encountered can be rearranged to to be palindrome. We are required to count the number of pairs of nodes such that their shortest path can be rearranged to palindrome. (1<=n<=10^5) and tree diameter is less than 1000. Any ideas given those constraints?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский baddestguy 2020-06-25 14:48:47 470 Initial revision (published)