0w1

Entries from 2016-03-03 to 1 day

CFR Educational 2 E. Lomsat gelral ( Smaller to Larger or Time stamp + Mo's Algorithm )

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( (…

IOI'94 The Buses ( A* + Heuristic by clock )

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…

CFR Educational 1 E. Chocolate Bar ( DP )

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>…