problemset/problem/543/D

Правка en1, от I_love_Captain_America, 2015-06-20 14:49:18

http://mirror.codeforces.com/problemset/problem/543/D

I did not understand the editorial so I wrote a solution of my own. But I don't understand the tricky cases where it fails. Here is my submission ID 11679268 . My logic is simple: 1. Do DFS with "1" as root , store results in dp[i] 2. result[1]=dp[1] 3. result[i]=(1 + result[parent_of_i]/(dp[i]+1)) * dp[i] % mod;

Where is the logic wrong? I couldn't figure it out.

Теги problem

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский I_love_Captain_America 2015-06-20 14:51:33 6
en1 Английский I_love_Captain_America 2015-06-20 14:49:18 461 Initial revision (published)