15092022-11-21 15:41:34teodorbatkaiVölgy (100 pont)cpp11Wrong answer 10/100275ms4600 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int n, maxv = 0;

    cin >> n;

    vector<int> a(n);

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    for(int i = 0; i < n; i++){
        if(a[i+1] < a[i]){
            int j = i;
            while(true){
                j++;
                if(j >= a.size()){
                    break;
                }
                if(a[j] >= a[i]){
                    if(j-i > maxv){
                        maxv = j-i;
                    }
                    break;
                }
            }
        }
    }
    cout << maxv-1 << endl;    
}
SubtaskSumTestVerdictTimeMemory
base10/100
1Wrong answer0/03ms1812 KiB
2Wrong answer0/02ms2008 KiB
3Wrong answer0/52ms2212 KiB
4Wrong answer0/52ms2416 KiB
5Wrong answer0/52ms2664 KiB
6Wrong answer0/52ms2724 KiB
7Accepted5/52ms2940 KiB
8Wrong answer0/52ms3012 KiB
9Accepted5/53ms3140 KiB
10Wrong answer0/53ms3332 KiB
11Wrong answer0/54ms3556 KiB
12Wrong answer0/54ms3652 KiB
13Wrong answer0/54ms3652 KiB
14Wrong answer0/56ms3648 KiB
15Wrong answer0/532ms4528 KiB
16Wrong answer0/535ms4600 KiB
17Time limit exceeded0/5270ms3560 KiB
18Wrong answer0/534ms4600 KiB
19Time limit exceeded0/5275ms3480 KiB
20Time limit exceeded0/5246ms3612 KiB
21Time limit exceeded0/5264ms3772 KiB
22Time limit exceeded0/5256ms3884 KiB