77492024-01-11 06:49:16csdavidAranycipők (45)cpp17Accepted 45/454ms3476 KiB
#include <iostream>
#include <algorithm>

using namespace std;

struct jatekos
{
    short gol;
    short sorszam;
};

bool alma(jatekos x123, jatekos y123)
{
    if(x123.gol>y123.gol){
        return 1;
    }
    else if(x123.gol<y123.gol){
        return 0;
    }
    else{
        return x123.sorszam<y123.sorszam;
    }
}


int main()
{
    short n;
    cin >> n;
    jatekos a[n];
    for(short i=0; i<n; i++){
        cin >> a[i].gol;
        a[i].sorszam = i+1;
    }
    sort(a, a+n, alma);

    short e=1, golok=a[0].gol;
    for(short i=1; (a[i].gol==golok)&&i<n; i++){
        e++;
    }
    cout << golok << endl << e << endl;
    for(short i=0; (a[i].gol==golok)&&i<n; i++){
        cout<<a[i].sorszam << endl;
    }
    /*for(int i=0; i<n; i++){
        cout << a[i].sorszam << ".   " << a[i].gol << endl;
    }*/
















    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/03ms1876 KiB
2Accepted0/03ms2124 KiB
3Accepted3/33ms2336 KiB
4Accepted3/33ms2640 KiB
5Accepted3/33ms2708 KiB
6Accepted3/33ms2724 KiB
7Accepted3/33ms2848 KiB
8Accepted3/33ms3068 KiB
9Accepted3/33ms3296 KiB
10Accepted3/34ms3348 KiB
11Accepted3/33ms3364 KiB
12Accepted3/33ms3356 KiB
13Accepted3/33ms3360 KiB
14Accepted3/33ms3364 KiB
15Accepted3/33ms3368 KiB
16Accepted3/33ms3476 KiB
17Accepted3/34ms3436 KiB