Submission #647228

# Submission time Handle Problem Language Result Execution time Memory
647228 2022-10-02T03:02:19 Z mr_robot_545 Prosjek (COCI18_prosjek) C++17
Compilation error
0 ms 0 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+=v1[i];
        ans/=2.0;

    }
    cout<<fixed<<setprecision(6)<<ans<<endl;
}
int main() {
    MR_Robot
#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:22:5: error: 'MR_Robot' was not declared in this scope
   22 |     MR_Robot
      |     ^~~~~~~~
prosjek.cpp:25:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |     freopen("out.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~