27232023-01-19 13:42:17KristófVölgy (100 pont)cpp11Wrong answer 65/100266ms4740 KiB
#include <iostream>

using namespace std;

int main()
{
     int n;
     cin>>n;
     int magassag[n];
     for(int i=0;i<n;i++){
        cin>>magassag[i];
     }
     int k, v;
     int masodik=0;
     int maxhossz=-1;


     for(k=0;k<=n-3; k++){
        v=k+1;
        masodik=k+1;
        while(magassag[v]<magassag[k] && v!=n){
                if(magassag[v]>magassag[masodik])
                masodik=v;
            v++;
        }
            if(v==n){
                v=masodik;
            }
                if(v-k>maxhossz)
                    maxhossz=v-k;

        }
     cout<<maxhossz;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base65/100
1Accepted0/03ms1876 KiB
2Accepted0/02ms2120 KiB
3Accepted5/52ms2324 KiB
4Accepted5/52ms2404 KiB
5Accepted5/52ms2400 KiB
6Accepted5/52ms2348 KiB
7Wrong answer0/52ms2480 KiB
8Accepted5/52ms2812 KiB
9Wrong answer0/54ms2944 KiB
10Accepted5/52ms2968 KiB
11Accepted5/54ms3108 KiB
12Accepted5/54ms3204 KiB
13Accepted5/54ms3200 KiB
14Accepted5/56ms3336 KiB
15Accepted5/532ms4280 KiB
16Accepted5/537ms4524 KiB
17Time limit exceeded0/5263ms3528 KiB
18Accepted5/535ms4740 KiB
19Time limit exceeded0/5247ms3556 KiB
20Time limit exceeded0/5254ms3696 KiB
21Time limit exceeded0/5250ms3556 KiB
22Time limit exceeded0/5266ms3744 KiB