151982025-02-16 12:13:41balintttLegcsalódottabb versenyző (75 pont)cpp17Wrong answer 5/7534ms804 KiB
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> scores(n);
    for (int i = 0; i < n; i++) {
        cin >> scores[i];
    }

    int max_score = 0;
    int max_index = 0;
    for (int i = 0; i < n; i++) {
        if (scores[i] > max_score) {
            max_score = scores[i];
            max_index = i;
        }
    }

    int underdog = -1;
    for (int i = 0; i < n; i++) {
        if (scores[i] == max_score && i < max_index) {
            underdog = i;
            break;
        }
    }

    if (underdog == -1) {
        cout << -1 << endl;
    } else {
        cout << underdog + 1 << endl;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/75
1Wrong answer0/01ms316 KiB
2Wrong answer0/034ms748 KiB
3Accepted5/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/51ms316 KiB
6Wrong answer0/51ms316 KiB
7Wrong answer0/51ms316 KiB
8Wrong answer0/51ms316 KiB
9Wrong answer0/51ms316 KiB
10Wrong answer0/51ms316 KiB
11Wrong answer0/51ms316 KiB
12Wrong answer0/51ms572 KiB
13Wrong answer0/534ms804 KiB
14Wrong answer0/534ms748 KiB
15Wrong answer0/532ms800 KiB
16Wrong answer0/534ms564 KiB
17Wrong answer0/534ms568 KiB