POJ 1659 - Frog's Neighbourhood

Problem : Given the degree of each vertices, construct a correspond graph if it can.
Solution : Every time choose a vertice, connect its remaining degree to the vertices with largest degree. If it success at last, the answer is correct. Otherwise it cannot construct the request graph.
Proof : The proof uses the property of sufix sum. If a vertice connect to the vertices with largest degree, the remaining vertices degree sequence has the smaller sufix sum than any other choice. Thus, if other choice success, we can modify some edges' destination of on the other choice's result graph, to re-make it be the sequence we have in original choice. To see the detail of how and correctness, plz see the not about sufix sum.