fork(1) download
  1. #include <cstdio>
  2. #include <algorithm>
  3.  
  4. static const int N = 100;
  5.  
  6. int n, ans;
  7. int a[N];
  8.  
  9. int main() {
  10. freopen("input.txt", "rt", stdin);
  11. freopen("output.txt", "wt", stdout);
  12.  
  13. scanf("%d", &n);
  14.  
  15. for (int i = 0; i < n; i++)
  16. scanf("%d", &a[i]);
  17.  
  18. std::sort(a, a + n);
  19.  
  20. for (int i = 0; i <= n / 2; i++)
  21. ans += 1 + a[i] / 2;
  22.  
  23. printf("%d", ans);
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty