ural 1935 Tears of Drowned
来源:互联网 发布:大数据 设备故障分析 编辑:程序博客网 时间:2024/06/06 04:04
//tral 1935 Tears of Drowned//http://acm.timus.ru/problem.aspx?space=1&num=1935/* * 题意: * 有n个皮毛,第i个皮毛两边至少需要Si个sheets隔绝,问最小需要多少个sheets? * 思路: * 直接需求最大的放置在中间,然后两旁依次放置需求递减的皮毛,则可能sheets得到最大的利用。 * 即只需要满足所有皮毛一边sheets的需求,另一边由需求更大的提供。总计就系sum + max(Si) * author:licatweijie */#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int s[101];int main(){int n;cin >> n;int ans = 0; for (int i=0;i<n;i++){ cin >> s[i]; ans += s[i]; } sort(s,s+n); ans += s[n-1]; cout << ans << endl;return 0;}
- ural 1935 Tears of Drowned
- URAL 1935 Tears of Drowned
- URAL 1935 Tears of Drowned
- URAL 1935 Tears of Drowned 解题报告
- URAL 1935. Tears of Drowned (水)
- Tears of Drowned
- Tears of Drowned
- Timus 1935. Tears of Drowned 详解
- Lake Of Tears
- Amount of Degrees URAL
- Freedom of Choice URAL
- shed tears
- NHS tears out its Oracle Spine in favour of open source
- ural 1014 Product of Digits
- URAL 1640. Circle of Winter
- URAL 1057. Amount of Degrees
- URAL - 1057 - Amount of Degrees
- Ural 1658 Sum of Digits
- 2014 Volkswagen Eos Reviews, Expert Car Reviews on AOL Autos_5
- C++多继承的二义性
- Catia中的方向余弦矩阵
- 组合类
- Android 两Activity之间动画效果(1)---------翻页效果
- ural 1935 Tears of Drowned
- slab分配器分配task_struct结构
- Eclipse快捷键组合
- fedora安装各种应用软件
- 数位板使用问题解决
- 七种武器武装.NET
- linux消息队列总结
- 服务器配置选项
- qt的APPLication Mainwindow layout 的基本知识