poj 1862 Stripies
来源:互联网 发布:永暑礁 知乎 编辑:程序博客网 时间:2024/04/29 08:24
原题链接:http://poj.org/problem?id=1862
简单题,贪心+优先队列主要练习一下stl堆。。。
#include<cstdio>#include<cstdlib>#include<cmath>#include<queue>#include<iostream>int main(){#ifdef LOCAL freopen("in.txt", "r", stdin); freopen("out.txt", "w+", stdout);#endif int n; double a, b; scanf("%d", &n); std::priority_queue<double> ans; while (n--){ scanf("%lf", &a); ans.push(a); } while (ans.size() > 1){ a = ans.top(), ans.pop(); b = ans.top(), ans.pop(); ans.push(2 * sqrt(a * b)); } printf("%.3lf", ans.top()); return 0;}
0 0
- POJ 1862 Stripies (贪心)
- POJ 1862 Stripies
- poj 1862 Stripies
- POJ:1862 Stripies
- poj 1862 Stripies
- poj 1862 Stripies 数学
- POJ-1862-Stripies
- Stripies - POJ 1862 水题
- poj 1862 Stripies
- poj 1862 Stripies
- POJ 1862 Stripies
- POJ 1862 Stripies
- POJ 1862 Stripies
- POJ 1862 Stripies 【贪心】
- POJ 1862 Stripies 笔记
- POJ 1862 Stripies
- POJ 1862 Stripies 贪心
- POJ 1862 Stripies 题解
- ACM--steps--dyx--5.1.5--Code Lock
- android EditText inputType说明
- Android 使用SQLite数据库使用Cursor(游标)来进行操作
- PCIe总线学习笔记(一、PCI基础知识简介)
- 好的资料库
- poj 1862 Stripies
- 分析一个Java Class文件
- B. School Marks (CF #301 (Div. 2))
- 苹果开发 笔记(17)
- Android视频播放项目总结之 使用第三方Vitamio库,开发万能播放器(四)
- 重载运算符
- poj 1338 Ugly Numbers
- Android学习笔记——关于onConfigurationChanged
- 多人协作慎用Storyboard