比赛 名字我取了 评测结果 AAAAAAAAAA
题目名称 餐馆的桌子 最终得分 100
用户昵称 @@@ 运行时间 0.004 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2017-09-15 19:13:19
显示代码纯文本
  1. #include <fstream>
  2. #include <vector>
  3. #include <stdlib.h>
  4. #include <time.h>
  5. using namespace std;
  6. ifstream cin("RT.in");
  7. ofstream cout("RT.out");
  8.  
  9. int n,a,t, b_emp,b_o,ans = 0;
  10.  
  11. int cyf()
  12. {
  13. int i,j,k;
  14. cin >> n >> a >> b_emp;
  15. for(i = 1;i <= n;i++)
  16. {
  17. cin >> t;
  18. if(t == 1)
  19. {
  20. if(a >= 1)
  21. {
  22. a--;
  23. continue;
  24. }
  25. else if(a == 0&&b_emp >= 1)
  26. {
  27. b_emp--;
  28. b_o++;
  29. continue;
  30. }
  31. else if(a == 0&&b_o >= 1)
  32. {
  33. b_o--;
  34. continue;
  35. }
  36. }
  37. if(t == 2 && b_emp >= 1)
  38. {
  39. b_emp--;
  40. continue;
  41. }
  42. ans += t;
  43. }
  44. cout << ans << endl;
  45. cin.close();
  46. cout.close();
  47. return 0;
  48. }
  49. int hhhh = cyf();
  50. int main() {;}