84312024-01-16 09:36:33rancealexkriszHőségriadó (50 pont)cpp17Wrong answer 8/5024ms4312 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/03ms2024 KiB
2Wrong answer0/024ms2448 KiB
3Accepted2/23ms2264 KiB
4Accepted2/23ms2476 KiB
5Accepted2/23ms2692 KiB
6Wrong answer0/23ms3184 KiB
7Accepted2/23ms3224 KiB
8Wrong answer0/43ms3220 KiB
9Wrong answer0/410ms3284 KiB
10Wrong answer0/413ms3412 KiB
11Wrong answer0/416ms3628 KiB
12Wrong answer0/413ms3692 KiB
13Wrong answer0/419ms3820 KiB
14Wrong answer0/44ms3908 KiB
15Wrong answer0/423ms4152 KiB
16Wrong answer0/423ms4148 KiB
17Wrong answer0/423ms4312 KiB