Codeforces Round 661 (Div. 3), problem: (E1) Weights Division (easy version)

Question : “https://codeforces.com/contest/1399/problem/E1
My solution : “https://codeforces.com/contest/1399/submission/89107112

I simplify and write clean commented code, I think it will be helpful so I shared here.

Thanks, @galencolin ( after reading your code and dry run on paper, I finally understand where my previous code goes wrong )

@ssrivastava990, during contest i was not able even to approach the problem as i just know the basics of tree and graph, what else to know is required to solve this problem or this kind of similar problems?

practice all u need .
https://codeforces.com/blog/entry/55219
https://codeforces.com/blog/entry/16221

2 Likes

It’s great actually

1 Like

Thanks :slight_smile: