Submission #1209867

#TimeUsernameProblemLanguageResultExecution timeMemory
1209867talyProsjek (COCI18_prosjek)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> // #include <algorithm> using namespace std; int main() { int n; (void)scanf("%d", &n); vector<double> grades(n); for (int i=0; i < n; i++){ (void)scanf("%lf", &grades[i]); } sort(grades.begin(), grades.end()); double ultimo = grades[0]; for (int i=1; i < n; i++){ ultimo = (ultimo+grades[i])/2; } printf("%lf", ultimo); return 0; }

Compilation message (stderr)

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