86762024-01-25 10:29:55qertendVirágos rét (50 pont)cpp17Wrong answer 42/5019ms4200 KiB
#include <iostream>
using namespace std;

/**
 * Fails on njduge tests 15, 18, 22
*/
int main()
{
    int retekSzama, K;
    cin >> retekSzama;
    cin >> K;

    int 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/03ms1748 KiB
2Accepted0/03ms2064 KiB
3Accepted0/019ms1996 KiB
4Accepted2/22ms2068 KiB
5Accepted2/22ms2060 KiB
6Accepted2/23ms2064 KiB
7Accepted3/33ms2356 KiB
8Accepted3/33ms2476 KiB
9Accepted3/33ms2732 KiB
10Accepted2/23ms2740 KiB
11Accepted3/33ms2944 KiB
12Accepted2/23ms3016 KiB
13Accepted3/33ms3208 KiB
14Accepted2/218ms3416 KiB
15Wrong answer0/218ms3536 KiB
16Accepted3/319ms3668 KiB
17Accepted3/318ms3708 KiB
18Wrong answer0/319ms3712 KiB
19Accepted3/318ms3716 KiB
20Accepted3/318ms3868 KiB
21Accepted3/319ms3988 KiB
22Wrong answer0/318ms4200 KiB