148302025-02-04 12:45:54markfsibianLegmesszebbi rossz sorrendű (35 pont)cpp17Időlimit túllépés 9/35300ms708 KiB
#include <iostream>

using namespace std;

int v[100001];

int main()
{
    int n;
    cin >> n;

    for (int i = 1; i <= n; ++i)
        cin >> v[i];

    int maxi = 1, ind=0, t;
    for (int i = 1; i < n; ++i)
    {
        for (int j = i + 1; j <= n; ++j)
        {
            if (v[i] > v[j] && j - i > maxi)
            {
                maxi = j - i;
                ind = i;
            }

        }
    }
    if (ind)
        cout << ind << " " << ind + maxi;
    else
        cout << -1;

}

RészfeladatÖsszpontTesztVerdiktIdőMemória
base9/35
1Elfogadva0/01ms316 KiB
2Időlimit túllépés0/0277ms564 KiB
3Elfogadva1/11ms316 KiB
4Elfogadva1/11ms508 KiB
5Elfogadva1/11ms316 KiB
6Elfogadva1/11ms316 KiB
7Elfogadva1/11ms316 KiB
8Elfogadva1/12ms316 KiB
9Elfogadva1/14ms316 KiB
10Elfogadva1/17ms416 KiB
11Elfogadva1/110ms424 KiB
12Időlimit túllépés0/2298ms516 KiB
13Időlimit túllépés0/2298ms564 KiB
14Időlimit túllépés0/2273ms584 KiB
15Időlimit túllépés0/2284ms316 KiB
16Időlimit túllépés0/2282ms564 KiB
17Időlimit túllépés0/2286ms564 KiB
18Időlimit túllépés0/2298ms456 KiB
19Időlimit túllépés0/2286ms708 KiB
20Időlimit túllépés0/2280ms568 KiB
21Időlimit túllépés0/2282ms656 KiB
22Időlimit túllépés0/2300ms564 KiB
23Időlimit túllépés0/2289ms564 KiB
24Időlimit túllépés0/2282ms568 KiB