Submission #948896

#TimeUsernameProblemLanguageResultExecution timeMemory
948896andrei_marciucProsjek (COCI18_prosjek)C++14
50 / 50
1 ms408 KiB
#include <cstdio> short n, a[5], i; double r; int main() { scanf("%hd", &n); while (n--) { scanf("%hd", &i); a[--i]++; } for (i = 0; !a[i]; i++); r = ++i; while (true) { while (i < 5 && !a[i]) i++; if (i > 4) break; r = (r + i + 1) / 2.0; a[i]--; } printf("%lf", r); return 0; }

Compilation message (stderr)

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