1125. Chain the Ropes (25)
来源:互联网 发布:ros系统 与 linux 编辑:程序博客网 时间:2024/06/10 18:33
1125. Chain the Ropes (25)
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){ int n; vector<double> v; cin>>n; while(n--) { double t; cin>>t; v.push_back(t); } sort(v.begin(),v.end(),greater<double>()); while(v.size()!=1) { double m,n; m=v.back(); v.pop_back(); n=v.back(); v.pop_back(); v.push_back((m+n)/2); } cout<<(int)v[0]; return 0;}
阅读全文
0 0
- 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25)
- PAT 1125. Chain the Ropes (25)-甲级
- PAT 1125. Chain the Ropes (25)
- PAT_A 1125. Chain the Ropes (25)
- PAT甲级.1125. Chain the Ropes (25)
- PAT甲级 1125. Chain the Ropes (25)
- PAT 甲级 1125. Chain the Ropes (25)
- 1125. Chain the Ropes (25) 贪心
- PAT--1125. Chain the Ropes
- 1125. Chain the Ropes 解析
- PAT (Advanced Level) 1125. Chain the Ropes (25)
- PAT (Advanced Level) 1125. Chain the Ropes (25) 解题报告
- 1125. Chain the Ropes (25)[数学逻辑题]
- 置换群的基本概念与题目
- Python多进程(1)——subprocess与Popen()
- dlib 矩阵操作
- Linux学习资源
- SpringCloud---Eureka Server集群
- 1125. Chain the Ropes (25)
- 使用Opengl PBO上传下载数据
- 设计模式读书笔记-----单例模式
- 快速乘的原理及其代码
- 最小生成树(1)--Kruskal算法
- HDU 5543 Pick The Sticks(0-1背包)
- 【面试题】海量数据处理相关
- The Suspects(POJ
- 一个关于Span的学习资料, 很棒的文档