Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int n, com, prof, num, c=0, p=0, total=0, ola, i, j;
- long int v[100000];
- scanf("%d %d %d",&n, &com, &prof);
- num=com/2;
- if (com%2!=0){
- num++;
- }
- for (i=0;i<n;i++){
- scanf("%li",&v[i]);
- }
- ola=n-com+1;
- for (i=0;i<ola;i++){
- c=0;
- p=0;
- for (j=0;j<com;j++){
- if (v[i+c]>=prof){
- p++;
- }
- c++;
- }
- if (p>=num){
- total++;
- }
- }
- printf("%d\n",total);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement