302226: CF427B. Prison Transfer

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Prison Transfer

题意翻译

一个监狱里有很多囚犯。市长决定将 $c$ 名囚犯转移到其它监狱。 监狱里有 $n$ 名囚犯,为了方便统计,市长让他们站在一条线上,每个囚犯都有一个“犯罪值”。数值越大,他的犯罪就越严重。 选定的 $c$ 个囚犯必须是一个连续的部分。任何选定的囚犯犯罪值不可高于 $t$。求可以选择 $c$ 名囚犯方式的数量。

题目描述

The prison of your city has $ n $ prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer $ c $ of the prisoners to a prison located in another city. For this reason, he made the $ n $ prisoners to stand in a line, with a number written on their chests. The number is the severity of the crime he/she has committed. The greater the number, the more severe his/her crime was. Then, the mayor told you to choose the $ c $ prisoners, who will be transferred to the other prison. He also imposed two conditions. They are, - The chosen $ c $ prisoners has to form a contiguous segment of prisoners. - Any of the chosen prisoner's crime level should not be greater then $ t $ . Because, that will make the prisoner a severe criminal and the mayor doesn't want to take the risk of his running away during the transfer. Find the number of ways you can choose the $ c $ prisoners.

输入输出格式

输入格式


The first line of input will contain three space separated integers $ n (1<=n<=2·10^{5}) $ , $ t (0<=t<=10^{9}) $ and $ c (1<=c<=n) $ . The next line will contain $ n $ space separated integers, the $ i^{th} $ integer is the severity $ i^{th} $ prisoner's crime. The value of crime severities will be non-negative and will not exceed $ 10^{9} $ .

输出格式


Print a single integer — the number of ways you can choose the $ c $ prisoners.

输入输出样例

输入样例 #1

4 3 3
2 3 1 1

输出样例 #1

2

输入样例 #2

1 1 1
2

输出样例 #2

0

输入样例 #3

11 4 2
2 2 0 7 3 2 2 4 9 1 4

输出样例 #3

6

Input

题意翻译

一个监狱里有很多囚犯。市长决定将 $c$ 名囚犯转移到其它监狱。 监狱里有 $n$ 名囚犯,为了方便统计,市长让他们站在一条线上,每个囚犯都有一个“犯罪值”。数值越大,他的犯罪就越严重。 选定的 $c$ 个囚犯必须是一个连续的部分。任何选定的囚犯犯罪值不可高于 $t$。求可以选择 $c$ 名囚犯方式的数量。

加入题单

算法标签: