0w1

Entries from 2016-03-07 to 1 day

CFR 526 B. Om Nom and Dark Park ( Greedy )

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 …

CFR 526 C. Om Nom and Candies ( Enumeration )

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…