113832024-08-29 17:47:43KarolinaAranycipők (45)cpp17Accepted 45/453ms632 KiB
#include <iostream>
#include <vector>

using namespace std;

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

	vector<int> golok(n);
	for (int i = 0; i < n; i++)
	{
		cin >> golok[i];
	}
	int db;
	int max;
	int eppen;
	vector<int> hanyadik;
	max = 0;
	db = 0;
	eppen = 0;
	for (int x = 0; x < n; x++)
	{
		eppen = eppen + 1;
		if (golok[x] > max)
		{
			max = golok[x];
			hanyadik.clear();
			db = 0;
		}
		if (max == golok[x])
		{

			db = db + 1;
			hanyadik.push_back(eppen);

		}

	}
	cout << max << '\n' << db << '\n';
	for (int k = 0; k < db; k++)
	{
		cout << hanyadik[k];
		cout << '\n';
	}

}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/02ms424 KiB
2Accepted0/03ms492 KiB
3Accepted3/33ms488 KiB
4Accepted3/32ms360 KiB
5Accepted3/33ms632 KiB
6Accepted3/33ms616 KiB
7Accepted3/32ms368 KiB
8Accepted3/33ms436 KiB
9Accepted3/32ms360 KiB
10Accepted3/33ms504 KiB
11Accepted3/33ms360 KiB
12Accepted3/32ms504 KiB
13Accepted3/33ms360 KiB
14Accepted3/33ms492 KiB
15Accepted3/33ms376 KiB
16Accepted3/33ms256 KiB
17Accepted3/33ms360 KiB