ThaiPeen

timus 1025

May 24th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<string>
  4. #include<vector>
  5. #include<algorithm>
  6. using namespace std;
  7. int a[101];
  8. int main(){
  9.     int n, cnt = 0;
  10.     cin >> n;
  11.     for (int i = 0; i < n; i++) {
  12.         cin >> a[i];
  13.     }
  14.     sort(a, a + n);
  15.     for (int i = 0; i < n / 2 + 1; i++) {
  16.         cnt += a[i] / 2 + 1;
  17.     }
  18.     cout << cnt;
  19.     system("pause");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment