题意:n个球,分成k堆。问堆的最大值的最小。

 #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ll n, m, aa[];
scanf("%I64d %I64d", &n, &m);
for(ll i = ; i <= n ; i ++)
scanf("%I64d", &aa[i]);
ll a = m * - n, mx = aa[n];
for(int i = ; i <= n - a ; i ++){
mx = max(mx, aa[i] + aa[n - a - i + ]);
}
printf("%I64d", mx);
return ;
}

codeforce 604B More Cowbell的更多相关文章

  1. codeforces 604B More Cowbell

    题目链接:http://codeforces.com/contest/604/problem/B 题意:n个数字,k个盒子,把n个数放入k个盒子中,每个盒子最多只能放两个数字,问盒子容量的最小值是多少 ...

  2. CF 604B More Cowbell#贪心

    (- ̄▽ ̄)-* //把最大单独放,然后第二大的和最小的放一起,第三大的和第二小的放一起 //由此类推,求最大值,即为盒的最小值 #include<iostream> #include&l ...

  3. 【31.72%】【codeforces 604B】More Cowbell

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  4. Codeforce - Street Lamps

    Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is ...

  5. 【CodeForces 604B】F - 一般水的题1-More Cowbe

    Description Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter ...

  6. Codeforce Round #216 Div2

    e,还是写一下这次的codeforce吧...庆祝这个月的开始,看自己有能,b到什么样! cf的第二题,脑抽的交了错两次后过了pretest然后system的挂了..脑子里还有自己要挂的感觉,果然回头 ...

  7. Codeforces Round #334 (Div. 2) B. More Cowbell 二分

    B. More Cowbell Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/probl ...

  8. Codeforce 水题报告(2)

    又水了一发Codeforce ,这次继续发发题解顺便给自己PKUSC攒攒人品吧 CodeForces 438C:The Child and Polygon: 描述:给出一个多边形,求三角剖分的方案数( ...

  9. codeforce 375_2_b_c

    codeforce 375_2 标签: 水题 好久没有打代码,竟然一场比赛两次卡在边界条件上....跪 b.题意很简单...纯模拟就可以了,开始忘记了当字符串结束的时候也要更新两个值,所以就错了 #i ...

随机推荐

  1. 在js中获取easyui datagrid的数据

    可以在页面对datagrid的数据直接进行修改,然后提交到数据库,但是要求在提交前获取datagrid的所有行的数据.API提供了getData方法,但是怎么用了,没说. 最后这样写才搞定 var a ...

  2. PHP MSSQL数据操作PDO API

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...

  3. uva 1103

    弄懂题意后  其实就是一个dfs /************************************************************************* > Aut ...

  4. Oracle----dual

    1. dual is a table that contains a single row. 2. The dual table has one VARCHAR2 column named dummy ...

  5. Eclipse 调整代码颜色的地方

    Editors - Text Editors General-Apperance-Colors and Fonts 各工作区里面的Editor和Syntax Coloring

  6. Codeforces Round #243 (Div. 2) A~C

    题目链接 A. Sereja and Mugs time limit per test:1 secondmemory limit per test:256 megabytesinput:standar ...

  7. poj 2888 Magic Bracelet

    经典的有限制条件的Burnside计数+矩阵乘法!!! 对于这种限制条件的情况我们可以通过矩阵连乘得到,先初始化矩阵array[i][j]为1.如果颜色a和颜色b不能涂在相邻的珠子, 那么array[ ...

  8. 获取Android系统时间

    目的: 输入 2014-09-09 14:02:03    输出 等待:1小时20分 注意: HH:mm:ss 为获取手机 24小时格式的时间  15:03    hh:mm:ss 为12小时模式的时 ...

  9. Ubuntu 12.04安装字体

    http://www.2cto.com/os/201210/160645.html 安装方法,终端输入:  $ sudo thunar /usr/share/fonts/truetype  待ture ...

  10. HeadFirst设计模式之单例模式

    一. 1.The Singleton Pattern ensures a class has only one instance, and provides a global point of acc ...