63292023-11-20 10:39:57MrChipserLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 5/3537ms5696 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[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;
        }
        if(a[i]>a[legnagyobb])
        {
            legnagyobb = i;
        }
    }
    cout << x+1 << " " << y+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/35
1Accepted0/03ms1872 KiB
2Wrong answer0/037ms2896 KiB
3Wrong answer0/13ms2500 KiB
4Accepted1/13ms2700 KiB
5Accepted1/13ms2912 KiB
6Accepted1/12ms2944 KiB
7Wrong answer0/13ms3052 KiB
8Wrong answer0/13ms3256 KiB
9Wrong answer0/13ms3472 KiB
10Wrong answer0/14ms3468 KiB
11Wrong answer0/14ms3588 KiB
12Wrong answer0/217ms4084 KiB
13Wrong answer0/218ms4336 KiB
14Wrong answer0/219ms4168 KiB
15Wrong answer0/213ms4228 KiB
16Wrong answer0/219ms4436 KiB
17Wrong answer0/227ms4876 KiB
18Wrong answer0/230ms4784 KiB
19Wrong answer0/234ms4876 KiB
20Wrong answer0/235ms5120 KiB
21Wrong answer0/237ms5360 KiB
22Wrong answer0/237ms5488 KiB
23Wrong answer0/234ms5608 KiB
24Accepted2/234ms5696 KiB