简单的题,直接贴代码
#ifndef HEAD
#include <stdio.h>
#include <vector>
#include <math.h>
#include <string.h>
#include <string>
#include <iostream>
#include <queue>
#include <list>
#include <algorithm>
#include <stack>
#include <map>
using namespace std;
#endif // !HEAD
int main()
{
#ifdef _DEBUG
freopen("d:\\in.txt", "r", stdin);
#endif
int n;
scanf("%d\n", &n);
vector<float> vcs;
for (int i = 0; i < n; i++)
{
float key;
scanf("%f\n", &key);
vcs.push_back(key);
}
sort(vcs.begin(), vcs.end());
float dres = 0;
for (int i = n - 1; i > 0;i--)
{
vcs[i - 1] = 2 * sqrt(vcs[i] * vcs[i - 1]);
}
printf("%.3f\n", vcs[0]);
return 0;
}