40462023-03-09 17:38:49reckaAranycipők (45)cpp11Accepted 45/454ms3384 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N,K=0;
    cin>>N;
    vector<int>gol(N);
    for(int i=0;i<N;i++)
        cin>>gol.at(i);
    int nagy=gol.at(0);
    for(int i=0;i<N;i++)
        if(gol.at(i)>nagy)
            nagy=gol.at(i);
    for(int i=0;i<N;i++)
        if(gol.at(i)==nagy)
            K++;
    vector<int>nagyindex(K);
    int s=0;
    for(int i=0;i<N;i++)
        if(gol.at(i)==nagy)
        {
            nagyindex.at(s)=i+1;
            s++;
        }
    cout<<nagy<<endl;
    cout<<K<<endl;
    for(int i=0;i<K;i++)
        cout<<nagyindex.at(i)<<endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1852 KiB
2Accepted0/03ms2008 KiB
3Accepted3/33ms2116 KiB
4Accepted3/33ms2200 KiB
5Accepted3/33ms2328 KiB
6Accepted3/32ms2408 KiB
7Accepted3/33ms2412 KiB
8Accepted3/33ms2412 KiB
9Accepted3/33ms2560 KiB
10Accepted3/34ms2484 KiB
11Accepted3/33ms2640 KiB
12Accepted3/33ms2588 KiB
13Accepted3/33ms2832 KiB
14Accepted3/34ms2940 KiB
15Accepted3/34ms3048 KiB
16Accepted3/33ms3136 KiB
17Accepted3/33ms3384 KiB