86802024-01-25 10:41:15qertendVirágos rét (50 pont)cpp17Wrong answer 42/5020ms4496 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;
    bool ret;
    for (int i = 0; i < retekSzama; i++) {
        cin >> ret;
        szabadRetek += ret;
    }
    int N = szabadRetek-K+1;
    if (N >= 0) cout << (N)*(N+1)/2 << "\n";
    else cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/03ms1880 KiB
2Accepted0/03ms2112 KiB
3Accepted0/019ms2360 KiB
4Accepted2/23ms2536 KiB
5Accepted2/23ms2752 KiB
6Accepted2/23ms2968 KiB
7Accepted3/33ms3208 KiB
8Accepted3/33ms3296 KiB
9Accepted3/33ms3420 KiB
10Accepted2/22ms3508 KiB
11Accepted3/33ms3508 KiB
12Accepted2/23ms3908 KiB
13Accepted3/33ms3896 KiB
14Accepted2/218ms3984 KiB
15Wrong answer0/218ms3988 KiB
16Accepted3/320ms3960 KiB
17Accepted3/319ms4084 KiB
18Wrong answer0/320ms4144 KiB
19Accepted3/319ms4352 KiB
20Accepted3/319ms4464 KiB
21Accepted3/320ms4384 KiB
22Wrong answer0/319ms4496 KiB