79402024-01-12 07:56:51TundeInverziócpp17Time limit exceeded 1/50600ms12628 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int t[n];
    for(int i=0; i<n; i++)
    {
        cin >> t[i];
    }
    int lh=-1, x=1, y=1;
    for(int i=0; i<n-1; i++)
    {
        int x=0;
        for(int j=n-1; j>i && x==0; j--)
        {
            if(t[i]-t[j]>lh)
            {
                lh=t[i]-t[j];
                ++x;
                x=i+1;
                y=j+1;
            }
        }
    }
    if(lh==-1)
    {
        cout << -1;
    }
    else
    {
        cout << x << " " << y;
    }
}
SubtaskSumTestVerdictTimeMemory
base1/50
1Accepted0/03ms1876 KiB
2Time limit exceeded0/0598ms1736 KiB
3Accepted1/13ms2576 KiB
4Wrong answer0/23ms2788 KiB
5Wrong answer0/73ms3008 KiB
6Time limit exceeded0/2600ms2696 KiB
7Time limit exceeded0/2555ms7912 KiB
8Time limit exceeded0/2565ms11328 KiB
9Time limit exceeded0/2570ms11640 KiB
10Time limit exceeded0/2566ms11544 KiB
11Time limit exceeded0/2559ms11620 KiB
12Time limit exceeded0/2566ms11848 KiB
13Time limit exceeded0/2566ms11940 KiB
14Time limit exceeded0/2566ms12032 KiB
15Time limit exceeded0/2550ms12008 KiB
16Time limit exceeded0/2566ms12092 KiB
17Time limit exceeded0/2582ms12308 KiB
18Time limit exceeded0/2565ms12216 KiB
19Time limit exceeded0/3546ms12364 KiB
20Time limit exceeded0/3558ms12460 KiB
21Time limit exceeded0/2559ms12452 KiB
22Time limit exceeded0/2566ms12428 KiB
23Time limit exceeded0/2570ms12516 KiB
24Time limit exceeded0/2570ms12628 KiB