here are some algorithm templates for acm/icpc.