Submission #86836

#TimeUsernameProblemLanguageResultExecution timeMemory
86836jovitreProsjek (COCI18_prosjek)C++14
50 / 50
2 ms672 KiB
#include <bits/stdc++.h> using namespace std; #define MAXN 25 #define MAXSZ 2050 #define INF 999999999 #define pb push_back typedef long long ll; typedef pair <int, int> pii; typedef vector <ll> vi; int in[MAXN]; int main(){ int n; scanf("%d", &n); for(int i = 1; i <= n; i++) scanf("%d", in + i); sort(in + 1, in + n + 1); if(n == 1) printf("%d\n", in[1]); else { double atual = (double)(in[1] + in[2]) / 2.00; for(int i = 3; i <= n; i++) atual = (double)(atual + in[i]) / 2.00; printf("%lf\n", atual); } return 0; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
prosjek.cpp:20:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 1; i <= n; i++) scanf("%d", in + i);
                              ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...