245162026-02-12 15:23:31tamasnagyFasor (40)cpp17Wrong answer 0/40298ms2356 KiB
// fak.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int>fah;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;
    cin >> n >> k;
    fah.resize(n+2*k+2);
    for (int i = k; i < n+k; i++) {
        cin >> fah[i];
    }
    for (int i = k; i < n+k; i++) {
        bool b = 0;
        for (int j = i-k; j < i+k; j++) {
            if (fah[j] > fah[i]) {
                b = 1;
                break;
            }
        }
        if (!b) {
            cout << i+1;
            break;
        }
    }
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/01ms316 KiB
2Wrong answer0/02ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms512 KiB
7Wrong answer0/21ms336 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/22ms316 KiB
10Wrong answer0/22ms316 KiB
11Wrong answer0/22ms316 KiB
12Wrong answer0/23ms316 KiB
13Time limit exceeded0/2254ms820 KiB
14Time limit exceeded0/2287ms2356 KiB
15Time limit exceeded0/2291ms1844 KiB
16Time limit exceeded0/2275ms1588 KiB
17Time limit exceeded0/2261ms1844 KiB
18Time limit exceeded0/2261ms1352 KiB
19Time limit exceeded0/2282ms1076 KiB
20Time limit exceeded0/2298ms1076 KiB
21Time limit exceeded0/2284ms1844 KiB
22Time limit exceeded0/2284ms1332 KiB