100692024-03-26 10:25:50VargusAranycipők (45)cpp17Accepted 45/453ms4112 KiB
#include <iostream>
#include <queue>
#include <climits>
#define ll long long

using namespace std;

int main()
{
    ll n;
    cin >> n;
    ll maxi = INT_MIN, db = 0;
    deque <ll> p;
    for (ll i = 1; i <= n; ++i)
    {
        ll a;
        cin >> a;
        if (maxi == a)
        {
            ++db;
            p.push_front(i);
        }
        else if (maxi < a)
        {
            p.clear();
            db = 0;
            maxi = a;
            ++db;
            p.push_front(i);
        }
        
    }
    cout << maxi << "\n" << db << "\n";
    for (ll i = p.size() - 1; i >= 0; --i)
        cout << p[i] << "\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1812 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2300 KiB
4Accepted3/33ms2544 KiB
5Accepted3/33ms2708 KiB
6Accepted3/33ms2900 KiB
7Accepted3/33ms3016 KiB
8Accepted3/33ms3208 KiB
9Accepted3/33ms3208 KiB
10Accepted3/33ms3336 KiB
11Accepted3/33ms3420 KiB
12Accepted3/33ms3560 KiB
13Accepted3/33ms3804 KiB
14Accepted3/33ms4036 KiB
15Accepted3/33ms4040 KiB
16Accepted3/33ms4072 KiB
17Accepted3/33ms4112 KiB