BOI7SOU - Sound

题意翻译

求一个序列中,长度为 $m$ 的区间最大值减最小值 $\le c$ 的区间个数。 **【输入格式】** 第一行三个整数 $n, m, c$,分别表示序列的长度,区间的长度和题目描述中的 $c$。 第二行 $n$ 个整数 $a_i$,为题目中的序列。 **【输出格式】** 输出共 $m$ 行,每行表示一段静音的起始位置,按照出现的先后顺序输出。如果没有输出 `NONE`。 **【说明/提示】** 对于 $100\%$ 的数据,保证: $$1 \le n \le 1000000$$ $$1 \le m \le 10000$$ $$0 \le c \le 10000$$ $$0 \le a_i \le 1000000$$ $$(\max{a_i, \cdots , a_i + m - 1}) - (\min{a_i, \cdots , a_i + m - 1}) \le c$$

题目描述

In digital recording, sound is described by a sequence of numbers representing the air pressure, measured at a rapid rate with a fixed time interval between successive measurements. Each value in the sequence is called a sample. An important step in many voice-processing tasks is breaking the recorded sound into chunks of non-silence separated by silence. To avoid accidentally breaking the recording into too few or too many pieces, the silence is often defined as a sequence of m samples where the difference between the lowest and the highest value does not exceed a certain treshold c. Write a program to detect silence in a given recording of n samples according to the given parameter values m and c.

输入输出格式

输入格式


The first line of the file contains three integers: n (1

输出格式


The file should list all values of i such that max(a\[i . . . i + m − 1\]) − min(a\[i . . . i + m − 1\])

输入输出样例

输入样例 #1

7 2 0
0 1 1 2 3 2 2

输出样例 #1

2
6