148302025-02-04 12:45:54markfsibianLegmesszebbi rossz sorrendű (35 pont)cpp17Time limit exceeded 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;

}

SubtaskSumTestVerdictTimeMemory
base9/35
1Accepted0/01ms316 KiB
2Time limit exceeded0/0277ms564 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms508 KiB
5Accepted1/11ms316 KiB
6Accepted1/11ms316 KiB
7Accepted1/11ms316 KiB
8Accepted1/12ms316 KiB
9Accepted1/14ms316 KiB
10Accepted1/17ms416 KiB
11Accepted1/110ms424 KiB
12Time limit exceeded0/2298ms516 KiB
13Time limit exceeded0/2298ms564 KiB
14Time limit exceeded0/2273ms584 KiB
15Time limit exceeded0/2284ms316 KiB
16Time limit exceeded0/2282ms564 KiB
17Time limit exceeded0/2286ms564 KiB
18Time limit exceeded0/2298ms456 KiB
19Time limit exceeded0/2286ms708 KiB
20Time limit exceeded0/2280ms568 KiB
21Time limit exceeded0/2282ms656 KiB
22Time limit exceeded0/2300ms564 KiB
23Time limit exceeded0/2289ms564 KiB
24Time limit exceeded0/2282ms568 KiB