Codeforces Round #216 (Div. 2)A. Valera and Plates

#include <iostream>

using namespace std;

int main(){
    int n, m , k;
    cin >> n >> m >> k;
    int first_type = 0, second_type = 0;
    for(int i = 0 ;  i < n ; ++ i){
        int a;
        cin >> a;
        (a == 1) ? first_type++ : second_type ++ ;
    }
    int wash_number = 0;
    if(first_type - m  >= 0 ){
        wash_number = first_type - m;
        m = 0;
    }else{
        m -=first_type;
    }
    if(second_type - m > 0){
        second_type-=m;
        wash_number += (second_type-k > 0 ? second_type-k : 0);
    }
    cout<<wash_number<<endl;
}

 

posted @ 2014-03-15 15:48  OpenSoucre  阅读(222)  评论(0编辑  收藏  举报