86232024-01-23 20:57:02CsongiVirágos rét (50 pont)cpp17Wrong answer 2/5020ms4120 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;


int main()
{
    int n, k;
    cin >> n >> k;
    bool talalt = false;
    int szam = 0;
    int bonusz = 0;
    for (int i = 0; i < n; i++)
    {
        bool most;
        cin >> most;
        if (most)
        {
            szam++;
        }
    }
    for (int i = 0; i < szam-k; i++)
    {
        bonusz = bonusz + i;
    }
    
    cout << szam+bonusz;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/03ms1880 KiB
2Wrong answer0/03ms2084 KiB
3Wrong answer0/020ms2200 KiB
4Wrong answer0/23ms2400 KiB
5Accepted2/23ms2612 KiB
6Wrong answer0/23ms2824 KiB
7Wrong answer0/33ms3036 KiB
8Wrong answer0/32ms3124 KiB
9Wrong answer0/32ms3116 KiB
10Wrong answer0/23ms3252 KiB
11Wrong answer0/33ms3332 KiB
12Wrong answer0/23ms3448 KiB
13Wrong answer0/33ms3460 KiB
14Wrong answer0/218ms3576 KiB
15Wrong answer0/219ms3576 KiB
16Wrong answer0/320ms3820 KiB
17Wrong answer0/319ms3816 KiB
18Wrong answer0/320ms3884 KiB
19Wrong answer0/320ms4120 KiB
20Wrong answer0/320ms4112 KiB
21Wrong answer0/320ms4116 KiB
22Wrong answer0/319ms4112 KiB