14322022-09-30 13:27:14mraronGyros (30)cpp17Wrong answer 15/303ms3700 KiB
#include<bits/stdc++.h>
using namespace std;

int main() {
    int T;
    cin>>T;
    while(T--) {
        int n,c,b;
        cin>>n>>c>>b;
        string s;
        cin>>s;
        int cntV=0, cntC=0, cntB=0;
        for(char c:s) {
            if(c=='V') cntV++;
            if(c=='C') cntC++;
            if(c=='B') cntB++;
        }
        
        int ans=0;
        for(int v=0;v<=cntV;++v) {
            ans=max(ans, v+min((c-v)/2, cntC)+min((b-v)/2, cntB));
        }
        
        cout<<ans<<"\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base15/30
1Accepted0/03ms1816 KiB
2Accepted0/03ms2024 KiB
3Accepted2/22ms2216 KiB
4Wrong answer0/22ms2428 KiB
5Accepted2/22ms2800 KiB
6Wrong answer0/32ms2644 KiB
7Wrong answer0/32ms2732 KiB
8Accepted3/32ms2836 KiB
9Wrong answer0/22ms2912 KiB
10Wrong answer0/22ms3036 KiB
11Accepted2/22ms3136 KiB
12Accepted3/32ms3220 KiB
13Accepted3/33ms3516 KiB
14Wrong answer0/33ms3700 KiB