123882024-12-16 10:01:48ercseferencHőségriadó (50 pont)cpp17Wrong answer 2/501ms396 KiB
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    int n,k,l,f,c=0;
    ifstream g("szamok.txt");
    g>>n>>k>>l>>f;
    int a[n]; for(int i=0; i<n; i++){g>>a[i];}
    int mel=0,hid=0,riad=0;
    for(int i=0; i<n; i++){
        if(a[i]>f){mel++; hid=0;}
        if(a[i]<f){hid++; mel=0;}
        if(mel==k && riad==0){riad=1; c++;}
        if(riad==1 && hid==l){riad=0;}}
    cout<<c;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Accepted2/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/41ms320 KiB
9Wrong answer0/41ms336 KiB
10Wrong answer0/41ms320 KiB
11Wrong answer0/41ms320 KiB
12Wrong answer0/41ms320 KiB
13Wrong answer0/41ms320 KiB
14Wrong answer0/41ms320 KiB
15Wrong answer0/41ms396 KiB
16Wrong answer0/41ms320 KiB
17Wrong answer0/41ms320 KiB