83312024-01-14 18:23:12asdasd123Virágos rét (50 pont)cpp17Wrong answer 9/5010ms4184 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 - k)*(cnt - k + 1)/2;
    
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Wrong answer0/03ms1928 KiB
2Accepted0/03ms2148 KiB
3Wrong answer0/09ms2380 KiB
4Wrong answer0/23ms2576 KiB
5Accepted2/23ms2808 KiB
6Accepted2/23ms2716 KiB
7Wrong answer0/33ms2932 KiB
8Accepted3/33ms3020 KiB
9Wrong answer0/33ms3020 KiB
10Wrong answer0/23ms3244 KiB
11Wrong answer0/33ms3376 KiB
12Wrong answer0/23ms3572 KiB
13Wrong answer0/33ms3808 KiB
14Accepted2/28ms3548 KiB
15Wrong answer0/28ms3548 KiB
16Wrong answer0/39ms3676 KiB
17Wrong answer0/39ms3760 KiB
18Wrong answer0/310ms3888 KiB
19Wrong answer0/39ms3968 KiB
20Wrong answer0/39ms3972 KiB
21Wrong answer0/39ms4104 KiB
22Wrong answer0/39ms4184 KiB