Entries from 2016-03-03 to 1 day
Problem - E - Codeforces The official solution is to simply merge subtrees from the leaves to the root. Using the smaller to larger strategy, where we always merge the smaller subtree towards the larger, the overall time complexity is O( (…
PEG Judge - IOI '94 - The Buses First we can describe a route by defining its first time of arrival and its interval. After preprocessing all the possible routes, we should perform a brute force search with some heuristic functions to prun…
Problem - E - Codeforces dp[ i ][ j ][ k ]: Having an i * j chocolate bar, the minimum cost required to take a piece of area k which we enumerate all the possible cut lines and make decisions whether taking it or not #include <bits/stdc++.h> using namesp</bits/stdc++.h>…