当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7062:A Simple Problem

题目描述
You have a sequence $A$ of length $n$ and a positive integer $k$. Initially, all elements in $A$ are set to $0$.
Now there are $q$ operations, these operations can be divided into two types.
$1$ $l$ $r$ $x$ $: \forall i \in [l,r] A_i = A_i + x$
$2$ $l$ $r$ $:$ Find $\min\limits_{i=l}^{r-k+1} ( \max\limits_{j=i}^{i+k-1} A_j )$ $(r-l+1 \geq k)$
输入解释
The first line contains an integer $T (T \leq 5)$, denoting the number of test cases.
Each test case contains $q + 2$ lines
The first line contains three integer $n, k(2 \leq k \le n \leq 5 \times 10^8)$ and $q(1 \leq q \leq 10^5)$.
The next $q$ lines describe operations of two types:
$1$ $l$ $r$ $x$ $: \forall i \in [l,r] A_i = A_i + x$ $(|x| \leq 10^4)$
$2$ $l$ $r$ $:$ Find $\min\limits_{i=l}^{r-k+1} ( \max\limits_{j=i}^{i+k-1} A_j )$ $(r-l+1 \geq k)$
It is guaranteed that the sum of $q$ won't exceed $2 \times 10^5$.
输出解释
For each operation of type $2$, output the answer in a single line.
输入样例
2
5 3 3
1 2 5 2
1 3 4 -1
2 1 4
10 4 10
1 1 6 6
1 3 8 -6
2 2 6
1 4 8 -8
1 4 9 4
1 4 5 -7
2 4 8
1 6 7 8
1 1 3 -2
2 3 7
输出样例
2
0
-4
4

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7062

最后修改于 2021-10-23T19:11:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 524288/524288K(Java/Others)