119102024-11-19 18:49:16banhelyiVirágos rét (50 pont)cpp11Wrong answer 0/5018ms552 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    int k;
    int szam;
    int ja;
    int j=0;
    cin >> n;
    cin >> k;
    for(int i=0; i < n; i++){
        cin >> j;
        ja += j;
    }
    int jo=ja*(ja-1)/2-(ja-1)*(k-2)+(k-2)*(k-3)/2;
    cout << jo << "\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Wrong answer0/018ms320 KiB
4Wrong answer0/21ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms500 KiB
7Wrong answer0/31ms352 KiB
8Wrong answer0/31ms320 KiB
9Wrong answer0/31ms320 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/31ms320 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/31ms552 KiB
14Wrong answer0/217ms400 KiB
15Wrong answer0/217ms400 KiB
16Wrong answer0/318ms404 KiB
17Wrong answer0/317ms408 KiB
18Wrong answer0/318ms400 KiB
19Wrong answer0/317ms508 KiB
20Wrong answer0/317ms404 KiB
21Wrong answer0/318ms508 KiB
22Wrong answer0/317ms404 KiB