242082026-02-06 12:49:59domdiridomdidomHőségriadó (50 pont)cpp17Wrong answer 6/5021ms504 KiB
#include <iostream>

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