#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long LL;
const int maxn=2*1e5+5;
char s[maxn];
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
int k1=a,k2=b;
scanf("%s",s);
int pos;
if(a>=b) pos=1; //使得先放的是人数多的一方
else pos=0;
for(int i=0;s[i];i++)
{
if(s[i]=='.') {
if(pos==1&&a>0) a--;
else if(pos==0&&b>0) b--;
pos=1-pos; //两次填放的人从事职业不同
}
else { //指出下一次填放中哪一方的人数更多
if(a>=b) pos=1;
else pos=0;
}
}
LL sum=0;
cout<<sum+(k1-a)+(k2-b)<<endl;
return 0;
}
Codeforces Educational Codeforces Round 42 (Rated for Div. 2) B. Students in Railway Carriage 填放人数
最新推荐文章于 2020-08-05 19:10:05 发布