73542024-01-08 10:13:59antiAranycipők (45)cpp17Accepted 45/454ms4140 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int t[n], a[n];
    int h=0, maxim=0;
    for(int i=0; i<n; i++){
        cin >> t[i];
    }
    for(int i=0; i<n; i++){
        if(t[i] > maxim){
            maxim = t[i];
            h=1;
            a[0] = i+1;
        }
        else if(t[i] == maxim){
            a[h] = i+1;
            h++;
        }
    }
    cout << maxim << endl;
    cout << h << endl;
    for(int i=0; i<h; i++){
        cout << a[i] << endl;
    }


}
/*
7
2
11
8
3
11
1
10
*/
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1908 KiB
2Accepted0/03ms2164 KiB
3Accepted3/33ms2372 KiB
4Accepted3/33ms2492 KiB
5Accepted3/33ms2848 KiB
6Accepted3/33ms2788 KiB
7Accepted3/33ms2904 KiB
8Accepted3/33ms3028 KiB
9Accepted3/32ms3116 KiB
10Accepted3/34ms3244 KiB
11Accepted3/33ms3352 KiB
12Accepted3/33ms3568 KiB
13Accepted3/33ms3680 KiB
14Accepted3/33ms3780 KiB
15Accepted3/34ms4140 KiB
16Accepted3/33ms4068 KiB
17Accepted3/34ms4104 KiB