106722024-04-07 20:58:23VargusInverziócpp17Time limit exceeded 9/50600ms41068 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n;
    cin >> n;
    vector <ll> a(n + 1);
    for (ll i = 1; i <= n; ++i)
        cin >> a[i];

    ll maxi = -1;
    vector <ll> poz;
    for (ll i = 1; i <= n - 1; ++i)
    {
        for (ll j = i + 1; j <= n; ++j)
        {
            if (a[i] > a[j] && maxi < j - i)
            {
                maxi = j - i;
                poz.clear();
                poz.push_back(i);
                poz.push_back(j);
            }
        }
    }
    for (auto& e : poz)
        cout << e << " ";

    return 0;
}
/*
5
4 3 2 1 5
*/
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/03ms1816 KiB
2Time limit exceeded0/0600ms2104 KiB
3Wrong answer0/13ms2456 KiB
4Accepted2/26ms2692 KiB
5Accepted7/74ms2792 KiB
6Time limit exceeded0/2598ms2756 KiB
7Time limit exceeded0/2580ms10020 KiB
8Time limit exceeded0/2565ms13220 KiB
9Time limit exceeded0/2574ms16372 KiB
10Time limit exceeded0/2558ms19740 KiB
11Time limit exceeded0/2554ms23040 KiB
12Time limit exceeded0/2578ms26548 KiB
13Time limit exceeded0/2583ms30136 KiB
14Time limit exceeded0/2566ms33428 KiB
15Time limit exceeded0/2555ms36988 KiB
16Time limit exceeded0/2566ms40268 KiB
17Time limit exceeded0/2546ms40852 KiB
18Time limit exceeded0/2574ms40892 KiB
19Time limit exceeded0/3574ms40612 KiB
20Time limit exceeded0/3565ms40696 KiB
21Time limit exceeded0/2550ms40776 KiB
22Time limit exceeded0/2561ms40996 KiB
23Time limit exceeded0/2574ms41068 KiB
24Time limit exceeded0/2574ms41020 KiB