126642024-12-27 19:08:49mártonágnesAranycipők (45)cpp17Accepted 45/452ms532 KiB
/**
N - jatekosok szama
K - aranycipos jatekosok szama
G - egyeni golok szama
maxi - az aranycipot ero golok szama
g - az i-1-ik jatekos goljainak szama
*/
#include <iostream>

using namespace std;

int main()
{
    int N, G, G1, K=1, maxi=1;
    cin >> N;
    cin >> G1;
    maxi=G1;
    int Ki[N+1];
    Ki[K]=1;
    for (int i=2; i<=N; i++)
    {
        cin >> G;
        if (G==maxi) {K++; Ki[K]=i;}
        if (G>maxi) {maxi=G; K=1; Ki[K]=i;}
    }
    cout << maxi << endl;
    cout << K << endl;
    for (int j=1; j<=K; j++)
    {
        cout << Ki[j]<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/01ms508 KiB
2Accepted0/01ms320 KiB
3Accepted3/31ms320 KiB
4Accepted3/31ms508 KiB
5Accepted3/31ms320 KiB
6Accepted3/31ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms332 KiB
9Accepted3/31ms320 KiB
10Accepted3/32ms360 KiB
11Accepted3/31ms320 KiB
12Accepted3/31ms320 KiB
13Accepted3/31ms320 KiB
14Accepted3/32ms532 KiB
15Accepted3/32ms332 KiB
16Accepted3/31ms320 KiB
17Accepted3/32ms320 KiB