the common algorithms for online contests.