125432024-12-21 17:39:47Gergo2122Virágos rét (50 pont)cpp17Wrong answer 5/5018ms1200 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n,k,db=0,s=0;
    cin>>n>>k;
    vector<int>r(n);
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        if(x==1) db++;
        r.push_back(x);
    }
    if(db<3) cout<<0;
    else if(db==3) cout<<1;
    else{
        int index=1;
        for(int i=3;i<=db;i++){
            s=s+index;
            index++;
        }
        cout<<s;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base5/50
1Accepted0/01ms320 KiB
2Accepted0/01ms508 KiB
3Wrong answer0/018ms1080 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/31ms320 KiB
8Accepted3/31ms320 KiB
9Wrong answer0/31ms356 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/31ms332 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/31ms380 KiB
14Wrong answer0/217ms1080 KiB
15Wrong answer0/217ms1084 KiB
16Wrong answer0/318ms1080 KiB
17Wrong answer0/317ms1080 KiB
18Wrong answer0/318ms1140 KiB
19Wrong answer0/318ms1200 KiB
20Wrong answer0/318ms1104 KiB
21Wrong answer0/318ms1100 KiB
22Wrong answer0/317ms1116 KiB