Submission #647231

# Submission time Handle Problem Language Result Execution time Memory
647231 2022-10-02T03:04:33 Z mr_robot_545 Prosjek (COCI18_prosjek) C++17
0 / 50
2 ms 596 KB

#include<bits/stdc++.h>
using namespace std;
void solve(){
    int n;
   cin>>n;
   vector<double>v1(n),v2;
    for (int i = 0; i <n ; ++i) {
        cin>>v1[i];
    }
    sort(v1.begin(),v1.end());
    double ans=v1[0];
    for (int i = 1; i <n ; ++i) {
        ans=(ans+v1[i])/2;

    }
    cout<<fixed<<setprecision(6)<<ans<<endl;
}
int main() {
    cin.tie(0)->sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
//    w{
         solve();
//    }

    return 0;
}
// QAQGDQAQhdfj

Compilation message

prosjek.cpp: In function 'int main()':
prosjek.cpp:23:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |     freopen("in.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
prosjek.cpp:24:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     freopen("out.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 596 KB Execution killed with signal 11
2 Runtime error 2 ms 468 KB Execution killed with signal 11
3 Runtime error 2 ms 596 KB Execution killed with signal 11
4 Runtime error 2 ms 596 KB Execution killed with signal 11
5 Runtime error 2 ms 468 KB Execution killed with signal 11
6 Runtime error 2 ms 536 KB Execution killed with signal 11
7 Runtime error 2 ms 468 KB Execution killed with signal 11
8 Runtime error 2 ms 468 KB Execution killed with signal 11
9 Runtime error 2 ms 468 KB Execution killed with signal 11
10 Runtime error 2 ms 596 KB Execution killed with signal 11