ICPC Amritpuri Regional Problem A Analysis

Правка en1, от MathLimitExceeded, 2016-12-25 14:36:50

I was trying to solve problem A from the recently conducted ICPC regional contest.

My approach was to use the following DP transition state — dp(i)(j) denotes the number of ways to assign labels to the subtree rooted at node i such that node i is given the label j.

I came up with the following transition for this state

where is the binomial coefficient, li and ri are the left and right child of i and si denotes the size of the sub-tree rooted at i.

According to me the time complexity of this algorithm is but it seems that this solution gets accepted. Can someone help show me how?

Теги acm, icpc, math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский MathLimitExceeded 2016-12-25 14:38:49 49
en1 Английский MathLimitExceeded 2016-12-25 14:36:50 876 Initial revision (published)