98692024-03-13 16:33:56VargusVirágos rét (50 pont)cpp17Wrong answer 4/5020ms6184 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int rek(ll n)
{
    if (n == 0)
        return 0;
    return n + rek(n - 1);
}

ll db;
int main()
{
    ll n, m, k;
    cin >> n >> m;
    vector <ll> a;
    for (ll i = 1; i <= n; ++i)
    {
        cin >> k;
        if (k == 1)
            a.push_back(k);
    }
    ll koz;
    for (ll i = 0; i < a.size(); ++i)
    {
        koz = a.size() / 2 + i;
        for (ll j = koz; j < a.size(); ++j)
            ++db;
    }
    if (db >= m)
        cout << db;
    else
        cout << "0";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Accepted0/03ms1956 KiB
2Accepted0/03ms2008 KiB
3Wrong answer0/019ms2684 KiB
4Wrong answer0/22ms2264 KiB
5Accepted2/23ms2520 KiB
6Accepted2/23ms2628 KiB
7Wrong answer0/32ms2656 KiB
8Wrong answer0/33ms2740 KiB
9Wrong answer0/33ms2948 KiB
10Wrong answer0/23ms3072 KiB
11Wrong answer0/33ms3084 KiB
12Wrong answer0/23ms3280 KiB
13Wrong answer0/33ms3384 KiB
14Wrong answer0/219ms5488 KiB
15Wrong answer0/219ms5492 KiB
16Wrong answer0/320ms4972 KiB
17Wrong answer0/319ms4480 KiB
18Wrong answer0/320ms5976 KiB
19Wrong answer0/319ms3960 KiB
20Wrong answer0/320ms6108 KiB
21Wrong answer0/320ms5288 KiB
22Wrong answer0/320ms6184 KiB