242092026-02-06 12:51:43domdiridomdidomHőségriadó (50 pont)cpp17Wrong answer 8/5021ms508 KiB
#include <iostream>

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