This problem is in Contest(s) below:
Contest 1183:小朋友来玩线段树
Contest 1290:Treap,FHQ Treap,Splay,线段树标记永久化
Contest 1271:历年HNOI