20872022-12-19 07:34:01utekiiInverziócpp11Time limit exceeded 3/50600ms5708 KiB
// inverzio.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int>a(n+1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	int maxl = -1;
	int ind1, ind2;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= i; j++) {
			if (a[j] > a[n - j + 1] && (n-j+1-j)>maxl) {
				maxl = n - j + 1 - j;
				ind1 = j;
				ind2 = n - j + 1;
			}
		}
	}
	if (maxl != -1) cout << ind1 << " " << ind2;
	else cout << -1;

}


SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/03ms1812 KiB
2Time limit exceeded0/0564ms1572 KiB
3Accepted1/12ms2204 KiB
4Accepted2/24ms2456 KiB
5Wrong answer0/73ms2660 KiB
6Time limit exceeded0/2600ms2076 KiB
7Time limit exceeded0/2554ms4044 KiB
8Time limit exceeded0/2554ms4320 KiB
9Time limit exceeded0/2554ms4692 KiB
10Time limit exceeded0/2564ms4624 KiB
11Time limit exceeded0/2564ms4892 KiB
12Time limit exceeded0/2561ms4832 KiB
13Time limit exceeded0/2549ms5132 KiB
14Time limit exceeded0/2558ms5280 KiB
15Time limit exceeded0/2558ms5252 KiB
16Time limit exceeded0/2578ms5316 KiB
17Time limit exceeded0/2565ms5396 KiB
18Time limit exceeded0/2558ms5324 KiB
19Time limit exceeded0/3574ms5396 KiB
20Time limit exceeded0/3565ms5644 KiB
21Time limit exceeded0/2574ms5708 KiB
22Time limit exceeded0/2561ms5456 KiB
23Time limit exceeded0/2558ms5524 KiB
24Time limit exceeded0/2569ms5460 KiB