143722025-01-10 17:42:12MittomenDNS szakaszok száma (75 pont)cpp17Wrong answer 3/752ms540 KiB
#include <list>
#include <iostream>
#include <vector>
#include <bitset>
#include <algorithm>

using namespace std;

int main() {

    int n, k;
    cin >> n >> k;

    int true_fields = 0;
    int sol = 0;
    for (int i = 0; i < n; i++) {
        bool field;
        cin >> field;

        if (field) {
            true_fields++;
            if (true_fields >= k) sol += true_fields - k + 1;
        }
    }

    cout << sol;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/75
1Wrong answer0/01ms316 KiB
2Wrong answer0/02ms316 KiB
3Accepted3/31ms316 KiB
4Wrong answer0/41ms316 KiB
5Wrong answer0/41ms328 KiB
6Wrong answer0/41ms316 KiB
7Wrong answer0/41ms336 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/41ms316 KiB
11Wrong answer0/41ms316 KiB
12Wrong answer0/41ms316 KiB
13Wrong answer0/41ms508 KiB
14Wrong answer0/41ms508 KiB
15Wrong answer0/32ms316 KiB
16Wrong answer0/42ms508 KiB
17Wrong answer0/42ms396 KiB
18Wrong answer0/42ms540 KiB
19Wrong answer0/42ms316 KiB
20Wrong answer0/42ms316 KiB
21Wrong answer0/32ms500 KiB
22Wrong answer0/42ms316 KiB