5 solutions
-
-2
#include <bits/stdc++.h> using namespace std;
int main() { int n,x=0; int a[105]; while (1) { cin>>n; if(n==0) break;
for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int v = n / 2 + 1; int x = 0; for (int j = 0; j <=n/2; j++) { x = x + (a[j] /2+ 1); } cout << x << endl; } return 0;
}
Information
- ID
- 361
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 7
- Tags
- # Submissions
- 131
- Accepted
- 27
- Uploaded By