Entries from 2016-03-07 to 1 day
Problem - B - Codeforces Since it is always better to put lamps on an edge nearer to the root, rather than putting the same quantity on both brother edges, we will maintain the subtrees along backtracking DFS, such that when considering a …
Problem - C - Codeforces If we can have more than LCM( wr, wb ) candies, not losing generality assuming hr / wr > hb / wb, the optimal solution will take at least many red candies. After processing those, we will have c % lcm( wr, wb ) can…