63312023-11-20 10:46:09MrChipserLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 5/3537ms5348 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];
    int maxtav = -1;
    int x,y;
    int viszonyitas  = 0;
    int legnagyobb = 0;
    for(int i = 1; i < n; i++)
    {
        if(a[i]>a[legnagyobb])
        {
            legnagyobb = i;
        }
        if(a[viszonyitas] > a[i])
        {
            if(i-viszonyitas>maxtav)
            {
                maxtav = i-viszonyitas;
                x=viszonyitas;
                y=i;
                //cout << x << " " << y << endl;
            }
        }
        else if(a[legnagyobb] >= a[i])
        {
            viszonyitas = legnagyobb;
        }
    }
    cout << x+1 << " " << y+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/35
1Wrong answer0/03ms1752 KiB
2Wrong answer0/037ms2680 KiB
3Wrong answer0/13ms1996 KiB
4Accepted1/13ms2124 KiB
5Accepted1/13ms2512 KiB
6Accepted1/12ms2600 KiB
7Wrong answer0/13ms2560 KiB
8Wrong answer0/13ms2568 KiB
9Wrong answer0/13ms2816 KiB
10Wrong answer0/13ms2904 KiB
11Wrong answer0/14ms2916 KiB
12Wrong answer0/216ms3268 KiB
13Wrong answer0/218ms3552 KiB
14Wrong answer0/219ms3776 KiB
15Wrong answer0/213ms3788 KiB
16Wrong answer0/219ms3924 KiB
17Wrong answer0/227ms4316 KiB
18Wrong answer0/230ms4440 KiB
19Wrong answer0/234ms4788 KiB
20Wrong answer0/235ms4712 KiB
21Wrong answer0/237ms5024 KiB
22Wrong answer0/237ms5236 KiB
23Wrong answer0/235ms5296 KiB
24Accepted2/235ms5348 KiB