Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int a[100005],n,k,t;
- int main()
- {
- int s=0,sol=0;
- cin>>n>>t>>k;
- for(int i=1;i<=n;i++)
- cin>>a[i];
- for(int i=1;i<=k;i++)
- s+=(a[i]<=t);
- sol+=(s==k);
- for(int i=k+1;i<=n;i++)
- {
- s-=(a[i-k]<=t);
- s+=(a[i]<=t);
- sol+=(s==k);
- }
- cout<<sol<<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment