Codeforces 765F Souvenirs 线段树 + 主席树 (看题解)

NoSuchKey