39502023-03-06 15:16:37kdbAranycipők (45)cpp17Accepted 45/453ms4252 KiB
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <stack>
#include <deque>
#define ll long long
using namespace std;

ostream& operator<<(ostream& os, const vector<int>& input)
{
    for (auto const& i : input) {
        os << i << "\n";
    }
    return os;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    vector<int> vec(n);
    for (size_t i = 0; i < n; i++)
    {
        cin >> vec[i];
    }

    int m = *max_element(vec.begin(), vec.end());
    vector<int>ki;
    for (size_t i = 0; i < n; i++)
    {
        if (vec[i] == m)
        {
            ki.push_back(i + 1);
        }
    }

    cout << m << "\n" << ki.size() << "\n" << ki;
    return 0;
}
/*
7
2
11
8
3
11
1
10
*/
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms2012 KiB
2Accepted0/03ms2036 KiB
3Accepted3/33ms2304 KiB
4Accepted3/33ms2376 KiB
5Accepted3/33ms2740 KiB
6Accepted3/32ms2864 KiB
7Accepted3/33ms3032 KiB
8Accepted3/33ms3260 KiB
9Accepted3/32ms3340 KiB
10Accepted3/33ms3536 KiB
11Accepted3/33ms3740 KiB
12Accepted3/32ms3824 KiB
13Accepted3/33ms3768 KiB
14Accepted3/33ms4004 KiB
15Accepted3/33ms3992 KiB
16Accepted3/33ms3984 KiB
17Accepted3/33ms4252 KiB