93572024-02-21 09:18:30AGergoLegmesszebbi rossz sorrendű (35 pont)cpp17Wrong answer 18/35275ms4392 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    cin.tie(0);cout.tie(0);iostream::sync_with_stdio(0);

    int N,largest,length=0,start = -1;
    cin >> N;

    vector<int> elemek(N);

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

    for(int j = 0; j < N-length;j++)
    {
        if(elemek[j] > largest)
        {
            largest = elemek[j];
            for(int i = j+length; i < N-length; i++)
            {
                if(elemek[j] > elemek[i] && i-j > length)
                {
                    length = i-j;
                    start = j;
                }
            }
        }
    }

    cout << start+1 << " " << start+length+1;

}
SubtaskSumTestVerdictTimeMemory
base18/35
1Accepted0/03ms1832 KiB
2Accepted0/054ms2744 KiB
3Wrong answer0/13ms2264 KiB
4Wrong answer0/12ms2312 KiB
5Wrong answer0/12ms2344 KiB
6Accepted1/13ms2548 KiB
7Wrong answer0/13ms2772 KiB
8Accepted1/13ms2980 KiB
9Wrong answer0/13ms3080 KiB
10Accepted1/14ms3200 KiB
11Accepted1/14ms3440 KiB
12Accepted2/2101ms3532 KiB
13Accepted2/2126ms3508 KiB
14Wrong answer0/28ms3512 KiB
15Accepted2/259ms3596 KiB
16Accepted2/2153ms3768 KiB
17Wrong answer0/210ms3996 KiB
18Accepted2/234ms3928 KiB
19Accepted2/241ms4276 KiB
20Wrong answer0/213ms4244 KiB
21Accepted2/252ms4392 KiB
22Wrong answer0/214ms4340 KiB
23Wrong answer0/213ms4312 KiB
24Time limit exceeded0/2275ms3540 KiB