143992025-01-10 18:05:26JoKoBoVirágos rét (50 pont)cpp17Wrong answer 0/5018ms508 KiB
#include<bits/stdc++.h>
using namespace std;

int main() {
    int n = 0, k = 0;
    cin >> n >> k;
    int ret = 0;
    int cincin = 0;
    for(int i = 0; i < n; i++) {
        cin >> cincin;
        ret += cincin;
    }
    //Brainbox
    //osszeadni a szamokat k-tol ret-ig
    int result = 0;
    for(int i = k; i <= n; i++) {
        result += i;
    }
    //Ez a legegyszerûbb módja. De nem biztos, hogy az a nyerõ...
    //GAUSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //if((ret-k) % 2 == 1) {
    //    result += (ret-k)/2;
    //}
    cout << result;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms500 KiB
2Wrong answer0/01ms508 KiB
3Wrong answer0/017ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms384 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/217ms508 KiB
15Wrong answer0/217ms400 KiB
16Wrong answer0/318ms508 KiB
17Wrong answer0/317ms316 KiB
18Wrong answer0/318ms500 KiB
19Wrong answer0/317ms500 KiB
20Wrong answer0/317ms396 KiB
21Wrong answer0/317ms400 KiB
22Wrong answer0/317ms396 KiB