제출 #604123

#제출 시각아이디문제언어결과실행 시간메모리
604123hyakupProsjek (COCI18_prosjek)C++17
50 / 50
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d", &n); multiset<double> s; for( int i = 0; i < n; i++){ double g; scanf("%lf", &g); s.insert(g); } multiset<double>::iterator it, it2; while( s.size() > 1 ){ it = s.begin(); it++; it2 = it; it--; s.insert(( *it + *it2 )/2 ); s.erase(it); s.erase(it2); } printf("%f", *(s.begin()) ); }

컴파일 시 표준 에러 (stderr) 메시지

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