We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6894782 commit f9e70beCopy full SHA for f9e70be
atcoder/abc003/C/main.cpp
@@ -0,0 +1,25 @@
1
+#include <bits/stdc++.h>
2
+
3
+using namespace std;
4
+using ll = int64_t;
5
+using ff = long double;
6
7
+int main() {
8
+ ios_base::sync_with_stdio(false);
9
+ cin.tie(0); cout.tie(0);
10
11
+ int N, K;
12
+ vector<int> R;
13
14
+ cin >> N >> K;
15
+ R.assign(N, 0);
16
+ for (auto &r : R) cin >> r;
17
+ sort(R.begin(), R.end());
18
+ ff rate = 0;
19
+ for (int i = N - K; i < N; ++i) {
20
+ rate = (rate + R[i]) / 2;
21
+ }
22
+ cout << fixed << setprecision(7) << rate << endl;
23
24
+ return 0;
25
+}
0 commit comments