Submission #770527

#TimeUsernameProblemLanguageResultExecution timeMemory
770527enzyProsjek (COCI18_prosjek)C++14
50 / 50
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; int v[21]; int main() { int n; scanf("%d", &n); for(int i=0;i<n;i++) scanf("%d", &v[i]); sort(v,v+n); float f=v[0]; for(int i=1;i<n;i++){ f=(f+v[i])/2; } printf("%f", f); return 0; }

Compilation message (stderr)

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