Submission #122070


Source Code Expand

Copy
#include <cstdlib>
#include <cstring>
#include <memory>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)

#define FOR(x,to) for(x=0;x<to;x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
void _fill_int(int* p,int val,int rep) {int i;	FOR(i,rep) p[i]=val;}
#define FILL_INT(a,val) _fill_int((int*)a,val,sizeof(a)/4)
#define MINUS(a) _fill_int((int*)a,-1,sizeof(a)/4)
ll GETi() { ll i;scanf("%lld",&i); return i;}
//-------------------------------------------------------

int N,K;
int R[1000];

void solve() {
	int f,i,j,k,l,x,y;
	int N;
	
	cin>>N>>K;
	FOR(i,N) cin>>R[i];
	sort(R,R+N);
	
	double rr=0;
	FOR(i,K) rr=(rr+R[N-K+i])/2.0;
	_P("%.12lf\n",rr);
	
}


int main(int argc,char** argv){
	string s;
	for(int i=1;i<argc;i++) s+=argv[i],s+='\n';
	for(int i=s.size()-1;i>=0;i--) ungetc(s[i],stdin);
	solve();
	return 0;
}

Submission Info

Submission Time
Task C - AtCoderプログラミング講座
User kmjp
Language C++ (G++ 4.6.4)
Score 100
Code Size 1212 Byte
Status
Exec Time 36 ms
Memory 928 KB

Compile Error

./Main.cpp: In function ‘ll GETi()’:
./Main.cpp:29:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt
Case Name Status Exec Time Memory
00_sample_01.txt 23 ms 920 KB
00_sample_02.txt 20 ms 872 KB
00_sample_03.txt 19 ms 920 KB
00_sample_04.txt 19 ms 920 KB
test_01.txt 20 ms 920 KB
test_02.txt 24 ms 928 KB
test_03.txt 22 ms 892 KB
test_04.txt 21 ms 920 KB
test_05.txt 26 ms 812 KB
test_06.txt 22 ms 928 KB
test_07.txt 22 ms 924 KB
test_08.txt 22 ms 872 KB
test_09.txt 22 ms 924 KB
test_10.txt 24 ms 924 KB
test_11.txt 24 ms 920 KB
test_12.txt 24 ms 880 KB
test_13.txt 25 ms 848 KB
test_14.txt 30 ms 792 KB
test_15.txt 21 ms 844 KB
test_16.txt 19 ms 920 KB
test_17.txt 20 ms 920 KB
test_18.txt 36 ms 792 KB
test_19.txt 28 ms 796 KB
test_20.txt 24 ms 908 KB
test_21.txt 24 ms 908 KB
test_22.txt 24 ms 864 KB
test_23.txt 24 ms 880 KB
test_24.txt 24 ms 912 KB
test_25.txt 22 ms 780 KB
test_26.txt 22 ms 924 KB
test_27.txt 23 ms 916 KB
test_28.txt 23 ms 916 KB
test_29.txt 20 ms 920 KB
test_30.txt 24 ms 820 KB