84652024-01-16 21:28:50zoliVirágos rét (50 pont)cpp17Wrong answer 42/5019ms4504 KiB
#include <iostream>

using namespace std;
int N, K;
int db1=0; //1-ek szama
long long ered=0;
void be()
{
    cin>>N>>K;
    short x=0;
    for(int i=1;i<=N;i++)
    {
        cin>>x;
        db1+=x;
    }
}

int main()
{
    be();
    if(db1>=K) ered=(db1-K+1)*(db1-K+2)/2;
    cout<<ered;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2128 KiB
3Accepted0/019ms2360 KiB
4Accepted2/23ms2416 KiB
5Accepted2/23ms2604 KiB
6Accepted2/23ms2816 KiB
7Accepted3/33ms3056 KiB
8Accepted3/33ms3160 KiB
9Accepted3/33ms3232 KiB
10Accepted2/23ms3408 KiB
11Accepted3/33ms3568 KiB
12Accepted2/23ms3576 KiB
13Accepted3/33ms3576 KiB
14Accepted2/218ms3704 KiB
15Wrong answer0/218ms3812 KiB
16Accepted3/319ms3932 KiB
17Accepted3/318ms3992 KiB
18Wrong answer0/319ms4252 KiB
19Accepted3/319ms4244 KiB
20Accepted3/319ms4420 KiB
21Accepted3/319ms4504 KiB
22Wrong answer0/319ms4504 KiB