Submission #74989

#TimeUsernameProblemLanguageResultExecution timeMemory
74989LawlietProsjek (COCI18_prosjek)C++14
50 / 50
3 ms632 KiB
#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 (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: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 timeMemoryGrader output
Fetching results...