Submission #1276151

#TimeUsernameProblemLanguageResultExecution timeMemory
1276151SmuggingSpunProsjek (COCI18_prosjek)C++20
50 / 50
1 ms576 KiB
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	if(fopen(taskname".inp", "r")){
		freopen(taskname".inp", "r", stdin);
	}
	int n;
	cin >> n;
	vector<double>a(n);
	for(double& x : a){
		cin >> x;
	}
	sort(a.begin(), a.end());
	double ans = a[0];
	for(int i = 1; i < n; i++){
		ans = (ans + a[i]) / 2.0;
	}
	cout << ans;
}

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:7:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...