39962023-03-07 21:22:37eokorAranycipők (45)cpp11Accepted 45/453ms3672 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    //ifstream cin("in.txt");
    long long int n;
    cin>>n;
    int x,sum=0;
    queue <int> sol;
    int maxi=0;
    for(long long int i=1;i<=n;i++)
    {
        cin>>x;
        if(x>maxi)
        {
            sum=1;
            while(!sol.empty())
            {
                sol.pop();
            }
            sol.push(i);
            maxi=x;
        }
        else if(x==maxi)
                {
                    sum++;
                    sol.push(i);
                }
    }

    cout<<maxi<<endl<<sum<<endl;

    while(!sol.empty())
    {
        cout<<sol.front()<<endl;
        sol.pop();
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1808 KiB
2Accepted0/03ms2008 KiB
3Accepted3/33ms2212 KiB
4Accepted3/33ms2428 KiB
5Accepted3/33ms2640 KiB
6Accepted3/33ms2856 KiB
7Accepted3/33ms2936 KiB
8Accepted3/33ms3060 KiB
9Accepted3/33ms3276 KiB
10Accepted3/33ms3368 KiB
11Accepted3/33ms3388 KiB
12Accepted3/33ms3424 KiB
13Accepted3/33ms3428 KiB
14Accepted3/33ms3432 KiB
15Accepted3/33ms3556 KiB
16Accepted3/33ms3672 KiB
17Accepted3/33ms3640 KiB