93582024-02-21 09:20:11AGergoLegmesszebbi rossz sorrendű (35 pont)cpp17Wrong answer 19/35300ms5304 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;
                }
            }
        }
    }

    if(start == -1)
    {
        cout << -1;
    }
    else
    {
        cout << start+1 << " " << start+length+1;
    }

}
SubtaskSumTestVerdictTimeMemory
base19/35
1Wrong answer0/03ms1700 KiB
2Wrong answer0/014ms2552 KiB
3Accepted1/13ms2072 KiB
4Wrong answer0/13ms2296 KiB
5Wrong answer0/13ms2384 KiB
6Accepted1/13ms2392 KiB
7Wrong answer0/13ms2592 KiB
8Wrong answer0/13ms2592 KiB
9Accepted1/13ms2600 KiB
10Accepted1/14ms2808 KiB
11Accepted1/14ms3160 KiB
12Accepted2/2101ms3556 KiB
13Accepted2/2126ms3540 KiB
14Wrong answer0/28ms3496 KiB
15Accepted2/257ms3592 KiB
16Wrong answer0/28ms3860 KiB
17Accepted2/227ms4040 KiB
18Accepted2/234ms4256 KiB
19Accepted2/241ms4476 KiB
20Wrong answer0/213ms4700 KiB
21Accepted2/252ms4824 KiB
22Wrong answer0/214ms5152 KiB
23Time limit exceeded0/2300ms4080 KiB
24Wrong answer0/214ms5304 KiB