25322023-01-16 18:21:23szabosamuelVölgy (100 pont)cpp11Wrong answer 50/100280ms4980 KiB
#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int m[n+1];
    for(int i=1; i<=n; i++)
    {
        cin >> m[i];
    }
    int db=0, db2=0;
    int j;
    int x;
    for(int i=1; i<=n; i++)
    {
        j=i+1;
        while(m[i]>m[j] && j<=n)
        {
            db2++;
            if(j==n)
            {
                x=0;
                for(int k=i+1; k<j; k++)
                {
                    if(m[k]>=m[j])
                    {
                        x=1;
                    }
                }
                if(x==1) db2=0;
            }
            j++;
        }
        db2++;
        if(db2>db) db=db2;
        db2=0;
    }
    if(db==1) db-=2;
    cout << db;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/100
1Accepted0/03ms1872 KiB
2Wrong answer0/02ms2136 KiB
3Accepted5/52ms2272 KiB
4Accepted5/52ms2476 KiB
5Wrong answer0/52ms2720 KiB
6Wrong answer0/52ms2884 KiB
7Accepted5/52ms3088 KiB
8Accepted5/52ms3168 KiB
9Wrong answer0/53ms3160 KiB
10Wrong answer0/52ms3288 KiB
11Accepted5/54ms3512 KiB
12Accepted5/54ms3608 KiB
13Accepted5/54ms3748 KiB
14Wrong answer0/56ms3824 KiB
15Accepted5/532ms4636 KiB
16Accepted5/537ms4868 KiB
17Time limit exceeded0/5280ms3772 KiB
18Accepted5/535ms4980 KiB
19Time limit exceeded0/5247ms3692 KiB
20Time limit exceeded0/5264ms3816 KiB
21Time limit exceeded0/5268ms3940 KiB
22Time limit exceeded0/5230ms3868 KiB