132802025-01-07 12:00:03mateHőségriadó (50 pont)cpp17Wrong answer 6/5023ms756 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,l,k,f;
	cin >> n >> k >> l >> f;
	vector <int> v(n);
	int kc=0,lc=0;
	int ksum=0,lsum=0;
	for (int i = 0; i < n; i++){
		cin >> v[i];
		if(v[i] > f){
			kc++;
			lc = 0; 
		}else if(v[i] < f){
			lc++;
			kc = 0;
		}
		if(kc >= k){
			ksum++;
		}
		if(lc >= l){
			lsum++;
		}
		
	}
	cout << ksum;
	
	
	
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/01ms316 KiB
2Wrong answer0/023ms568 KiB
3Wrong answer0/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/21ms508 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/49ms572 KiB
10Wrong answer0/412ms604 KiB
11Wrong answer0/414ms756 KiB
12Wrong answer0/412ms604 KiB
13Wrong answer0/418ms564 KiB
14Wrong answer0/43ms316 KiB
15Wrong answer0/420ms564 KiB
16Wrong answer0/421ms564 KiB
17Wrong answer0/420ms564 KiB