124982024-12-19 11:39:20nkbalintFasor (40)cpp17Wrong answer 12/40300ms1360 KiB
#include <iostream>

using namespace std;

int N,K,v[200001],i,y,x;

int main()
{
     cin>>N>>K;
     for(i=1;i<=N;++i)
     {
         cin>>v[i];
     }
     for(i=1;i<=N;++i)
     {
         y=-1;
         for(x=i-K;x<i;++x)
         {
             if(v[x]>v[i])
             {
                 y=1;
                 break;
             }
         }
         for(x=i+1;x<=i+K;++x)
         {
             if(v[x]>v[i])
             {
                 y=1;
                 break;
             }
         }
         if(y==-1)
         {
             cout<<i;
             break;
         }
     }
}
SubtaskSumTestVerdictTimeMemory
base12/40
1Accepted0/01ms320 KiB
2Accepted0/04ms320 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms512 KiB
5Wrong answer0/21ms320 KiB
6Accepted2/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Accepted2/21ms424 KiB
9Wrong answer0/24ms400 KiB
10Accepted2/24ms320 KiB
11Accepted2/24ms320 KiB
12Wrong answer0/23ms320 KiB
13Time limit exceeded0/2300ms672 KiB
14Time limit exceeded0/2298ms744 KiB
15Time limit exceeded0/2298ms1084 KiB
16Time limit exceeded0/2300ms1080 KiB
17Time limit exceeded0/2287ms980 KiB
18Time limit exceeded0/2289ms928 KiB
19Time limit exceeded0/2289ms1360 KiB
20Time limit exceeded0/2289ms568 KiB
21Time limit exceeded0/2284ms1080 KiB
22Wrong answer0/275ms1268 KiB