139022025-01-09 09:44:42BencuHőségriadó (50 pont)cpp17Wrong answer 0/5045ms1588 KiB
#include <bits/stdc++.h>

using namespace std;
int n,k,l,f;
int a[100001],b[100001],s;
bool sz=0;

void be() {
    ifstream g("be.in");
    cin>>n>>k>>l>>f;
    int x;
    for (int i=1; i<=n; i++) {
        cin>>x;
        if (x>f) a[i]=a[i-1]+1;
        if (x<f) b[i]=b[i-1]+1;
    }
    for (int i=1; i<=n; i++) cout<<a[i]<<" ";
    cout<<endl;
    for (int i=1; i<=n; i++) cout<<b[i]<<" ";
    cout<<endl;
}

int main()
{
    be();
    for (int i=1; i<=n; i++) {
        if (a[i]>=k) {
            s++;
            sz=1;
            while (b[i]<l) i++;
        }
    }
    cout<<s;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/045ms1588 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/22ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/418ms876 KiB
10Wrong answer0/423ms908 KiB
11Wrong answer0/427ms1076 KiB
12Wrong answer0/425ms772 KiB
13Wrong answer0/435ms1148 KiB
14Wrong answer0/44ms432 KiB
15Wrong answer0/443ms1348 KiB
16Wrong answer0/441ms1312 KiB
17Wrong answer0/441ms1332 KiB