119352024-11-20 20:52:53SRobVölgy (100 pont)cpp11Wrong answer 15/10035ms584 KiB



#include <iostream>

using namespace std;


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

	int elol;
	int elolIndex= 0;
	elol = 0;
	int mostaniMax = 0;
	int maxHossz = 0;
	int most;
	int elozo;
	for (int i = 0; i < N; i++)
	{
		
		cin >> most;
		if (i == 0)
		{
			elozo = most;
			elol = most;
		}
		if (i > 0)
		{
			
			if (most < elol)
			{
				mostaniMax++;
			}
			else if(most < elol && elozo > most)
			{
				elol = elozo;
				elolIndex = i-1;
				mostaniMax = 0;
			}
			else if (most >= elol && most > elozo)
			{
				mostaniMax++;
			}
			
			else if(most >= elol && most == elozo)
			{
				elol = most;
				elolIndex = i;
				mostaniMax = 0;
			}
			if (mostaniMax > maxHossz)
				{
					maxHossz = mostaniMax;
				}
			elozo = most;
		}
	}
	if (maxHossz == 0)
	{
		cout << -1;
	}
	else
	{
		cout << maxHossz;
	}
	
}

SubtaskSumTestVerdictTimeMemory
base15/100
1Accepted0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Accepted5/51ms320 KiB
4Accepted5/51ms320 KiB
5Wrong answer0/51ms320 KiB
6Wrong answer0/51ms320 KiB
7Accepted5/51ms320 KiB
8Wrong answer0/51ms320 KiB
9Wrong answer0/51ms584 KiB
10Wrong answer0/51ms320 KiB
11Wrong answer0/53ms320 KiB
12Wrong answer0/53ms320 KiB
13Wrong answer0/54ms320 KiB
14Wrong answer0/54ms320 KiB
15Wrong answer0/529ms320 KiB
16Wrong answer0/532ms508 KiB
17Wrong answer0/532ms500 KiB
18Wrong answer0/532ms408 KiB
19Wrong answer0/532ms500 KiB
20Wrong answer0/535ms400 KiB
21Wrong answer0/535ms320 KiB
22Wrong answer0/535ms400 KiB