SHARE
TWEET

A ONI

jpvieiraa Mar 8th, 2019 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(){
  4.     long int N,K,T,i,j,contador,contadorr=0,minimo;
  5.     scanf("%ld %ld %ld",&N,&K,&T);
  6.     long int vec[N];
  7.     for(i=0;i<N;i++){
  8.         scanf("%ld",&vec[i]);
  9.     }
  10.     if(K%2==0){
  11.         minimo=(K/2);
  12.     }
  13.     else{
  14.         minimo=(K+1)/2;
  15.     }
  16.     for(i=0;i<N-K+1;i++){
  17.         contador=0;
  18.         for(j=i;j<i+K;j++){
  19.             if(vec[j]>=T){
  20.                 contador++;
  21.             }
  22.         }
  23.         if(contador>=minimo){
  24.             contadorr++;
  25.         }
  26.     }
  27.     printf("%ld\n",contadorr);
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top