39862023-03-07 15:04:25NandikaaAranycipők (45)cpp11Accepted 45/454ms3904 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int golok;
    cin >> golok;
    int legtobbgol[golok];
    for (int i = 0; i < golok; i++){
        cin >> legtobbgol[i];
    }

    int maximum = 0;
    vector <int> aranyc;

    for (int i = 0; i < golok; i++){
        if (legtobbgol[i] > maximum) {
            maximum = legtobbgol[i];
            aranyc.clear();
            aranyc.push_back(i+1);

        }
        else if (legtobbgol[i]==maximum) {
            aranyc.push_back(i+1);
        }
    }
    cout << maximum << endl;
    cout << aranyc.size() << endl;

    for (int i = 0; i < aranyc.size(); i++){
        cout << aranyc[i] << " " << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1812 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2300 KiB
4Accepted3/33ms2512 KiB
5Accepted3/33ms2604 KiB
6Accepted3/33ms2952 KiB
7Accepted3/32ms2896 KiB
8Accepted3/33ms2900 KiB
9Accepted3/33ms3136 KiB
10Accepted3/33ms3364 KiB
11Accepted3/33ms3500 KiB
12Accepted3/32ms3564 KiB
13Accepted3/33ms3672 KiB
14Accepted3/33ms3568 KiB
15Accepted3/34ms3784 KiB
16Accepted3/33ms3768 KiB
17Accepted3/33ms3904 KiB