fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. bool arr[1006];
  4. int main()
  5. {
  6. int n,m,k,num_wesh=0,l;
  7. scanf("%d %d %d",&n,&m,&k);
  8.  
  9. for(int i=0; i<n; ++i)
  10. {
  11. cin>>l;
  12. l--;
  13. arr[i]=l;
  14. }
  15.  
  16. for(int i=0; i<n; ++i)
  17. {
  18. if(arr[i])
  19. {
  20.  
  21. if(k)
  22. k--;
  23. else if(m)
  24. m--;
  25. else
  26. num_wesh++;
  27. }
  28. else
  29. {
  30. if(m)
  31. m--;
  32.  
  33. else
  34. num_wesh++;
  35.  
  36. }
  37. }
  38. printf("%d",num_wesh);
  39.  
  40.  
  41.  
  42.  
  43. return 0;
  44. }
  45.  
Runtime error #stdin #stdout 0s 4184KB
stdin
Standard input is empty
stdout
Standard output is empty