The useful algorithms for competitive programming