242052026-02-06 12:39:09domdiridomdidomHőségriadó (50 pont)cpp17Wrong answer 0/5020ms508 KiB
#include <iostream>

int main() {
   int n, k, l, f;
   std::cin >> n >> k >> l >> f;
   int nr = 0, curStart = -1, curEnd = -1, prev;
   for(int i = 0; i < n; i++) {
      int x;
      std::cin >> x;
      if(x <= f && curEnd - curStart + 1 == l) {
         curStart = -1;
      }
      if(x > f) {
         if(curStart == -1) {
            curStart = i;
            curEnd = i;
         }
         else
            curEnd++;
      }
      if(curEnd - curStart + 1 == k)
         nr++;
   }
   std::cout << nr;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Wrong answer0/020ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/22ms316 KiB
6Wrong answer0/22ms316 KiB
7Wrong answer0/22ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/48ms404 KiB
10Wrong answer0/410ms508 KiB
11Wrong answer0/414ms400 KiB
12Wrong answer0/410ms316 KiB
13Wrong answer0/417ms500 KiB
14Wrong answer0/42ms500 KiB
15Wrong answer0/419ms400 KiB
16Wrong answer0/419ms404 KiB
17Wrong answer0/419ms404 KiB