209502026-01-11 19:13:01RCSVölgy (100 pont)cpp17Wrong answer 15/100300ms1352 KiB
#include <iostream>

using namespace std;

int main()
{
    int van_volgy=0;
    int maxh=0;
    int N;
    cin >> N;
    int T[N+1]; // T[1]-tol t[N]-ig hasznalom
    for(int i=1; i<=N; i++) cin >> T[i];
    for(int h=N; h>=3; h--)
    {
        for(int i=1; i<=N-h+1; i++)
        {
            int volgy=1;
            for(int j=i+1; j<i+h; j++)
                if (T[j]>=T[i] or T[j]>=T[i+h])
                {
                    volgy=0;
                }
            if (volgy)
            {
                cout << h;
                return 0;
            }
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/100
1Accepted0/01ms316 KiB
2Wrong answer0/046ms508 KiB
3Wrong answer0/51ms316 KiB
4Accepted5/51ms508 KiB
5Accepted5/51ms316 KiB
6Wrong answer0/51ms316 KiB
7Wrong answer0/51ms316 KiB
8Accepted5/51ms316 KiB
9Wrong answer0/51ms316 KiB
10Time limit exceeded0/5300ms316 KiB
11Time limit exceeded0/5300ms564 KiB
12Time limit exceeded0/5298ms316 KiB
13Time limit exceeded0/5298ms416 KiB
14Time limit exceeded0/5275ms508 KiB
15Time limit exceeded0/5277ms564 KiB
16Time limit exceeded0/5300ms612 KiB
17Time limit exceeded0/5300ms564 KiB
18Time limit exceeded0/5284ms820 KiB
19Time limit exceeded0/5287ms1076 KiB
20Time limit exceeded0/5300ms1352 KiB
21Time limit exceeded0/5300ms564 KiB
22Time limit exceeded0/5291ms564 KiB