142932025-01-10 12:03:44sklausFasor (40)cpp17Wrong answer 2/40300ms1184 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin>>n>>k;
    int t[n];
    for(int i=0; i<n; i++) cin>>t[i];
    int m=0, p=0;
    for(int i=0; i<n; i++)
    {
        if(t[i]>=m)
        {
            m=t[i];
            int j=i+1;
            for(int j=i+1; j<=i+k and j<n; j++)
            {
                if(t[j]<m)
                {
                    p++;
                }
            if(p==k)
            {
                cout << i+1;
                return 0;
            }
        }
    }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/01ms316 KiB
2Wrong answer0/04ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms508 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/22ms316 KiB
9Accepted2/24ms432 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/26ms412 KiB
12Wrong answer0/23ms404 KiB
13Time limit exceeded0/2298ms732 KiB
14Time limit exceeded0/2300ms740 KiB
15Time limit exceeded0/2300ms984 KiB
16Time limit exceeded0/2300ms988 KiB
17Time limit exceeded0/2284ms1100 KiB
18Time limit exceeded0/2300ms952 KiB
19Time limit exceeded0/2300ms1100 KiB
20Time limit exceeded0/2300ms564 KiB
21Time limit exceeded0/2289ms996 KiB
22Wrong answer0/270ms1184 KiB