154312025-02-19 15:53:46PKBLegcsalódottabb versenyző (75 pont)cpp17Wrong answer 5/7510ms1004 KiB
#include <iostream>
#include <vector>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

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

    int bestDuration = -1;
    int bestCandidate = -1;

    int lastRecordIndex = 0;
    int lastRecordScore = score[0];

    for (int i = 1; i < n; i++){
        if(score[i] > lastRecordScore){
            int duration = i - lastRecordIndex;
            if(duration > bestDuration){
                bestDuration = duration;
                bestCandidate = lastRecordIndex;
            }
            lastRecordIndex = i;
            lastRecordScore = score[i];
        }
    }

    if(bestCandidate == -1) {
        cout << -1;
    } //else {
        //cout << bestCandidate + 1;
    //}
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/75
1Wrong answer0/01ms316 KiB
2Wrong answer0/010ms824 KiB
3Accepted5/51ms508 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/52ms316 KiB
12Wrong answer0/51ms520 KiB
13Wrong answer0/510ms820 KiB
14Wrong answer0/510ms820 KiB
15Wrong answer0/510ms820 KiB
16Wrong answer0/510ms820 KiB
17Wrong answer0/510ms1004 KiB