85562024-01-21 21:08:09qertendVirágos rét (50 pont)cpp17Wrong answer 42/5020ms4352 KiB
#include <iostream>
using namespace std;

int main()
{
    int retekSzama, K;
    cin >> retekSzama;
    cin >> K;

    long szabadRetek = 0;
    int ret;
    for (int i = 0; i < retekSzama; i++) {
        cin >> ret;
        szabadRetek += ret;
    }
    int N = szabadRetek-K+1;
    if (szabadRetek >= K) cout << (N)*(N+1)/2;
    else cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/03ms1900 KiB
2Accepted0/03ms2124 KiB
3Accepted0/019ms2236 KiB
4Accepted2/23ms2340 KiB
5Accepted2/23ms2528 KiB
6Accepted2/23ms2740 KiB
7Accepted3/33ms2852 KiB
8Accepted3/33ms3072 KiB
9Accepted3/33ms3068 KiB
10Accepted2/23ms3072 KiB
11Accepted3/33ms3188 KiB
12Accepted2/23ms3272 KiB
13Accepted3/33ms3404 KiB
14Accepted2/218ms3760 KiB
15Wrong answer0/218ms3704 KiB
16Accepted3/319ms3708 KiB
17Accepted3/319ms3832 KiB
18Wrong answer0/320ms4104 KiB
19Accepted3/319ms4072 KiB
20Accepted3/319ms4064 KiB
21Accepted3/320ms4352 KiB
22Wrong answer0/319ms4348 KiB