标签:
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int bowl,plate; int n; int dish[1100]; int main() { int i,j; while(scanf("%d%d%d",&n,&bowl,&plate)!=EOF) { int ans=0; for(i=1;i<=n;i++) { scanf("%d",&dish[i]); } for(i=1;i<=n;i++) { if(dish[i]==1) { if(bowl>0) { bowl--; } else if(bowl==0) { ans++; } } else if(dish[i]==2) { if(plate>0) { plate--; } else if(bowl>0) { bowl--; } else { ans++; } } } printf("%d\n",ans); } return 0; }
CodeForces 369A Valera and Plates( 水)
标签:
原文地址:http://www.cnblogs.com/sola1994/p/4180754.html