[HDU4348/SPOJ TTM]To the moon(主席树)

发布于 2018-04-04  6 次阅读


本文章由SYCstudio或本站其它作者所有,严禁转载,转载必究

本文链接地址:[HDU4348/SPOJ TTM]To the moon(主席树)

Description

To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker.

River && Anya .. .

The premise of To The Moon is based around a technology that allows us to permanently reconstruct the memory on dying man. In this problem, we'll give you a chance, to implement the logic behind the scene.
Description

You‘ve been given N integers A[1], A[2],..., A[N]. On these integers, you need to implement the following operations:

.. N, M ≤ 10^5, |A[i]| ≤ 10^9, 1 ≤ l ≤ r ≤ N, |d| ≤ 10^4 .. the system start from time 0, and the first modification is in time 1, t ≥ 0, and won't introduce you to a future state.

Tag

主席树

解决思路

根据题目的要求,分别用主席树维护各个时间戳的数列,当要回溯的时候回到对应的时间。

代码

本文章由SYCstudio或本站其它作者所有,严禁转载,转载必究

本文链接地址:[HDU4348/SPOJ TTM]To the moon(主席树)


HNCJ OIer 一枚