Some simple algorithms

by PengJiade USTC 2014