Submission #165503

#TimeUsernameProblemLanguageResultExecution timeMemory
165503itiamProsjek (COCI18_prosjek)C++11
50 / 50
2 ms424 KiB
#include <ctime> #include <cstdio> #include <iostream> #include <algorithm> using namespace std; int main() { int N; double L[22],x; cin >> N; for (int i=0;i<N;i++){ cin >> x; L[i]=x; } sort(L,L+N); //ispis(L,N); double a,b; int y; for (int i=0;i<N-1;i++){ a=L[i]; b=L[i+1]; L[i+1]=(a+b)/2.0; y=i+1; } cout << L[y]; return 0; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:20:9: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int y;
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...