214962026-01-13 10:42:12badamHőségriadó (50 pont)cpp17Wrong answer 0/50182ms1076 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, K, L, F;
    int mostsok=0, mostkeves=0, szamlalo=0;
    bool elozo, hosegriado=0;
    cin >> n >> K >> L >> F;
    int t[n];
    for(int i=0; i<n; i++) cin >> t[i];
    for(int i=0; i<n; i++)
    {
        elozo=hosegriado;
        if(mostsok>=K) hosegriado=true;
        if(mostkeves>=L) hosegriado=false, mostsok=0, mostkeves=0;
        if(t[i]>F and hosegriado==false)
        {
            mostsok++;
            mostkeves=0;
        }
        if(t[i]<F and hosegriado==false) mostsok=0;
        if(t[i]<F and hosegriado==true)
        {
            mostkeves++;
        }
        if(t[i]>F and hosegriado==true)
        {
            mostkeves=0;
            mostsok++;
        }
        cout << mostsok << " " << mostkeves << endl;
        if(elozo==false and hosegriado==true) szamlalo++;
    }
    if(mostsok>=K) hosegriado=true;
    if(elozo==false and hosegriado==true)
    {
        szamlalo++;
    }
    cout << szamlalo;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms508 KiB
2Wrong answer0/0182ms1076 KiB
3Wrong answer0/21ms508 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/44ms412 KiB
9Wrong answer0/479ms564 KiB
10Wrong answer0/4101ms596 KiB
11Wrong answer0/4109ms892 KiB
12Wrong answer0/493ms564 KiB
13Wrong answer0/4156ms820 KiB
14Wrong answer0/414ms316 KiB
15Wrong answer0/4166ms1076 KiB
16Wrong answer0/4179ms988 KiB
17Wrong answer0/4165ms1068 KiB