Language: C++

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }



int main() {
	int n;
	cin >> n;
	vector<double> v(n);
	rep(i, n) {
		cin >> v[i];
	}
	SORT(v);
	double ans = v[0];
	rep(i, n - 1) {
		ans = (ans + v[i + 1]) / 2;
	}
	cout << ans << endl;
}

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }



int main() {
	int n;
	cin >> n;
	vector<double> v(n);
	rep(i, n) {
		cin >> v[i];
	}
	SORT(v);
	double ans = v[0];
	rep(i, n - 1) {
		ans = (ans + v[i + 1]) / 2;
	}
	cout << ans << endl;
}



Compiler output:
a.cc:92:5: error: redefinition of 'int dx [4]'
   92 | int dx[4] = { 0,1,0,-1 };
      |     ^~
a.cc:35:5: note: 'int dx [4]' previously defined here
   35 | int dx[4] = { 0,1,0,-1 };
      |     ^~
a.cc:93:5: error: redefinition of 'int dy [4]'
   93 | int dy[4] = { 1,0,-1,0 };
      |     ^~
a.cc:36:5: note: 'int dy [4]' previously defined here
   36 | int dy[4] = { 1,0,-1,0 };
      |     ^~
a.cc:95:5: error: redefinition of 'int POW(int, int)'
   95 | int POW(int x, int y) { return int(pow(double(x), double(y))); }
      |     ^~~
a.cc:38:5: note: 'int POW(int, int)' previously defined here
   38 | int POW(int x, int y) { return int(pow(double(x), double(y))); }
      |     ^~~
a.cc:96:8: error: redefinition of 'double log(double, double)'
   96 | double log(double a, double b) { return log(b) / log(a); }
      |        ^~~
a.cc:39:8: note: 'double log(double, double)' previously defined here
   39 | double log(double a, double b) { return log(b) / log(a); }
      |        ^~~
a.cc:100:5: error: redefinition of 'int main()'
  100 | int main() {
      |     ^~~~
a.cc:43:5: note: 'int main()' previously defined here
   43 | int main() {
      |     ^~~~