Black Rock Shooter
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
在人气动漫 Black Rock shooter 中,当加贺里对麻陶 说出了“滚回去“以后,与此同时,在另一个心灵世界里, BRS 也遭到了敌人的攻击。此时,一共有 个攻击排成一行 朝着她飞了过来,每个攻击有一个伤害值。并且每个攻击伤 害可能随时变化。BRS 的攻击可以打掉一段连续的攻击。现 在,给出 段攻击,求出 BRS 最多可以打掉此段里多少的 伤害(就是说从给定一段里选择连续一段打掉)。伤害从 到 编号。

Input Format
第一行 个整数:
第二行 个数:第 个数代表第 个攻击
第 到 行:每行三个数 。
若 代表查询的区间。
若 ,代表第 个攻击伤害改为了 所有的伤害值绝对值
Output Format
对于每次 ,输出一个整数代表最大值
5 3
1 2 -3 4 5
1 2 3
2 2 -1
1 2 3
2
-1
Hint
对于 的数据:
集训队选拔测验(搁置)
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 10
- Start at
- 2022-6-5 23:00
- End at
- 2022-6-23 23:30
- Duration
- 432.5 hour(s)
- Host
- Partic.
- 6