114302024-09-16 09:05:57RRoliAranycipők (45)cpp17Wrong answer 0/453ms544 KiB
#include <bits/stdc++.h>
using namespace std;

int n, a[1001], ln, sz;
struct lista{
    int elem;
    lista *kov;
} *elso, *utolso;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    elso = NULL;

    ifstream f("be.in");
    f >> n;
    for(int i = 1; i <= n; i++) {
        f >> a[i];
        ln = max(ln, a[i]);
    }
    for(int i = 1; i <= n; i++) {
        if(a[i] == ln) {
            sz++;
            lista *p;
            p = new lista;
            p->elem = i;
            p->kov = NULL;
            if(elso == NULL) {
                elso = p;
                utolso = elso;
            } else {
                utolso->kov = p;
                utolso = p;
            }
        }
    }

    cout << ln << '\n' << sz << '\n';
    lista *p = elso;
    while(p != NULL) {
        cout << p->elem << '\n';
        p = p->kov;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/45
1Wrong answer0/03ms384 KiB
2Wrong answer0/02ms360 KiB
3Wrong answer0/32ms544 KiB
4Wrong answer0/33ms404 KiB
5Wrong answer0/32ms360 KiB
6Wrong answer0/32ms500 KiB
7Wrong answer0/32ms360 KiB
8Wrong answer0/33ms376 KiB
9Wrong answer0/32ms376 KiB
10Wrong answer0/32ms360 KiB
11Wrong answer0/33ms360 KiB
12Wrong answer0/33ms508 KiB
13Wrong answer0/32ms360 KiB
14Wrong answer0/32ms360 KiB
15Wrong answer0/33ms360 KiB
16Wrong answer0/32ms364 KiB
17Wrong answer0/32ms504 KiB