27202023-01-19 13:39:08KristófVölgy (100 pont)cpp11Wrong answer 75/100277ms5564 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;
                k=v-1;

        }
     cout<<maxhossz;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/100
1Accepted0/03ms2024 KiB
2Accepted0/02ms2072 KiB
3Accepted5/52ms2432 KiB
4Accepted5/52ms2432 KiB
5Accepted5/52ms2640 KiB
6Accepted5/52ms2824 KiB
7Wrong answer0/52ms2900 KiB
8Accepted5/52ms3032 KiB
9Wrong answer0/54ms3260 KiB
10Accepted5/52ms3248 KiB
11Accepted5/54ms3504 KiB
12Accepted5/54ms3604 KiB
13Accepted5/54ms3732 KiB
14Accepted5/56ms3904 KiB
15Accepted5/530ms4596 KiB
16Accepted5/535ms4720 KiB
17Time limit exceeded0/5272ms3776 KiB
18Accepted5/535ms5040 KiB
19Time limit exceeded0/5272ms3964 KiB
20Accepted5/537ms5376 KiB
21Time limit exceeded0/5277ms5452 KiB
22Accepted5/537ms5564 KiB