Submission #122502


Source Code Expand

Copy
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	int N,K;
	cin >> N >> K;
	int* R = new int[N];
	for(int i=0; i<N; i++) {
		cin >> R[i];
	}
	sort(R, R+N);
	double result = 0;
	for(int t=0; t<K; t++) {
		result = (result + R[N-K+t]) / 2.0;
	}
	cout << fixed << setprecision(9) << result << endl;
	return 0;
}

Submission Info

Submission Time
Task C - AtCoderプログラミング講座
User Tachiken
Language C++ (G++ 4.6.4)
Score 0
Code Size 354 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:13: error: ‘sort’ was not declared in this scope