126732024-12-27 20:29:33mártonágnesFasor (40)cpp17Accepted 40/4041ms508 KiB

#include <iostream>

using namespace std;

int main()
{
    int nfak,blat,fmag;
    cin >> nfak >> blat;
    int ifa = 0, iba = 0, bmag = 0;

    do {
        cin >> fmag;
        ifa++;
        if (fmag > bmag) {
            bmag = fmag;
            iba = ifa;
        }
    }
    while ((ifa < nfak) && ((ifa - iba) < blat) );
    if ((ifa - iba) <= blat) {
        cout << iba;
    } else {
        cout << -1;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted2/21ms320 KiB
8Accepted2/21ms320 KiB
9Accepted2/21ms340 KiB
10Accepted2/21ms404 KiB
11Accepted2/21ms320 KiB
12Accepted2/21ms320 KiB
13Accepted2/234ms320 KiB
14Accepted2/232ms400 KiB
15Accepted2/235ms404 KiB
16Accepted2/232ms396 KiB
17Accepted2/241ms320 KiB
18Accepted2/232ms320 KiB
19Accepted2/232ms400 KiB
20Accepted2/220ms508 KiB
21Accepted2/241ms500 KiB
22Accepted2/229ms400 KiB