124732024-12-18 12:55:50mártonágnesFasor (40)cpp17Wrong answer 34/4043ms580 KiB
#include <iostream>

using namespace std;

int main()
{
    int N, K, db=0, sorsz=1, x, elso;
    bool boldog=false;
    cin >> N >> K;
    cin >> elso;
    for (int i=2; i<=N && !boldog; i++)
    {
        cin >> x;
        if (x>elso)
        {
            db=0;
            elso=x;
            sorsz=i;
        }
        else db++;
        if (db>=K) boldog=true;
    }
    if (boldog) cout << sorsz;
    else cout << "-1";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted2/21ms512 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted2/21ms320 KiB
8Accepted2/21ms320 KiB
9Accepted2/21ms372 KiB
10Accepted2/21ms580 KiB
11Accepted2/21ms320 KiB
12Accepted2/21ms320 KiB
13Accepted2/235ms404 KiB
14Wrong answer0/232ms404 KiB
15Accepted2/237ms404 KiB
16Accepted2/232ms404 KiB
17Accepted2/241ms320 KiB
18Accepted2/232ms320 KiB
19Accepted2/232ms400 KiB
20Wrong answer0/220ms320 KiB
21Accepted2/243ms508 KiB
22Accepted2/230ms396 KiB