Codeforces 650D. Zip-line (动态LIS) (可持久化线段树 或 离线+树状数组)

NoSuchKey