思路:

简单贪心。

实现:

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std; int a[], n; bool cmp(const int & a, const int & b)
{
return a > b;
} int main()
{
cin >> n;
for (int i = ; i < n; i++)
{
cin >> a[i];
}
sort(a, a + n, cmp);
double res = a[];
for (int i = ; i < n - ; i++)
{
res = 2.0 * sqrt(res * a[i + ]);
}
printf("%.3f\n", res);
return ;
}

poj1862 Stripies的更多相关文章

  1. POJ1862 Stripies 贪心 B

    POJ 1862 Stripies https://vjudge.net/problem/POJ-1862 题目:     Our chemical biologists have invented ...

  2. (贪心和优先队列) POJ1862 Stripies

    Stripies Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 21506   Accepted: 9478 Descrip ...

  3. 《挑战程序设计竞赛》2.2 贪心法-其它 POJ3617 3069 3253 2393 1017 3040 1862 3262

    POJ3617 Best Cow Line 题意 给定长度为N的字符串S,要构造一个长度为N的字符串T.起初,T是一个空串,随后反复进行下列任意操作: 从S的头部(或尾部)删除一个字符,加到T的尾部 ...

  4. 【POJ - 1862】Stripies (贪心)

    Stripies 直接上中文了 Descriptions 我们的化学生物学家发明了一种新的叫stripies非常神奇的生命.该stripies是透明的无定形变形虫似的生物,生活在果冻状的营养培养基平板 ...

  5. URAL 1161 Stripies(数学+贪心)

    Our chemical biologists have invented a new very useful form of life called stripies (in fact, they ...

  6. Stripies(POJ 1862 贪心)

    Stripies Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 14151   Accepted: 6628 Descrip ...

  7. POJ 1862 &amp; ZOJ 1543 Stripies(贪心 | 优先队列)

    题目链接: PKU:http://poj.org/problem?id=1862 ZJU:http://acm.zju.edu.cn/onlinejudge/showProblem.do?proble ...

  8. POJ 1862 Stripies (哈夫曼树)

    Stripies Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10263   Accepted: 4971 Descrip ...

  9. Stripies

    /* Our chemical biologists have invented a new very useful form of life called stripies (in fact, th ...

随机推荐

  1. 关于树论【动态树问题(LCT)】

    搬运:看一道caioj1439 题目描述 一开始给你一棵n个点n-1条边的树,每个点有一个权值wi. 三种操作: op=1 u v :在点u和点v之间建一条边. op=2 u v:摧毁点u到点v之间的 ...

  2. skynet源码阅读<3>--网关分析

    继上一篇介绍了skynet的网络部分之后,这一篇以网关gate.lua为例,简单分析下其串接和处理流程. 在官方给出的范例中,是以examples/main.lua作为启动脚本的,在此过程中会创建wa ...

  3. [Selenium] 操作页面元素等待时间

    WebDriver 在操作页面元素等待时间时,提供2种等待方式:一个为显式等待,一个为隐式等待,其区别在于: 1)显式等待:明确地告诉 WebDriver 按照特定的条件进行等待,条件未达到就一直等待 ...

  4. BZOJ_3049_[Usaco2013 Jan]Island Travels _状压DP+BFS

    BZOJ_3049_[Usaco2013 Jan]Island Travels _状压DP+BFS Description Farmer John has taken the cows to a va ...

  5. ARC和MRC混合使用

    在一些项目中尤其是做迭代的项目经常会出现MRC的项目,但是我们习惯了ARC环境,反之也是一样.这是我们不必去修改代码去掉release之类的,按照如下方案去做就可以了. 项目 -> Build ...

  6. CF1059D Nature Reserve(二分)

    简洁翻译: 有N个点,求与y=0相切的,包含这N个点的最小圆的半径 题解 二分半径右端点开小了结果交了二十几次都没A……mmp…… 考虑一下,显然这个半径是可以二分的 再考虑一下,如果所有点都在y轴同 ...

  7. Jquery禁用网页右键菜单

    $(function(){ $(document).bind("contextmenu",function(e){ return false; }); });

  8. (四)SpringBoot如何定义消息转换器

    一:添加fastjson依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>fastj ...

  9. oracle错误:1067进程意外终止

    oracle错误:1067进程意外终止我Oracle安装完了之后可以运行的 ,过了一段时间不可以了,就上网找了一下,原来是自己的ip已经改变.我一直使用IP地址的. 将D:\oracle\produc ...

  10. Throwing Dice LightOJ - 1064 || (勉强能用的)分数类

    Throwing Dice LightOJ - 1064 方法: 设ans[i][j]表示i个骰子点数恰好为j的概率.那么ans[1][1]到ans[1][6]都为1/6. 显然,$ans[i][j] ...