HDU 1561 - The more, The Better
Problem : There are n values. Pick m values of them. To pick some value should pick previous value of it. Find the maximum total value of m chosen values.
Solution : Connect an edge from pre-request(i) to i. Thus each vertice has only in-degree. Thus all the vertices which 0 can reach is the values can be chosen, and they forms a tree. Other values always cannot be picked (they forms a circle, all the ancestor pre-request forms a circle). Thus it becomes a custom tree DP.