124692024-12-18 12:52:45ruffbrigiFasor (40)cpp17Wrong answer 34/4046ms556 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,k,h1,db=0,h,ssz=1;
    cin>>n>>k;
    cin>>h1;
    bool boldog=false;
    for(int i=2;i<=n && boldog==false;i++)
    {
        cin>>h;
        if(h1<h)
        {
            db=0;
            h1=h;
            ssz=i;
        }
        else  db++;
        if(db>=k) boldog=true;
    }
    if(boldog) cout<<ssz;
    else cout<<-1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted2/21ms320 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms336 KiB
7Accepted2/21ms320 KiB
8Accepted2/21ms508 KiB
9Accepted2/21ms320 KiB
10Accepted2/21ms556 KiB
11Accepted2/21ms500 KiB
12Accepted2/21ms320 KiB
13Accepted2/235ms508 KiB
14Wrong answer0/234ms400 KiB
15Accepted2/239ms512 KiB
16Accepted2/232ms404 KiB
17Accepted2/243ms388 KiB
18Accepted2/234ms320 KiB
19Accepted2/235ms400 KiB
20Wrong answer0/220ms400 KiB
21Accepted2/246ms508 KiB
22Accepted2/232ms404 KiB