poj 1862 Stripies
来源:互联网 发布:mac 音频剪辑合成软件 编辑:程序博客网 时间:2024/05/01 19:22
优先队列的应用,主要是理解为什么每次要取最大的两个数,因为题目要求的是最后剩下来的那个变形虫的最小质量,所以我们要使质量大的变形虫尽量多的开平方。#include<iostream>#include<queue>#include<math.h>#include<iomanip>int n,x;using namespace std;int main(){ while(cin>>n) { priority_queue<double>q; for(int i=0;i<n;i++) { cin>>x; q.push(x); } for(int i=0;i<n-1;i++) { double a=q.top(); q.pop(); double b=q.top(); q.pop(); double c=2*sqrt(a*b); q.push(c); } cout<<fixed<<setprecision(3)<<q.top()<<endl; } return 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 题解
- XCode 4.3.2 如何新建 Window-based Application
- 如何写健壮的代码
- 国家十二五重大专项
- 【android之ADB命令】ADB SHELL 命令乱码解决方法
- 怎么访问图像像素
- poj 1862 Stripies
- 在Windows下使用OpenCL
- Android APK 签名比对
- 使用Asterisk接收彩信(三):又一次失败的尝试
- 如何理解LPCTSTR类型?
- opencv 显示最小面积的外接矩形,并求该矩形的长和宽以及四个角的位置
- Android 通过软引用实现图片缓存,防止内存溢出
- SQL Server数据库程序设计知识总结
- windows下类似linux编译环境搭建