143962025-01-10 18:03:56Perso4444Járdakövezés (75 pont)cpp17Wrong answer 0/752ms628 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k; cin >> n >> k;
    int db = 0;
    for(int i = 0; i < n; i++){
        int x; cin >> x;
        db+=x;
    }
    int cnt = 0;
    for(int i = 1; i <= db; i++){
        if(i+k-1 <= db){
            for(int j = i+k-1; j <= db; j++){
                cnt++;
            }
        }
    }
    cout << cnt;
}
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/01ms316 KiB
2Wrong answer0/02ms508 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/31ms316 KiB
5Wrong answer0/31ms316 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/41ms316 KiB
10Wrong answer0/41ms316 KiB
11Wrong answer0/41ms316 KiB
12Wrong answer0/41ms332 KiB
13Wrong answer0/41ms316 KiB
14Wrong answer0/41ms316 KiB
15Wrong answer0/41ms548 KiB
16Wrong answer0/41ms500 KiB
17Wrong answer0/42ms496 KiB
18Wrong answer0/42ms316 KiB
19Wrong answer0/42ms508 KiB
20Wrong answer0/42ms316 KiB
21Wrong answer0/42ms628 KiB
22Wrong answer0/42ms556 KiB