84352024-01-16 09:44:32rancealexkriszHőségriadó (50 pont)cpp17Wrong answer 16/5023ms4000 KiB
#include <iostream>

using namespace std;

int main()
{
   int n,k,l,f,x,hossz=0,db=0,tav=0,s=0,y=0;
   cin>>n>>k>>l>>f;
   for(int i=1;i<=n;i++)
   {
      cin>>x;
      if(x>f) hossz++;


      if(x>f and tav!=0)
      {
        tav=0;
        hossz=0;
      }

      if(x>f and hossz==k ) db++;
      
      if(x<f and db!=0)
      {
          tav++;
        hossz=0;
      }
     /// cout<<tav<<endl;
      if(tav==l)
      {
        hossz=0;
        tav=0;
        y++;

      }
///cout<<db<<" "<<hossz<<" "<<tav<<endl;
   }
   cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base16/50
1Accepted0/03ms1876 KiB
2Wrong answer0/023ms2064 KiB
3Accepted2/23ms2316 KiB
4Accepted2/23ms2524 KiB
5Accepted2/23ms2580 KiB
6Wrong answer0/23ms2604 KiB
7Accepted2/23ms2932 KiB
8Accepted4/43ms3024 KiB
9Accepted4/410ms3244 KiB
10Wrong answer0/413ms3452 KiB
11Wrong answer0/414ms3536 KiB
12Wrong answer0/413ms3668 KiB
13Wrong answer0/418ms3752 KiB
14Wrong answer0/44ms3744 KiB
15Wrong answer0/421ms3872 KiB
16Wrong answer0/421ms4000 KiB
17Wrong answer0/421ms3956 KiB