Submission #74989

# Submission time Handle Problem Language Result Execution time Memory
74989 2018-09-08T00:07:59 Z Lawliet Prosjek (COCI18_prosjek) C++14
50 / 50
3 ms 632 KB
#include <bits/stdc++.h>
#define MAX 25
using namespace std;
int n,v[MAX];
double resp;
int main()
{
	scanf("%d",&n);
	for(int g = 0 ; g < n ; g++) scanf("%d",&v[g]);
	sort(v,v+n);
	resp = v[0];
	for(int g = 1 ; g < n ; g++) resp = (resp + v[g])/2;
	printf("%.6f",resp);
}

Compilation message

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:9:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int g = 0 ; g < n ; g++) scanf("%d",&v[g]);
                               ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 360 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 400 KB Output is correct
4 Correct 2 ms 420 KB Output is correct
5 Correct 3 ms 420 KB Output is correct
6 Correct 2 ms 420 KB Output is correct
7 Correct 2 ms 420 KB Output is correct
8 Correct 2 ms 420 KB Output is correct
9 Correct 2 ms 420 KB Output is correct
10 Correct 2 ms 632 KB Output is correct