63322023-11-20 10:47:19MrChipserLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 5/3537ms4972 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
1Accepted0/03ms2024 KiB
2Wrong answer0/037ms2848 KiB
3Wrong answer0/13ms2160 KiB
4Accepted1/13ms2288 KiB
5Accepted1/13ms2420 KiB
6Accepted1/13ms2628 KiB
7Wrong answer0/13ms2840 KiB
8Wrong answer0/13ms2928 KiB
9Wrong answer0/13ms3172 KiB
10Wrong answer0/14ms3392 KiB
11Wrong answer0/14ms3492 KiB
12Wrong answer0/216ms3848 KiB
13Wrong answer0/218ms3864 KiB
14Wrong answer0/219ms3872 KiB
15Wrong answer0/213ms3996 KiB
16Wrong answer0/219ms4352 KiB
17Wrong answer0/227ms4640 KiB
18Wrong answer0/230ms4780 KiB
19Wrong answer0/234ms4812 KiB
20Wrong answer0/235ms4820 KiB
21Wrong answer0/237ms4964 KiB
22Wrong answer0/237ms4972 KiB
23Wrong answer0/234ms4968 KiB
24Accepted2/235ms4968 KiB