83302024-01-14 18:22:29asdasd123Virágos rét (50 pont)cpp17Wrong answer 9/509ms3624 KiB
#include <bits/stdc++.h>

using ll = long long;

using namespace std;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int n, k;
    cin >> n >> k;
    int cnt = 0;
    for (int i = 0; i < n; i++)
    {
        ll x;
        cin >> x;
        cnt += x;
    }
    if (k > cnt) cout << 0;
    else if (k == cnt) cout << 1;
    else cout << (cnt - 2)*(cnt-1)/2;
    
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/03ms1892 KiB
2Accepted0/03ms2080 KiB
3Wrong answer0/09ms2448 KiB
4Wrong answer0/23ms2512 KiB
5Accepted2/23ms2524 KiB
6Accepted2/23ms2524 KiB
7Wrong answer0/33ms2652 KiB
8Accepted3/33ms2740 KiB
9Wrong answer0/33ms2868 KiB
10Wrong answer0/23ms3032 KiB
11Wrong answer0/33ms3132 KiB
12Wrong answer0/23ms3132 KiB
13Wrong answer0/33ms3356 KiB
14Accepted2/28ms3448 KiB
15Wrong answer0/28ms3344 KiB
16Wrong answer0/39ms3348 KiB
17Wrong answer0/39ms3348 KiB
18Wrong answer0/39ms3624 KiB
19Wrong answer0/39ms3612 KiB
20Wrong answer0/39ms3612 KiB
21Wrong answer0/39ms3544 KiB
22Wrong answer0/39ms3544 KiB