233542026-01-20 13:32:20mihalykocsisVölgy (100 pont)cpp17Wrong answer 30/100300ms1432 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector<int> m(n);
	for (int i = 0; i < n; i++) cin >> m[i];
	int ans = 0;
	bool correct = true;
	for (int i = 2; i < n; i++) {
		for (int j = 0; j < n - i; j++) {
			correct = true;
			int a = m[j];
			int b = m[j + i];
			for (int k = j + 1; k < j + i; k++) {
				if (m[k] >= a || m[k] >= b) {
					correct = false;
				}
			}
			if (correct) {
				ans = i;
				break;
			}
		}
	}
	cout << ans;
}
SubtaskSumTestVerdictTimeMemory
base30/100
1Accepted0/01ms316 KiB
2Accepted0/0122ms316 KiB
3Accepted5/51ms508 KiB
4Accepted5/51ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Wrong answer0/51ms316 KiB
8Accepted5/51ms316 KiB
9Wrong answer0/5123ms316 KiB
10Accepted5/5122ms404 KiB
11Time limit exceeded0/5300ms420 KiB
12Time limit exceeded0/5284ms316 KiB
13Time limit exceeded0/5270ms316 KiB
14Time limit exceeded0/5272ms316 KiB
15Time limit exceeded0/5282ms1076 KiB
16Time limit exceeded0/5282ms564 KiB
17Time limit exceeded0/5298ms564 KiB
18Time limit exceeded0/5298ms1144 KiB
19Time limit exceeded0/5284ms1076 KiB
20Time limit exceeded0/5284ms1432 KiB
21Time limit exceeded0/5300ms564 KiB
22Time limit exceeded0/5300ms564 KiB