Codeforces Round #429 (Div. 1) D. Destiny #主席树#

NoSuchKey