84342024-01-16 09:43:02rancealexkriszHőségriadó (50 pont)cpp17Wrong answer 8/5024ms3944 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++;

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

      }

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

      //cout<<s<<endl;
///cout<<db<<" "<<hossz<<" "<<tav<<endl;
   }
   cout<<db;
    return 0;
}
/*0 1 0
1 2 0
1 0 1
1 1 0
1 0 1
1 0 1
1 1 0
2 2 0
2*/
/*#include <iostream>

using namespace std;

int main()
{
   int n,k,l,f,x,hossz=0,db=0,tav=0,db2=0;
   cin>>n>>k>>l>>f;
   for(int i=1;i<=n;i++)
   {
      cin>>x;
      if(x>f)
      {
          hossz++;
          tav=0;
      }
      if(x>f and hossz==k )
      {db++;
      db2++;
      }
      if(x<f and hossz>=k)
      {
        tav++;
        db=0;}
      if(tav==l) hossz=0;
cout<<db<<" "<<endl;
   }
   cout<<db<<" "<<db2;
    return 0;
}*/
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/03ms1876 KiB
2Wrong answer0/024ms2064 KiB
3Accepted2/23ms2280 KiB
4Accepted2/22ms2364 KiB
5Accepted2/23ms2496 KiB
6Wrong answer0/23ms2604 KiB
7Accepted2/23ms2676 KiB
8Wrong answer0/43ms2808 KiB
9Wrong answer0/410ms3020 KiB
10Wrong answer0/414ms3128 KiB
11Wrong answer0/416ms3524 KiB
12Wrong answer0/414ms3572 KiB
13Wrong answer0/419ms3604 KiB
14Wrong answer0/44ms3704 KiB
15Wrong answer0/423ms3812 KiB
16Wrong answer0/423ms3944 KiB
17Wrong answer0/423ms3936 KiB