Submission #603287

#TimeUsernameProblemLanguageResultExecution timeMemory
603287LucaGregProsjek (COCI18_prosjek)C++17
50 / 50
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { int n; scanf("%d", &n); for(int i=0;i<n;i++){ int vi; scanf("%d", &vi); v.push_back(vi); } sort(v.begin(), v.end()); double m = v[0]; for(int i=1;i<=n-1;i++){ m = (m + v[i])/2; } printf("%f", m); return 0; }

Compilation message (stderr)

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