题意: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. mysql 增加删除用户

    mysql 增加用户 (注意:因为MYSQL环境中的命令,所以后面都带一个分号作为命令结束符) 格式:grant select on 数据库.* to 用户名@登录主机 identified by ' ...

  2. c++ deque 双端队列

    双端队列: 函数 描述 c.assign(beg,end)c.assign(n,elem)  将[beg; end)区间中的数据赋值给c.将n个elem的拷贝赋值给c. c.at(idx)  传回索引 ...

  3. jquery 对 Json 的各种遍历

    grep <script type='text/javascript' src="/jquery.js"></script> <script type ...

  4. FZU-1921+线段树

    简单的线段树. 记录MinVal 和 相应的ID即可 /* 线段树 */ #include<stdio.h> #include<string.h> #include<st ...

  5. iOS开发之loadView、viewDidLoad及viewDidUnload的关系

    iOS开发之loadView.viewDidLoad及viewDidUnload的关系 iOS开发之loadView.viewDidLoad及viewDidUnload的关系    标题中所说的3个方 ...

  6. spring的组成

    ① Spring Core:核心容器,BeanFactory提供了组件生命周期的管理,组件的创建,装配,销毁等功能 SpringContext:ApplicationContext,扩展核心容器,提供 ...

  7. 关于JavaScript中的setTimeout()链式调用和setInterval()探索

    http://www.cnblogs.com/Wenwang/archive/2012/01/06/2314283.html http://www.cnblogs.com/yangjunhua/arc ...

  8. MySQL复制应用中继日志解析

    前言:SQL线程应用中继日志,在binlog_format是row格式的时候,是居于主键更新,下面结合一张图来证明 1.从一个大神那边得到一张图片,SQL线程应用中继日志流程,下面就实验验证一下:(P ...

  9. AOSP

    定义编辑 "Android Open-Source Project"的缩写 中文意为"Android 开放源代码项目" 内容编辑 在Android Open-S ...

  10. WinAPI——钩子函数大全3

    函数原形:LRESULT CALLBACK JournalPlaybackProc(int code, WPARAM wParam, LPARAM lParam); 参数: code:指示一个代码,被 ...