51192023-04-18 16:10:59Tina0731Legmesszebbi rossz sorrendű (35 pont)cpp11Time limit exceeded 2/35300ms4264 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int t[n+1];
    cin>>t[1];
    int ln=-100001, tav=0, hely=-1;
    for(int i=2;i<n+1;i++)
    {
        cin>>t[i];
        if(t[i]<t[1])
        {
            hely=1;
            tav=i;
        }
    }

    for(int i=1;i+tav<n;i++)
    {
        if(t[i]>ln)
        for(int j=n;j>i+tav;j--)
        {
            if(t[i]>t[j])
            {
                hely=i;
                tav=j-i+1;
                if(ln<t[i])
                    ln=t[i];
                break;
            }
        }
    }

    if(hely==-1)
        cout<<-1;
    else
        cout<<hely<<" "<<tav;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/35
1Accepted0/03ms2000 KiB
2Time limit exceeded0/0300ms1848 KiB
3Accepted1/13ms2452 KiB
4Accepted1/13ms2492 KiB
5Wrong answer0/13ms2640 KiB
6Wrong answer0/13ms3008 KiB
7Wrong answer0/12ms3096 KiB
8Wrong answer0/13ms3148 KiB
9Wrong answer0/14ms3176 KiB
10Wrong answer0/16ms3260 KiB
11Wrong answer0/18ms3264 KiB
12Time limit exceeded0/2270ms2652 KiB
13Time limit exceeded0/2279ms2796 KiB
14Time limit exceeded0/2256ms2832 KiB
15Time limit exceeded0/2263ms3888 KiB
16Time limit exceeded0/2259ms2992 KiB
17Time limit exceeded0/2272ms3128 KiB
18Time limit exceeded0/2272ms3448 KiB
19Time limit exceeded0/2263ms3472 KiB
20Time limit exceeded0/2268ms3592 KiB
21Time limit exceeded0/2243ms3692 KiB
22Time limit exceeded0/2250ms3900 KiB
23Time limit exceeded0/2263ms4076 KiB
24Time limit exceeded0/2263ms4264 KiB