Submission #146951

#TimeUsernameProblemLanguageResultExecution timeMemory
146951ronaldo_kProsjek (COCI18_prosjek)C++14
50 / 50
2 ms380 KiB
#include <stdio.h> #include <algorithm> using namespace std; const int MAXN = 30; int n; double v[MAXN]; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%lf", &v[i]); } sort(v, v + n); for(int i = 1; i < n; i++) { v[i] = (v[i] + v[i-1])/2; } printf("%.6lf\n", v[n-1]); }

Compilation message (stderr)

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