101402024-03-28 04:15:52abelke2Inverziócpp17Wrong answer 11/50194ms68016 KiB
#include <iostream>
#include <vector>

using namespace std;


int main()
{
	int n = 0;
	cin >> n;
	vector<int> szamok(n);
	
	for (int i = 0; i < n; ++i)
	{
		cin >> szamok[i];
	}
	int maximum = szamok[0];
	int kezd = 0;
	int veg = -1;
	for (int i = 1; i < n; ++i)
	{
		if (szamok[i] < maximum)
		{
			veg = i;
		}
		else if (veg == -1)
		{
			kezd = i;
			maximum = szamok[i];
		}
	}
	
	if (veg != -1)
	{
		cout << kezd + 1 << " " << veg + 1;
	}
	else
	{
		cout << -1;
	}

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/50
1Accepted0/03ms1944 KiB
2Wrong answer0/019ms2752 KiB
3Accepted1/13ms2672 KiB
4Wrong answer0/23ms2928 KiB
5Wrong answer0/73ms3136 KiB
6Wrong answer0/219ms3892 KiB
7Wrong answer0/2192ms10904 KiB
8Wrong answer0/2192ms14192 KiB
9Wrong answer0/2190ms17516 KiB
10Accepted2/2192ms21164 KiB
11Accepted2/2190ms24376 KiB
12Wrong answer0/2187ms27548 KiB
13Wrong answer0/2194ms31156 KiB
14Wrong answer0/2192ms34484 KiB
15Wrong answer0/2193ms38040 KiB
16Wrong answer0/2192ms41356 KiB
17Accepted2/2194ms44560 KiB
18Wrong answer0/2193ms48204 KiB
19Wrong answer0/3190ms51596 KiB
20Wrong answer0/3190ms54860 KiB
21Wrong answer0/2190ms58068 KiB
22Wrong answer0/2192ms61380 KiB
23Accepted2/2190ms64708 KiB
24Accepted2/2190ms68016 KiB