Advertisement
nooobiiee

Untitled

Mar 26th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int t,n,ck=0,count=0;
  6. double arr[5]={0};
  7. double sum=0;
  8.  
  9. cin >> t;
  10.  
  11. while(t--)
  12. {
  13. cin >> n;
  14. arr[n]++;
  15. }
  16.  
  17. count = min(arr[1],arr[3]);
  18. arr[1] = arr[1] - count;
  19. arr[3] = arr[3] - count;
  20. count = count + arr[4] + arr[3];
  21. count = count + ceil((arr[1]+2*arr[2])/4.0) ;
  22. cout<<count;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement