142522025-01-10 10:50:24markfsibianInverziócpp17Időlimit túllépés 9/50600ms2348 KiB
#include <iostream>

using namespace std;

int n, v[500001], t, _i, _j;
int main()
{
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> v[i];
    for (int i = 1; i < n; ++i)
    {
        for (int j = i + 1; j <= n; ++j)
        {
            if (v[i] > v[j] && j - i > t)
            {
                t = j - i;
                _i = i;
                _j = j;
            }
        }
    }
    cout << _i << " " << _j;
}

RészfeladatÖsszpontTesztVerdiktIdőMemória
base9/50
1Elfogadva0/01ms316 KiB
2Időlimit túllépés0/0584ms528 KiB
3Hibás válasz0/11ms508 KiB
4Elfogadva2/24ms316 KiB
5Elfogadva7/72ms600 KiB
6Időlimit túllépés0/2600ms580 KiB
7Időlimit túllépés0/2600ms2328 KiB
8Időlimit túllépés0/2600ms2132 KiB
9Időlimit túllépés0/2582ms2284 KiB
10Időlimit túllépés0/2600ms2268 KiB
11Időlimit túllépés0/2600ms2100 KiB
12Időlimit túllépés0/2600ms2140 KiB
13Időlimit túllépés0/2587ms2096 KiB
14Időlimit túllépés0/2586ms2100 KiB
15Időlimit túllépés0/2586ms2100 KiB
16Időlimit túllépés0/2600ms2264 KiB
17Időlimit túllépés0/2584ms2100 KiB
18Időlimit túllépés0/2600ms2200 KiB
19Időlimit túllépés0/3600ms2232 KiB
20Időlimit túllépés0/3588ms2100 KiB
21Időlimit túllépés0/2592ms2100 KiB
22Időlimit túllépés0/2582ms2348 KiB
23Időlimit túllépés0/2583ms2096 KiB
24Időlimit túllépés0/2600ms2100 KiB