37932023-03-02 22:22:27KevinVölgy (100 pont)cpp17Wrong answer 50/100279ms4504 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>2)
        cout << legnagyobb;
    else
        cout << -1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/100
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2064 KiB
3Wrong answer0/52ms2088 KiB
4Accepted5/52ms2096 KiB
5Wrong answer0/53ms2224 KiB
6Wrong answer0/52ms2376 KiB
7Accepted5/53ms2592 KiB
8Accepted5/52ms2620 KiB
9Accepted5/53ms2752 KiB
10Wrong answer0/53ms2836 KiB
11Accepted5/54ms3104 KiB
12Accepted5/54ms3476 KiB
13Accepted5/54ms3668 KiB
14Wrong answer0/56ms3628 KiB
15Accepted5/532ms4180 KiB
16Accepted5/535ms4268 KiB
17Time limit exceeded0/5277ms3444 KiB
18Accepted5/534ms4504 KiB
19Time limit exceeded0/5261ms3568 KiB
20Time limit exceeded0/5275ms3516 KiB
21Time limit exceeded0/5279ms3648 KiB
22Time limit exceeded0/5273ms3656 KiB