如果输入中所有的t都是1那么bad的值一定为()。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, a, b, c=0, bad=0;
cin >> n >> a >> b;
for(int i = 1; i <= n; i++)
{
int t;
cin >> t;
if(t == 1)
{
if(a) a--;
else if(b) b--, c++;
else if(c) c--;
else bad++;
}
else
{
if(b) b--;
else bad += 2;
}
}
cout << bad << endl;
return 0;
}
max(0,a +2*b)
max(0,n-a-b)
max(0,a +2*b-n)
max(0, n-a-2*b)