37952023-03-02 22:33:06KevinVölgy (100 pont)cpp17Wrong answer 50/100284ms4704 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    int szam=1;
    int legnagyobb=0;
    bool megvan=false;
    cin >> n;
    vector<int> vec(n);
    for (int i=0; i<n; i++)
        cin >> vec[i];
    for (int a=0; a<n-3; a++){
        for (int b=a+1; b<n&&megvan==false; b++){
            if (vec[a]>vec[b])
                szam++;
            else
                megvan=true;
        }
        if (szam>legnagyobb&&megvan==true)
            legnagyobb=szam;
        szam=1;
        megvan=false;
    }
    if (legnagyobb>3)
        cout << legnagyobb;
    else
        cout << -1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/100
1Accepted0/03ms1816 KiB
2Wrong answer0/03ms2052 KiB
3Wrong answer0/52ms2216 KiB
4Accepted5/53ms2428 KiB
5Wrong answer0/52ms2672 KiB
6Wrong answer0/52ms2916 KiB
7Accepted5/53ms3092 KiB
8Accepted5/52ms3180 KiB
9Accepted5/53ms3188 KiB
10Wrong answer0/53ms3312 KiB
11Accepted5/54ms3544 KiB
12Accepted5/54ms3904 KiB
13Accepted5/54ms3944 KiB
14Wrong answer0/56ms4172 KiB
15Accepted5/532ms4488 KiB
16Accepted5/535ms4588 KiB
17Time limit exceeded0/5261ms3552 KiB
18Accepted5/534ms4704 KiB
19Time limit exceeded0/5284ms3592 KiB
20Time limit exceeded0/5254ms3880 KiB
21Time limit exceeded0/5246ms3980 KiB
22Time limit exceeded0/5234ms3996 KiB