63302023-11-20 10:41:17MrChipserLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 5/3537ms4864 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[viszonyitas])
        {
            legnagyobb = i;
        }
    }
    cout << x+1 << " " << y+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/35
1Accepted0/03ms1876 KiB
2Wrong answer0/037ms2844 KiB
3Wrong answer0/13ms2280 KiB
4Accepted1/13ms2488 KiB
5Accepted1/13ms2576 KiB
6Accepted1/13ms2820 KiB
7Wrong answer0/13ms3032 KiB
8Wrong answer0/13ms3148 KiB
9Wrong answer0/13ms3116 KiB
10Wrong answer0/14ms3152 KiB
11Wrong answer0/14ms3396 KiB
12Wrong answer0/217ms3736 KiB
13Wrong answer0/218ms4008 KiB
14Wrong answer0/219ms3868 KiB
15Wrong answer0/213ms3748 KiB
16Wrong answer0/219ms4128 KiB
17Wrong answer0/227ms4276 KiB
18Wrong answer0/230ms4676 KiB
19Wrong answer0/232ms4548 KiB
20Wrong answer0/235ms4488 KiB
21Wrong answer0/237ms4740 KiB
22Wrong answer0/237ms4864 KiB
23Wrong answer0/234ms4764 KiB
24Accepted2/234ms4732 KiB