74352024-01-09 08:28:02AblablablaAranycipők (45)cpp17Accepted 45/453ms3928 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int maxi = 0;
    vector<int> megoldas;

    for(int i = 0; i < n; i++){
        int a;
        cin >> a;

        if(a > maxi){
            maxi = a;
            megoldas.clear();
            megoldas.push_back(i);
        } else if(a == maxi){
            megoldas.push_back(i);
        }
    }

    cout << maxi << "\n";
    cout << megoldas.size() << "\n";
    for(int x : megoldas){
        cout << x + 1 << "\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1812 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2272 KiB
4Accepted3/33ms2428 KiB
5Accepted3/33ms2640 KiB
6Accepted3/33ms2996 KiB
7Accepted3/33ms3120 KiB
8Accepted3/33ms3184 KiB
9Accepted3/33ms3300 KiB
10Accepted3/33ms3376 KiB
11Accepted3/33ms3380 KiB
12Accepted3/33ms3468 KiB
13Accepted3/33ms3472 KiB
14Accepted3/33ms3604 KiB
15Accepted3/33ms3684 KiB
16Accepted3/33ms3684 KiB
17Accepted3/33ms3928 KiB