Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×
problemset/problem/543/D
Разница между en1 и en2, 6 символ(ов) изменены
http://codeforces.me/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 [submission: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.

История

 
 
 
 
Правки
 
 
  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)