Submission #132190

#TimeUsernameProblemLanguageResultExecution timeMemory
132190robsProsjek (COCI18_prosjek)C++14
50 / 50
2 ms380 KiB
#include <bits/stdc++.h>
using namespace std;
const int maxn=7654321;
int n;
float v[maxn];

int main(){
	scanf("%d",&n);
	for(int x=0;x<n;x++){
		scanf("%f",&v[x]);
	}
	sort(v,v+n);
	for(int x=1;x<n;x++){
		v[x]=(v[x]+v[x-1])/2;
	}
	printf("%.6f",v[n-1]);
}

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
prosjek.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%f",&v[x]);
   ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...