106772024-04-07 21:19:29VargusInverziócpp17Wrong answer 7/50560ms11132 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 p1 = 0, p2 = 0;
    bool ok = false;
    for (ll i = 1; i <= n; ++i)
    {
        for (ll j = n; j >= i + 1; --j)
        {
            if (a[i] > a[j])
            {
                ok = true;
                p1 = i;
                p2 = j;
                break;
            }
        }
        if (ok)
            break;
    }
    if(!ok)
    {
        cout << "-1";
        return 0;
    }    
    cout << p1 << " " << p2;

    return 0;
}
/*
5
4 3 5 1 2
*/
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/03ms1812 KiB
2Wrong answer0/019ms2912 KiB
3Accepted1/13ms2316 KiB
4Accepted2/23ms2296 KiB
5Wrong answer0/73ms2420 KiB
6Wrong answer0/219ms3200 KiB
7Wrong answer0/2193ms10156 KiB
8Wrong answer0/2193ms10408 KiB
9Wrong answer0/2194ms10368 KiB
10Accepted2/2194ms10492 KiB
11Wrong answer0/2193ms10744 KiB
12Wrong answer0/2189ms10720 KiB
13Wrong answer0/2193ms10788 KiB
14Wrong answer0/2193ms10796 KiB
15Wrong answer0/2193ms10788 KiB
16Wrong answer0/2193ms10792 KiB
17Wrong answer0/2193ms10820 KiB
18Wrong answer0/2193ms10820 KiB
19Wrong answer0/3195ms11048 KiB
20Wrong answer0/3194ms11004 KiB
21Wrong answer0/2193ms11000 KiB
22Wrong answer0/2193ms11132 KiB
23Accepted2/2193ms11072 KiB
24Time limit exceeded0/2560ms6536 KiB