87342024-01-26 20:14:26bovizdbLegmesszebbi rossz sorrendű (35 pont)cpp17Time limit exceeded 7/35300ms7580 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	map<int,int> m;
	int mx = 0, mxi = -1;
	for (int i = 0; i < n; i++)
	{
		int in;
		cin >> in;
		m[i] = in;
		for (int j = 0; j < i-mx; j++)
		{
			if (m[j] > in)
			{
				mx = i-j;
				mxi = j;
			}
		}
	}
	if (mxi == -1) cout << -1;
	else cout << mxi+1 << " " << mxi+mx+1;
	
}
SubtaskSumTestVerdictTimeMemory
base7/35
1Accepted0/03ms1808 KiB
2Time limit exceeded0/0300ms2148 KiB
3Accepted1/13ms2528 KiB
4Accepted1/13ms2520 KiB
5Accepted1/13ms3008 KiB
6Accepted1/13ms3088 KiB
7Accepted1/13ms3192 KiB
8Accepted1/125ms3420 KiB
9Accepted1/1120ms3428 KiB
10Time limit exceeded0/1257ms2892 KiB
11Time limit exceeded0/1256ms3260 KiB
12Time limit exceeded0/2273ms4332 KiB
13Time limit exceeded0/2270ms3736 KiB
14Time limit exceeded0/2277ms3904 KiB
15Time limit exceeded0/2280ms4220 KiB
16Time limit exceeded0/2273ms5288 KiB
17Time limit exceeded0/2261ms5016 KiB
18Time limit exceeded0/2233ms5396 KiB
19Time limit exceeded0/2254ms5764 KiB
20Time limit exceeded0/2256ms6132 KiB
21Time limit exceeded0/2264ms6564 KiB
22Time limit exceeded0/2277ms7096 KiB
23Time limit exceeded0/2240ms6508 KiB
24Time limit exceeded0/2257ms7580 KiB