72462024-01-05 11:07:35eduka78Fasor (40)cpp17Time limit exceeded 20/40300ms4704 KiB
#include <iostream>
using namespace std;

int main()
{
    int n, k, i, fa, ok=0, j;
    cin>>n;
    cin>>k;
    int a[n];
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    for(i=0;i<n;i++){
        fa=a[i];
        ok=0;
        for(j=1;j<=k;j++){
            if(fa>=a[i+j]){ok=ok+1;}
        }
        if(ok==k){cout<<i+1;i=n;}
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/03ms1872 KiB
2Accepted0/06ms2232 KiB
3Accepted2/23ms2284 KiB
4Accepted2/23ms2488 KiB
5Accepted2/23ms2580 KiB
6Accepted2/23ms2812 KiB
7Accepted2/23ms2816 KiB
8Accepted2/24ms3024 KiB
9Accepted2/24ms3392 KiB
10Accepted2/26ms3728 KiB
11Accepted2/26ms3708 KiB
12Accepted2/24ms3788 KiB
13Time limit exceeded0/2300ms3488 KiB
14Runtime error0/235ms4704 KiB
15Time limit exceeded0/2250ms3904 KiB
16Time limit exceeded0/2250ms3912 KiB
17Time limit exceeded0/2266ms3836 KiB
18Time limit exceeded0/2241ms3972 KiB
19Time limit exceeded0/2241ms4140 KiB
20Time limit exceeded0/2264ms3616 KiB
21Time limit exceeded0/2257ms4092 KiB
22Time limit exceeded0/2270ms4208 KiB