245162026-02-12 15:23:31tamasnagyFasor (40)cpp17Hibás válasz 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
RészfeladatÖsszpontTesztVerdiktIdőMemória
base0/40
1Elfogadva0/01ms316 KiB
2Hibás válasz0/02ms316 KiB
3Hibás válasz0/21ms316 KiB
4Hibás válasz0/21ms316 KiB
5Hibás válasz0/21ms316 KiB
6Hibás válasz0/21ms512 KiB
7Hibás válasz0/21ms336 KiB
8Hibás válasz0/21ms316 KiB
9Hibás válasz0/22ms316 KiB
10Hibás válasz0/22ms316 KiB
11Hibás válasz0/22ms316 KiB
12Hibás válasz0/23ms316 KiB
13Időlimit túllépés0/2254ms820 KiB
14Időlimit túllépés0/2287ms2356 KiB
15Időlimit túllépés0/2291ms1844 KiB
16Időlimit túllépés0/2275ms1588 KiB
17Időlimit túllépés0/2261ms1844 KiB
18Időlimit túllépés0/2261ms1352 KiB
19Időlimit túllépés0/2282ms1076 KiB
20Időlimit túllépés0/2298ms1076 KiB
21Időlimit túllépés0/2284ms1844 KiB
22Időlimit túllépés0/2284ms1332 KiB